Controllogix Serial Comm's - Only ASCII?

skyfox

Lifetime Supporting Member
Join Date
Nov 2006
Location
CA
Posts
279
Hello All,

I am trying to talk to a serial device via Controllogix L5550 Serial Port. Reading thru the device manual, it appears the communications are based on transferring of command bytes (1 Byte during each Send or recive transaction) between the Host, in this case The CONTROLLOGIX CPU, and the serial device.

Device manual mentions an optionally available Serial protocol that uses ASCII commands for communications. But ds not available for the Firmware revision of the device that the customer has.

Basically Comm's goes like this.....

1) HOST Sends a Byte ( 0-255 ) telling the device what it intends to do.

2) Device ECHO's back the Byte recived from the Host as an Ack.

3) Then the host sends Another command byte requesting the needed data.

Etc. Etc.

I ve been palying around with the Logix COMPORT talking between two controllogix processors, but communications are in ASCII.

How does one send/Receive "HEX/Binary" data using the Logix PLC's SERIAL Port?

Is it even possible?

Or is it only capable of Sending in ASCII mode?

Also, how can I Convert an ASCII character to get it's Decimal equivalent in a ControlLogic CPU. (Version 16 & Higher). I could not locate an instruction that would support this.


Thanks
 
User Mode on a ControlLogix serial port is aimed at ordinary ASCII string functions, which is why the String datatype is the usual argument for the ASCII instruction set.

But you can implement binary protocols with it, too. You'll have to master the notation that RSLogix 5000 uses for unprintable characters, but because each character of an RSLogix 5000 String datatype is one 8-bit SINT tag, it's pretty easy to handle.

Remember also that you can define custom-length Strings instead of using the default 82-character String datatype that is built to be similar to the PLC-5 and SLC-500.
 
User Mode on a ControlLogix serial port is aimed at ordinary ASCII string functions, which is why the String datatype is the usual argument for the ASCII instruction set.

But you can implement binary protocols with it, too. You'll have to master the notation that RSLogix 5000 uses for unprintable characters, but because each character of an RSLogix 5000 String datatype is one 8-bit SINT tag, it's pretty easy to handle.

Hi Ken,

Thanks for the reply. Can you elaborate bit more on "Binary" protocol. How would I go about doing this?

For starters, Lets say I want to send 0xFF or 255 to the external device (Not the ASCII Character as the esnd device will not under stand it), how would I go about doing that?

Same instructions (AWT, ARD) used for Binary as well?

Bit confused about how to get this accomplished.

Thanks again.
 
Yes, AWT will send just the data in the String argument. AWA is the one that appends the termination characters.

ASCII instructions execute on a false-to-true transition of the rung, and there's no buffering or sequencing built in; you have to wait until each instruction is complete before executing the next one.

It'll take a little work and experimenting to get the inquiry / response / command sequence right but it's definitely do-able.

Send_FF.png
 
Ken/SThompson,

Thank you both for your reply. I think I sought of got this but still need a bit of help. At least on the Rx Data Part.

This being a "Single Byte" Send/Recive, which actually takes "TWO" bytes to transmit either 255 or -128 to + 127, I need to know how to get the received value;

Which is Now in:

A_STRING[0]
A_STRING[1]

In to a single "SINT" or "INT" register and have its bit set accordingly.

I.e. Looking at the "ARD" cmd, received "FF" needs to be placed in a "INT or SINT" register with it's BITs set accordingly. in this example, destination register should have all its bit set.

For "FF" Destination shoul be "11111111". Not sure how to accomplish this. Any help would be gratly appreciated.

Thanks again.

SerialTX.JPG
 
Last edited:
I assume you just poked "FF" (in ASCII) in there, rather than "$FF", which is one hex byte.

The .Data portion of a String is just an array of SINT values. You could simply MOV the value of A_STRING.Data[0] to another SINT tag, or compare or otherwise address it directly.
 
Ken,

This is where I am a bit confused.

Transmission supoosed to be a Transfer of a Single Byte command between the Host and the END deivice.

Say for an example, Device is expecting a value of "128" from the PLC.

What do I send out of the PLC's Serial Port and in what Format?

Decimal 128?
Hex "80" ?
or the ASCII Charcter that is equal to 128?

End device does not understand ASCII.

Thanks
 
It's probably easiest to think of the values in Hex, and put them into the String datatypes preceded by a dollar sign.

80 (hex) = 128 (decimal) is represented in a SINT tag as -128, and in the RSLogix 5000 String editor as "$80".

Because SINT datatypes are Signed, they aren't the easiest way to represent hexadecimal data, but they work.
 
It's probably easiest to think of the values in Hex, and put them into the String datatypes preceded by a dollar sign.

80 (hex) = 128 (decimal) is represented in a SINT tag as -128, and in the RSLogix 5000 String editor as "$80".

Because SINT datatypes are Signed, they aren't the easiest way to represent hexadecimal data, but they work.


Thanks again Ken,

Much appreciated. I am actaully going to have access to the device next week. I will paly around with it and see how it responds back.

Best-
 

Similar Topics

The only thing I've ever used a Logix controller serial port is for configuration purposes. I have never seen that port utilized for data...
Replies
5
Views
2,682
Hi. Anybody know which Wonderware I/O-DA server I should use to communicate to AB ControlLogix via USB/serial cable. I am relearning Wonderware...
Replies
6
Views
3,080
It Seems "ARD" Instruction hangs up sometimes after an "ACL" instruction executes. Processor: 1756-L55 / V16 firmware Program Steps: [ARD]...
Replies
0
Views
5,736
Hello All, I am trying to talk to a serial device via Controllogix L5550 Serial Port. Reading thru the device manual, it appears that...
Replies
0
Views
2,727
If you were to set up serial communications to pass data back and forth between a Siemens S7 315 Processor and an Allen-Bradley ControlLogix 5561...
Replies
1
Views
3,300
Back
Top Bottom