micrologix 1400 ascii string

irondesk40

Member
Join Date
Jan 2008
Location
nc
Posts
630
Have been experimenting with connecting a sick barcode scanner to a micrologix 1400 plc and been able to successfully read the barcode into a ST register. Now the problem is that the system that I am working on is using a maples display and it does not support the string registers. I called Maples and they said that I would need to copy it to a N register. Well, that does not work, i get error message in the plc when i tried to verify the project. Is there a way to do this. For example in the PLC after reading the barcode into ST17:13 it contains the barcode 074200149265, how can i move or copy this into a N register and then display it. At the moment, got me stumped. I told the manager lets take it out and put in a AB panelview, but the maples is already in the machine. Thanks
 
In the MicroLogix 1400, try using the Copy Words (CPW) instruction instead of the conventional Copy (COP) instruction to move the STx:y.z array into an Nx:y data table array.

The first word (STxx:y.0) is the Length value, and each word after that (STxx:y.1 and higher) are two characters of ASCII data.
 
I think we're interpreting Maple Systems' advice to "move it to an N register" differently.

I presumed that Maple Systems reads arrays of Integer registers to display a string.

I suppose this really requires some knowledge of the Maple Systems HMI and how it handles Allen-Bradley String datatypes.
 
I called Maples and was told that the firmware in the displays they have do not reconize a string. They did say that they have had some customers that have told them that they worked around it by copying into a N register. I tried it on the bench and the plc faulted. Do not remember the same code at the moment. was really disappointed since i had worked about 3 hours getting into the plc and then when i went to create a diplay on the screen found out it did not support the Strings. Will try the copy word tomorrow.
Ken, how would you then display that on the screen Thanks
 
I was able to get the barcode scanned into the micrologix 1400 and then use the AEX(String Astract) instruction to break down the 13 character barcode into smaller values and use the ACI(Ascii to Integer) instruction to place the broken down barcode data into N registers that could then be displayed on the Maples display. The problem I ran into is that the ACI instruction does not reconize the leading 0's. For example I had the following barcode after scanning - 042001492650. After the ACI instruction the values in the N register would be as follows - 742 149 2650. I attached a copy of the program I was working on at the bench. There is some extra stuff, actually the dryer that I have running that I did with the 1400 and the maples and just added the extra files to test the scanner on the bench. I am sure there are a lot of folks that have more knowledge than me and I would greatly appreciate it if mayby you could take a look and possibly suggest a different approach.
THANKS
 
Can you display the strings which resulted after multiple use of the AEX instruction? Where did the '7' come from? (Edit - I see there was a 7 in your previous post. It must be a typo that you left it out.)

The ACI instruction will produce a number, not a string. Leading zeroes are not part of the number but you may be able to set your display to show them. To show the '742' as '0742' look for a setting of 4 digits and an option of padding the left with zeroes. (I don't know the Maple display. You'll have to find this yourself.)
 
Last edited:

Similar Topics

Hi I am new to the forum. I have a question regarding serial communications in the Micrologix 1400. I want to print a QR code, Barcode and...
Replies
1
Views
2,884
I apologize for the elementary content of my question. I have just started and I have been trying to do some of the examples in the manual, but I...
Replies
3
Views
2,862
Hi all, Question straight up: if I have a micrologix 1400 with a value of 1234 in register N7:0, how can I convert that value to ASCII values and...
Replies
6
Views
5,896
Hi all, I would like to read ASCII weight from 2 scales into a single serial port on a MicroLogix 1400 using RS-485. I haven't seen any posts on...
Replies
0
Views
3,109
Hi, I am trying to get Allen Bradley Micrologix 1400 to send ASCII commands over a RS-485 2 wire connection. I can get PuTTy to communicate just...
Replies
5
Views
9,089
Back
Top Bottom