hardaysknight
Lifetime Supporting Member
I'm trying to fix a mess of code on an older machine that's running a Micrologix 1400 and an RS232 ASCII barcode scanner.
The previous guy had individual rungs of code for every possible length of barcode we could scan, which of course takes up a lot of room. I know I can clean this up and have the logic be more flexible.
Now my problem lies with the ARD/ARL instruction set. It requires a fixed length to be set in order to know how many characters to look for (and frustratingly, this can't be an indirect integer).
According to the manual, and our very own Ken Roach (as seen here), I should be able to set the expected length to 0, and it read everything in the buffer (up to the max of 82 characters).
However, when I do that, I'm never getting the .DN bit from the control on the ARD instruction (because it's expecting up to 82 characters). Therefore I never get the characters in the buffer to transfer to the string file.
How do I get this to work?
The previous guy had individual rungs of code for every possible length of barcode we could scan, which of course takes up a lot of room. I know I can clean this up and have the logic be more flexible.
Now my problem lies with the ARD/ARL instruction set. It requires a fixed length to be set in order to know how many characters to look for (and frustratingly, this can't be an indirect integer).
According to the manual, and our very own Ken Roach (as seen here), I should be able to set the expected length to 0, and it read everything in the buffer (up to the max of 82 characters).
However, when I do that, I'm never getting the .DN bit from the control on the ARD instruction (because it's expecting up to 82 characters). Therefore I never get the characters in the buffer to transfer to the string file.
How do I get this to work?