Sign in to follow this  
Followers 0
bjcanning

How to send ascii string with carrige return

5 posts in this topic

I'm sure there is a way to do it but not sure how. I am sending a string to a robot controller and need to end my string with a carrige return, line feed, or carrige return and line feed. Do I need to mess around with the channel configuration? Any help greatly appriciated.

Share this post


Link to post
Share on other sites
Look at the General Tab of the Channel Configuration, and enter the appropriate ASCII characters for carriage return in the 1st and 2nd AWA Appended Characters.

Share this post


Link to post
Share on other sites
I entered \d for both the 1st and 2nd AWA Appended Characters under the general tab of the channel config. \d should be a carrige return right? When I string my data into the robot it doesn't see the CR. I hooked my plc to hyperterminal and sure enough, the PLC isn't doing a CR at the end of my string. Any suggestions?

Share this post


Link to post
Share on other sites
The default values in the Channel 0 ASCII mode Termination Characters fields are \d and \ff. The notation with the leading backslash indicates these are hexadecimal values, with "\d" meaning 13 decimal, which is an ASCII carriage return. The value "\ff" = 255 decimal, which indicates to the MicroLogix that it should ignore that termination value. I think that if you have "\d" in both fields, that the receiving device is going to see your string followed by two carriage returns, which it might interpret as one good command and one empty command. This returns us to the original question; why isn't the MicroLogix appearing to send the correct termination character ? Be certain you're using the AWA (ASCII Write with Append) to use those termination characters. The ASCII Write (AWT) instruction sends only your source string data and omits the termination characters. If you wanted to try to send a carriage return and line feed, the two termination character entries should be "\d" and "\a"

Share this post


Link to post
Share on other sites
Thanks Ken. I was not using the AWA instruction. I now understand my problem. Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0