Sign in to follow this  
Followers 0
heron8888

basic program help

4 posts in this topic

I have a 5/03 machine with basic module, prt1 reads in asci string from barcode with the following program 0 rem grosever1 10 mode (prt1,9600,n,8,1,n,n) 20 push 3 30 call 120 40 push 1 50 push 15 60 push 3 70 push 1 80 push 0 90 push 0 100 push 1 110 call 22 120 goto 120 130 end this works fine but i want to know how to modify program so that there is a second identical barcode scanner in prt 2 and they work independently I am ok with rs logix program and can do this side of the program but have no idea on the basic side any help would be greatly appreciated

Share this post


Link to post
Share on other sites
I am use to 1 port for programming and ath other configed for serial you might try. 10 mode (prt1,9600,n,8,1,n,n) 20 push 3 30 call 120 40 push 1 50 push 15 60 push 3 70 push 1 80 push 0 90 push 0 100 push 1 110 call 22 120 goto 120 130 mode (prt1,9600,n,8,1,n,n) 140 push 3 150 call 240 160 push 1 170 push 15 180 push 3 190 push 1 200 push 0 210 push 0 220 push 1 230 call 23 240 goto 240 Its been along time. I use GSC Module's for barcode readers all config is done in logic. I will post a basic program that has good documation and you might see what you need. Basic.txt

Share this post


Link to post
Share on other sites
5 X=0 10 IF X=0 THEN GOTO 50 ELSE GOTO 10 50 REM ******************************************************************* 60 REM *****THIS PROGRAM TAKES SERIAL DATA AND PLACES IT IN THE M FILES*** 70 REM ******************************************************************* 80 REM 90 REM **THE NEXT SECTION OF CODE CONFIGURES THE SERIAL PORTS** 100 MODE (PRT1,9600,N,8,1,N,N) 110 MODE (PRT2,9600,N,8,1,N,N) 120 REM 130 REM 140 REM **THIS SECTIONOF CODE SETS THE STACK AND RUNS CALL 22 FOR PORT 1** 150 PUSH 1 160 CALL 120 170 PUSH 1 180 PUSH 14 : REM MAXIMUM NUMBER OF CHARACTERS 190 PUSH 13 : REM ASCII VALUE USED AS TERMINATION CHARACTER 200 PUSH 1 : REM OUTPUT DATA FILE 210 PUSH 40 : REM OFFSET INTO DATA FILE 220 PUSH 0 : REM STRING NUMBER 230 PUSH 1 : REM BYTE SWAPPING 240 CALL 22 260 REM **THIS SECTIONOF CODE SETS THE STACK AND RUNS CALL 22 FOR PORT 2** 265 PUSH 2 266 CALL 120 270 PUSH 2 280 PUSH 10 : REM MAXIMUM NUMBER OF CHARACTERS 290 PUSH 10 : REM ASCII VALUE USED AS TERMINATION CHARACTER 300 PUSH 1 : REM OUTPUT DATA FILE 310 PUSH 20 : REM OFFSET INTO DATA FILE 320 PUSH 0 : REM STRING NUMBER 330 PUSH 1 : REM BYTE SWAPPING 340 CALL 22 350 X=X+1 360 GOTO 10 This code works if you are using M files to read your data. You can change your offset into data file setting to move the location in the data file.

Share this post


Link to post
Share on other sites
thanks for your replys i will give the programs a test

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0