Serial Communications

K.C.

Guest
K
I am using a Micrologix 1500 LRP Processor. I need to communicate to a device via serial communication. That is no big deal. However the device requires an "STX" & "ETX", start of text and end of text character to be sent prior to and after the string I am sending. I am wondering how I send the STX and ETX. Do I just write a string with "STX", then write the string I want to send, then write a string with "ETX"? I have never had to do this before with serial communication. Any help is appreciated. Thanks.
 
Start of Text (STX) and End Of Text (ETX) are two specific non-printable single ASCII characters. They are coded by the values 2 and 3 respectively. You'll probably have to add STX using string instructions to the start of your message. The configuration for the channel allows you to specify ending characters. While these are normally Carriage Return (CR or 13) and/or Line Feed (LF or 10) you should be able to set it to one character, that being the End Of Text (ETX or 3)
 
Bernie is right on; you can configure the "first and second Append Characters" in the Channel 1 General Configuration window for the MicroLogix 1500 in RSLogix 500.

This only affects the characters that are appended to the end of a string that is transmitted from the serial port using the AWA instruction (ASCII Write with Append).

There's another setting on the Channel 1 configuration window, for string Termination Characters. These are defined for incoming strings, and are usually CR and LF. This tells the controller what to look for to consider an incoming string of characters a "line" for the ARL (ASCII Read Line) serial port instruction.

Your application is different from both of these; you need to pre-pend as well as ap-pend characters to your string.

I would go with Bernie's strategy of simply entering them manually into the string contents. You can specify unprintable characters with their control codes (by typing "^B" or "^C" where the caret "^" is shift-6, not Control) or with a backslash and their hex value; "\02" and "\03".

Your string entries then become like this:

^B123OutputString^C
or
\02StringForOutput\03

RSLogix 500 will always display your unprintable characters using the first method, so I usually type them in as hex and then watch them turn into Control Characters to remind myself I got the correct ones.
 
You are right on the money, Ken. Thanks for the reply (everyone). I actually figured this one out on my own... (trial and error). I wrote (AWT) the string "^B", then my text, then "^C". It worked like a charm. Once again, thanks for the speedy and helpful information. I am glad to have found this website. Unfortunately, you'll probably be hearing more from me in the future. :)

K.C.
 

Similar Topics

Hi, I am communicating with a LIN interface (PCAN-LIN) for a project. I am using a CompactLogix PLC with serial port. I was wondering if anyone...
Replies
1
Views
2,139
I've been searching through the forums to see if I could find this question answered anywhere else without success. My apologies if this is a...
Replies
16
Views
8,739
Hi - I am looking to replace two GE 90-30 IC693CMM311 modules and will be using Rx3i system with a IC695CPE310 processor. I programmed these years...
Replies
3
Views
2,121
Hello, I am in the process of upgrading a SCADA apllication to a windows 7 PC. The issue that i am running into is that Wondeware does not...
Replies
11
Views
5,442
Hi All, I am having trouble getting my head around an upcoming application. What I have is a Omron PLC running sysmac configuration software...
Replies
3
Views
1,348
Back
Top Bottom