Host Engineering Forum
General Category => DirectSOFT => Topic started by: Elect2 on August 11, 2009, 02:55:05 PM
-
I am working in a sorting program project equipped with 10 lanes. I am able to read the bar codes (from the boxes of our products)and input the number to a D06 using the first 8 inputs. The decoder outputs the barcodes as BCD numbers. In the program I use an equal instruction to assign the product to a particular lane.
The program was writen in RLL and is working, but is extremely long, and seems somewhat unstable. My question is would it be simpler if I use RLL plus (stage programming)for this particular application.
-
Always a good question. If your program has lots of concurrent logic and is not particularly sequential, I wouldn't. If it has a significant sequencing requirement, Stage is the best tool for the job.
-
You've got 8 bits BCD. That's 0-99. Reserve 100 V memory registers. Lets say starting at V10000 up to V100143.
Then assign the value of V10000 equal to the lane number for bar code reading '0'
V10001 = '1' etc.
Do a simple lookup using a pointer.
LD BCD input number
BIN conver the BCD to binary
LDA O10000 load the address of V10000
ADDBS add the computed offset (which is sitting on the stack) to it
OUT V2000 (I'm using V2000 as a 'pointer)
LD P2000 (The accumulator now has the lane number for the BCD barcoded input)
OUT to wherever you want it.