about serial event

only11

Member
Join Date
Oct 2012
Location
solapur
Posts
8
hello friends

this is my first post so hope i will get my doubt solved

is it possible to program PLC to take an action when an event occurs on the serial port?

For e.g.,

If I send an integer or a character like "1", "2" , "a" or "B".....etc

I want my PLC to react to these events (like make output coil ON....etc
waiting for more replies
:unsure:
 
Yes, it is possible. The MicroLogix 1400 Channel 0 or Channel 2 can be configured for ASCII mode and can read incoming serial data.

You need to understand both the ASCII Port instructions (like the Clear Buffers, Read Line, and Read Characters) and the ASCII String instructions.

Both are well-described in the Instruction Set Reference and in the Online Help.

If you have specific questions, please include details in your posts.
 
dear kenroach sir

thank you for your reply

i am communicating my ML-1400 PLC with some device (currently I am using a microcontroller based on ATmega 328 popularly known a ARDUINO) that is capable to send ASCII characters and integers as if its connected to HYPERTERMINAL on a PC.

so now I am able to
1> Send ASCII characters to my PLC.

Now I want my PLC to do the following.
1> Decode those ASCII values and take proper action like energize one of the PLC's digital outputs.

2> Aslo want my PLC to decode those ASCII values and return the STATUS OF INPUT/OUPUT coils on the same serial port.

Please provide me a step by step procedure for the sake of my understanding.

I am a newbie:unsure:.

Thank you very much.
And waiting for your reply!!!:rolleyes:
 
I would use Modbus RTU - Proven Communication protocol with fault tolerance

Set the Aduino as a Modbus RTU master
Set the PLC as Modbus RTU slave (CH0 or CH2) (Ken - Does series A do modbus?)

Google search "Arduino modbus master" for the arduino assistance

eg Modbus RTU source code https://github.com/2-718/ModbusMaster

Come back here for ML1400 Modbus RTU slave setup information
 
That was going to be my next suggestion: Modbus is open, simple, proven, reliable, and requires very little work to program on the PLC side.

MicroLogix 1400 Series A and Series B controllers both support Modbus RTU master or slave on the serial ports.
 
dear kenroach sir and michael G sir

thank you for your reply

i have downloaded the code now i will make PLC as modbus rtu slave and ARDUINO as a modbus rtu master
and will try working on that

will you please tell me if i want to use PLC as a modbus rtu slave(channel-2) and ARDUINO as modbus master then do i need to do any kind of programming in PLC for using it as a modbus slave or just channel confugaration is sufficient???



thank you so much for your help
and waiting for your reply
 
dear kenroach sir and michael G sir

thank you for your reply

i have downloaded the code now i will make PLC as modbus rtu slave and ARDUINO as a modbus rtu master
and will try working on that

will you please tell me if i want to use PLC as a modbus rtu slave(channel-2) and ARDUINO as modbus master then do i need to do any kind of programming in PLC for using it as a modbus slave or just channel confugaration is sufficient???


please also tell me how i can do it using ASCII driver as well



thank you so much for your help
and waiting for your reply
 
dearkenroach sir and michael G sir

have i asked something wrong????
THANKS FOR YOUR SUGGESTIONS

i have two option now but i will first want to do it using ASCII SO PLEASE GUIDE ME or give me a hint how i can do it using ASCII as i have asked you earlier??

WAITING FOR YOUR REPLY
 
i have two option now but i will first want to do it using ASCII SO PLEASE GUIDE ME or give me a hint how i can do it using ASCII as i have asked you earlier??
Yes, and as said earlier, use the ARL instruction to read a line of ASCII and save it to a ST-type string-character memory location. Then use the other ASCII commands to decode the string characters, then write rung logic to act on those characters. For your case, "ACI" would be a proper instruction to use after the ARL, to convert the string to an integer value. Then you could use the normal Comparison instructions (EQU, NEQ, LES, GRT, and so on) to turn an output on or off. Another method would be to use ASR to compare the new input string (for example "1") to a string "1" and then turn on an output if the same. If you use this method, you also have to include any additional characters in the string, such as the "Return" and "Line Feed" that are often added at the end of ASCII lines.

ASCII Port Control instructions use or alter the comms channel for receiving or transmitting data. These instructions are queued in the order that they are executed and are dependent on one another to execute (except ACL).
ABL Determines the number of characters in the buffer, up to and including the end-of-line characters (termination).
ACB Determines the total characters in the buffer.
ACL Clears the ASCII buffer.
AHL Sets or resets the RS-232 Data Terminal Ready and Request to Sender handshake control lines for the modem.
ARD Reads characters from the buffer and stores them in a string.
ARL Reads one line of characters from the buffer up to and including the end-of-line characters and stores them in a string.
AWA Writes a string with user-configured characters appended.
AWT Writes a string.

ASCII String Control instructions manipulate string data. These instructions execute immediately.
ACI Converts a string to an integer value.
ACN Links two strings into one.
AEX Extracts a portion of a string to create a new string.
AIC Converts an integer value to a string.
ASC Searches a string.
ASR Compares two strings.
Rockwell Software
 
Last edited:

Similar Topics

hello friends i am communicating my ML-1400 PLC(SERIES A) with some device (currently I am using a microcontroller based on ATmega 328 popularly...
Replies
11
Views
4,003
Hello, I got a MICROLOGIX-1400 Series A PLC and for some purpose I want to control it remotely through some means over internet. So my setup is...
Replies
0
Views
1,695
Looking for recommendations for USB-C to serial adapters. Mainly used to connect to SLC and PLC5 processors.
Replies
10
Views
163
Does anyone know of an AOI using the user ASCII protocol select on the L6x controllers that will talk Modbus RTU using RS-485? Thanks, Trevor...
Replies
1
Views
147
I have 9 field devices, three METSEPM5110 power meters and six ACE949-2 rs285 interface modules. I want to read this Modbus rtu data through rs485...
Replies
8
Views
319
Back
Top Bottom