ASCII escape characters in string file?

JHarris

Lifetime Supporting Member
Join Date
Jan 2006
Location
Tennessee
Posts
48
I have a SLC 5/04 and a device that accepts ASCII commands. The commands use escape codes (such as ESC + STX + A). I'd like to save the seven possible commands in a string file for use, though I don't see a way to enter the escape codes. If I open a string file, I can't switch the radix to hex or dec.


Example: I'd like to store the ASCII equivalent of hex 1B0241 in a string file.

I can enter the codes in an ASCII data file, though the transmit functions apparently require string data type. I guess either a way to manually enter the codes (in string data file) or some logic to do ASCII->STR conversion is what I need. Did I miss an instruction to do this?

Thanks
 
Try this

Referring to an ASCII chart, insert a caret (Shift+6) in front of the desired special character equivalent. Using "^M^J" will send a CR and a LF.
 
This works for everything except Ascii ESC, FS, GS, etc.

Entering ^A for example in the string data file shows length 1. When I try the escape character ^[ RS Logix 500 enters a backslash automatically (shows string length of 2) showing \^[

any ideas?

Thanks Doug
 
Solution Found

Found the answer, posted a while back. Surprised I didn't find this on my search earlier:

I don't know about MicroLogix, but in CompactLogix you can enter non-printable characters bij entering a dollarsign followed by a two-digit hexadecimal number, eg. $0A for linefeed, $0D for newline and $1B for escape.

If you're using an SLC, you can do the same by entering a backslash followed by the hex code: \0A, \0D and \1B.

Using the \hex has worked for everything and using the carat works for most characters.

Thanks again.

Justin
 

Similar Topics

Hi all, My requirement is to send out escape character ( and also enter , line feed characters)from MicroLogix serial port configured in ASCII...
Replies
3
Views
7,521
Hi, We couldn’t find anything specific, so am starting a new thread. I’m trying to migrate a config from a ML1400 to a micro820 & am experiencing...
Replies
1
Views
71
I have an L24ER-QB1B with a 1769-ASCII card in slot number 4. I'm looking to send data to this zebra printer after every completed sequence. I'm a...
Replies
2
Views
425
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
720
I am trying to import addresses and symbols from a PanelBuilder32 application into the RSLogix 5 Address/Symbol database - however each time I...
Replies
5
Views
520
Back
Top Bottom