Introduction to the SLC-500 ASCII Read Line (ARL)
We use the SLC-500 ASCII Read Line (ARL) to read ASCII data from the serial port. Particularly, this might be from a bar code reader, weigh scale, or RFID reader. Basically, we will just execute the ARL instruction every second, to see if there is a line in the buffer that we need to read. Realize this post is just for example only, and the application at your facility may differ. Our goal in this section is simply to read a line of text that we type into a terminal, such as PUTTY. The cable between the processor, and the PC is NULL Modem.
Configure Channel 0 for ASCII
First, let’s drop offline for now, and check the serial port configuration. Go to “Channel Configuration” to make sure channel 0 is in user mode. Check the baud rate (and other settings) on the Channel 0 user tab.
The termination characters are important to determine the end of the ASCII string (end of the line) that you will read. In this case, we’ll just leave them at default values.
Data Files
Next, be sure you have a control element that is not in use. Go to the R6 data file, and click “usage”.
Also, create a new data file that is the string type. In this case, I’ve created ST10. If you use an existing data file, be sure we will choose an element later on in logic that is not in use.
Set up the Logic
I’m just going to create a timer that resets itself every 2 seconds. We’ll use this timer to trigger the ARL instruction to read data from the terminal.
You are ready to download, and go to run mode. Be sure you are not getting any errors.
Set up the Terminal
As long as we know our baud rate, and the COM port we are plugged into, we should have no problem with communication. Go to “Device Manager” to find the COM ports that are available. In this case, I’m using a USB to Serial adapter that is on COM4.
I’ll open PUTTY, and set it up for a Serial connection through COM4. The baud rate is 19200.
Realize that in PUTTY, there is no echo turned on, so we will not see what we type. I’m just going to type ARL TEST, and see if the processor will read the text.
Obviously, our logic is working! Using the HELP file now, you can look at ways to extract and compare various parts of the string to do different functions in logic.
If you need the processor to write data to the field device, check out the AWT Post!
— Ricky Bryce
thank you for sharing…
I will test and comeback if I have an issue
regards
bin mulyadin
Hope you get it to work! I always like to use ASCII to communicate with most any other device I build. Especially with the Arduino processors. ASCII is very versatile, and an easy way to communicate digitally across many different platforms.