Help with sending ascii characters

dhrv_prmr

Member
Join Date
Jul 2014
Location
bardoli
Posts
3
I am new to programming in PLC, i have Allen Bradley SLC 5/03. I tried using AWT inst. with data in ST9:0 file directly but in 3 inst. getting error high out of six. I dont know what is buffer. Do i need to put string in buffer first then to write on channel0.
After toggle this awt inst. gives some random characters on rs232(examined on Hyper Terminal).
Please Guide me from first step what combinations of ascii inst. will send ascii string succesfully.Thank you.
 
Do I need to put string in buffer first then to write on channel 0?
No, you should put a string in a ST-type file (ST10:0 for example), then trigger a AWT ASCII Write instruction to take the ST string and send it to the SLC ASCII Send buffer (which will automatically try to send your string to another connected device).

See the RSLogix Help file (in your RSLogix software and copied below) for information about how the AWT works. All of your data may not be sent in 1 PLC scan, so your AWT trigger device needs to stay on until the AWT DN bit goes ON.
AWT [ASCII Write]
Rockwell Software
Use the AWT instruction to write characters from a source string to an external device. To repeat the instruction, the rung must go from false-to-true. When using this instruction you can also perform in-line indirection.

Entering Parameters
Channel is the number of the RS-232 port. This must be 0 unless you are using a MicroLogix 1500 LRP Series B, in which case it may be 0 or 1.
Source is the string element you want to write.

Control is the area that stores the control register (required to operate the instruction).

String Length (.LEN) is the number of characters you want to write from the source string (0-82). If you enter a 0, the entire string will be written. This is Word 1 in the control block.

Characters Sent (.POS) are the number of characters that the processor sent to the display area (0-82). This field is continuously updated during the execution of the instruction. This value can be greater than the string length if appended characters or inserted values from in-line indirection are used. If the string length is greater than 82 the string written to the destination will be truncated to 82 characters. This is Word 2 in the control block.

Error is the hexadecimal error code that indicates why the ER bit was set in the control data file. Refer to ASCII Error Codes for an explanation of any displayed error code.

SLC Operation
1 The AWT rung goes from false-to-true, setting the EN (Enable) bit.
2 The instruction is put in the ASCII queue, setting the EU (Queue) bit.
3 The instruction executes and the RN (Run) bit is set.
4 Forty characters are sent from the source string through channel 0.
5 The DN (Done) bit is set and a value of 40 is present in .POS word of the ASCII control block.
6 When the program scan finds the DN bit set, the processor sets the EM (Synchronous Done) bit.
 
Last edited:
Thank you for quick reply
working on it but
one more doubt, is there any term like starting characters and termination characters for string?
 
Last edited:
If you need to add termination characters to the end of your Send string, use the AWA (ASCII Write with Append) command instead of AWT. AWA will append the 2 characters that you set up in your SLC "Channel 0 User (ASCII) Channel Configuration" dialog.

If you need to add beginning characters, before you try to send your string, you have to use the ACN instruction to link 2 strings (your beginning characters and the sent string) into one string.
 
Got it. There is termination character settings in "channel config" > User mode

and i think i need to use AHL inst. before AWT because i am communicating with GSM modem SIM900 via RS232 and it will need some Request To Send and Data Terminal Ready signal first may be.
 
Last edited:

Similar Topics

I am very new to programming PLCs, and one of the first tasks I received was to create a program that creates a socket connection between my PLC...
Replies
5
Views
2,541
Hi I have a job to do which is to have a call button and a sounder on either end of a line so if the operator needs assistance they can press the...
Replies
10
Views
3,906
Hi all, awsome forum, great wealth of knowledge. Little about me, I have been programming plcs for about a year now and have a background of...
Replies
0
Views
2,712
Can anyone help place a message in a string data file so that it can be sent via email to the desired location.Any code using RSLogix 500 will be...
Replies
13
Views
2,291
this a program to send data to barcode printer I want to integrate a new printer in a new machine and i wanted to adapt the old prgram on it but I...
Replies
2
Views
58
Back
Top Bottom