How to Communication AB PLC 1200 or 1400 with node red using USB

How to Communication Allen Bradley PLC 1200 or 1400 with node red using USB

I use:

  1. USB to RS232 converter - protocol df1 - Micrologix 1200:
  2. USB to RS485 converter - protocol Modbus - RS485 to RS232 converter - ML 1200

But FrankAB when i connect it to PC it detects in PC and respond to RS Logix 500, But i want to communicate it with node red which is not happening is there any solution example or code for the communication or program simple example which i can test.

I see what you're asking. What you're going to want to use is a USB to RS485 converter. Your PLC supports MODBUS and MODBUS is very easy to work with when setting up communications. That should take care of the hardware portion.

The software portion for Node-Red is handled by the nod-red-contrib-modbus node set. Use the pallette manager to find it and load it. Once you have that, you'll have the nodes you need for MODBUS communication to the PLC. You can come back to the forum with questions, which you're likely to have a lot of initially.

You'll find the details you need to know about using MODBUS on your PLC starting on page 447 of this manual. Simply install the USB drivers, connect the PLC, install the nodes and set them up with the information for the converter. In no time at all, you'll be pulling registers and controlling your PLC.

1 Like

madhouse - Micrologix 1200 supports the Modbus protocol, but has an RS232 socket and an RS485 to RS232 interface is also needed.
Jayeshpitale1 - I am using the df1 program written by Stephane Leicht.
A Raspberry Pi with this program connects to the Micrologix 1200 via a USB to RS232 adapter using tcp request in Node-RED.
There is also a plugin for Node-RED for 7 months:
node-red-contrib-df1

Fair. If the receiving port on the PLC is RS232, then the RS485 can be bypassed. I didn't dig into that part of the manual. The important part is that the physical connector of the USB converter matches the connector of the PLC. Many, if not most, USB converters are able to utilize 232 or 485 communications, since the biggest difference is how the signal is electrically transmitted. In lots of cases, it's just a software option to toggle them back and forth.

MODBUS vs. DF1 is just the packet design being sent over the channel. The best option for that is whatever gets the job done best that can be either understood the easiest or has the simplest implementation. I've never played around with DF1, so I don't know how simple or easy it is compared to the MODBUS nodes in Node-Red. My suggestion would be to check out both and see. Fortunately there are people here who work in one or the other that can help.

The easiest way of communication is the one we already know.
In my work I dealt with PLC 5/30 and when I got to know Linux in 2003 I wanted to communicate with the controller via RS232.
I found 2 programs on the internet: plcx and df1.
In 2015, in my own home, I used a Micrologix 1200 to switch on the lighting.
I have used Stephane Leight's df1 for communication and PHP for visualization.
When 2 years ago I wanted to connect several devices with each other, I had to use Modbus because it allows it.
With the help of a friend I met on the Internet, I learned a bit of Node-RED and in it I can use df1 on 1 USB port, and Modbus on another.
Now I saw that there is node-red-contrib-df1, but where I am now I cannot access my PLC directly and I cannot check it.
English is not my mother tongue - I use Google translate.

Yes @FrankAB, but my problem still there i have PLC 1200 with AIC Advance Interface Controller connected to PC and using that i get data in RsLogix which works fine. But now my issue is with Node-red how to connect it and run the code so i can communicate with PLC which is not happening in Modbus whereas i connected to Modbus setting and tried to see whether it is going right but unfortunately it is not working Also Note the Df1 is only available for ST-one hardware.

There is not a word about the Modbus protocol in the 1761-NET-AIC manual - it is only about df1.
I have no access to the equipment now and I have no way to check it.
I don't use Node-RED on Windows.
Stephane Leicht's df1 program only works on Linux.

Yep. He's right. Perhaps the break in communications is on the AIC and not the PLC.

Which poses the question. Do you need the AIC for your setup? From what I'm reading, the AIC is more or less for connecting multiple PLCs to each other and converting the incoming signal from a PC from essentially RS232 to whatever you want on the PLC. I would imagine there would be a way of connecting the PLC directly to the PC, but I don't have time right now to search the manuals to find out an individual installation.

No @FrankAB and @madhouse, I have connected the thing well and good. They are communicating with RS Logix as you know that but the issue is that how to make a communication between Node red because as i saw rs232 requires serial port and you told me Df1 also but I am not sure how to read data from the plc to nod red is there any code to communicate with node red and plc. Also note PLC + AIC AND PC they are communicating with RS Logix well & good.

I have not written anywhere that you put it together wrong.
RSLinx works so well connected.
I haven't used, don't use and won't use Node-RED on Windows.
I don't have how to check now if AIC will let Modbus through.
If you have ML1200 with one port then there is another problem - after switching to Modbus df1 stops working.
Of course, you must turn off RSLinx beforehand.
On Linux, I could help You.

To interface with PLC and Node red you must select communication method first.
Begin with Serial (RS232), Modbus (Rs485), TCP ModBus or TCP/IP
Mostly every PLC support above mention protocol.
USB is Physical media not communication media.

It won't. That's why I was asking if the AIC is needed. The AIC only communicates through the proprietary program or DF1. If you go to the PLC directly, you have both DF1 and MODBUS as options. I know MODBUS will work. I'm looking for a DF1 solution as an option. If there is a DF1 node set, the AIC may not need to be removed for Node-Red operations. Otherwise, it will because it won't support MODBUS.

I am on raspberry Pi only

Sounds like we have a good match.

  1. Download from this page GitHub - leicht/Df1: Df1 protocol for Allen-Bradley PLC and install .
    In the "Readme" file you have everything described.
  2. Attached you have an example of a working program.

Small.json (7.55 KB)

@FrankAB Could you please provide me the code from USB peripheral device on node red, i want to read data from AB PLC 1200 which does not have ethernet so we can only connect it via USB.

Enter instead of 192.168.1.238 the IP of your Raspberry on which the df1 server is running.
Append to the file at system startup:

ln -s /dev/ttyUSB0 /dev/ttyS0
/etc/init.d/df1d start
stty -F /dev/ttyUSB0 19200

Here's a piece of ML1200 software.

I need of Node-red for the PLC as my raspberry pi does not have df1 server running, is it compulsory to install df1 server for raspberry pi to use on Node-red.