RSLogix 500 and the ARD instruction

hardaysknight

Lifetime Supporting Member
Join Date
Dec 2015
Location
Southeast USA
Posts
117
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?
 
Serial controllers (and all devices for that matter) typically operate in two modes: polled & interrupt.

"Interrupt" in this scenario means telling the PLC what terminator to look for and notify when found. (i.e. the .DN bit)

"Polled" here means the controller gives you each character as it comes in.

So you're operating in polled mode here (setting length=0). You need to check each character as it comes in for the terminator.

For this you use ACB.
 
Also, if you use the ARL, then the /DN bit's value should become 1 when the termination character is received, and .POS should have the number of characters (including the termination char), even if the number of characters specified in .LEN have not been received.

So interrupt mode should work too. The only problem will be if the length of the bar code exceeds 82.
 
Thanks guys. I was on the right track, I just needed a nudge in the right direction. I was under the impression that the scanner already had the carriage return terminating character set, which is what the PLC was looking for. It apparently did not, which explains why the code was written the way it was originally.
 

Similar Topics

Hi, I’m looking at the difference between standard and pro versions of RSLogix 500. I know the pro version lets you edit the database in excel...
Replies
11
Views
2,755
Does anyone know if Rockwell has special pricing for upgrading a license of RSLogix 500 Starter to the Standard version? (Reason is to have online...
Replies
3
Views
2,809
The initial problem here is that I do not know the correct terminology for this to be able to properly search for the answer that I'm sure is...
Replies
3
Views
3,272
I have a brand new copy of this software,never opened.What is it worth and whats it for?Keep in mind I am a musician not a computer guy.Any help...
Replies
3
Views
1,920
Hello all. I've been looking into sequencer blocks on RSLogix 500 and am planning to rewrite a sequence based program that I originally wrote in...
Replies
4
Views
6,894
Back
Top Bottom