Help? Allen bradley PLC serial ASCII data input


Thread Starter

Bob Richardson

The text stream is serial data with CR-LF as terminator originating from a laser.

Anyone put together any thing like this?

Which devicenet modules have you used for serial data input to PLC?

Any examples of a PLC program (ladder) to extract the value from the midle of the text stream?
I've done several system like what you describe, usually with barcode readers as the serial devices.

The category of DNet/ASCII interfaces was pioneered by DIP Inc. with their CDN-066 device, but since their takeover by MKS Instruments their
prices have gone up and quality has not. Meanwhile, other vendors have caught up, including Western Reserve Controls and their 1782-JDC and even Allen-Bradley with their 1734 ASCII interface for the POINT I/O family.

Any of these techniques are going to give you an array of hex bytes in I/O memory that you're going to have to manipulate into a STRING data
type in your Allen-Bradley PLC using ladder logic. Once the data is in order in the String, you can use a PLC instruction like the ACI (ASCII string-to-integer) to pull a numeric value out of a string.

Life is simpler if these strings just are received by the serial port of the controller and can be moved directly from the serial port
buffer into STRING data types. A "smart buffer" such as those offered by B&B Electronics might be a good choice if your serial port is
free to take these strings and you don't need the distance or I/O blocks that DeviceNet can provide.

You didn't mention what controller model you're using... that can make a difference !

Tell us more about your application (like the baud rate and ASCII framing (parity, stop and start bits) and how many devices you need to
connect and more info may be forthcoming.

Allen Nelson

I've done barcode and scale readings serially on PLC-5. But not through devicenet. There's an ancient module, 1771-RB, that can handle
serial strings and get them to a PLC-5 via BTR. It works well enough.

Once the string is in an N register, it's fairly straight forward to COPy it to a ST register, and use the ASCII functions to extract the


Yosef Feigenbaum

Once again I recommend the 1771-DA (ASCII module) if you are using a 1771 I/O system and you don't need to use Device net. The DA can be configured to convert numeric text in the input string to BCD which can then be easily manipulated (using an FRD instruction) in the PLC.
More tips:

Some programming and configuration issues can make getting an I/O data block full of ASCII data (from a DeviceNet scanner) into a STRING data type difficult.

1. Offset of the data. If you have a device with an odd number of header bytes, your ASCII string might begin at Bit 08 instead of at Bit 00 of the I/O table 16-bit Word. This makes moving the data around a colossal pain. Use the Advanced Mapping feature in RSNetworx to make sure the ASCII data itself begins at the beginning of a Word. This is no big deal in ControlLogix but matters in SLC and PLC-5.

2. Byte Order. It's very common for the order in which incoming DeviceNet byte strings are assembled into 16-bit PLC data Words in the I/O table to be backwards from the human-readable sequence you want. In the SLC-500 you can use the SWP (byte swap) instruction to reverse this, but in the PLC-5 that instruction is lacking so you end up doing a bunch of BTD (bit-field- istribute) instructions.

It's better to make sure your DeviceNet/ASCII product has a "byte swap" option. The 1782-JDC from Western Reserve Controls, for example, has this feature.