Need Help on connecting OMRON PLC CP1E with Node-Red


Im a lecturer that have an old OMRON PLC (CP1E).I would like to connect it with Node-Red for my improvement project on my college.But unfortunately,my plc dont have an ethernet port.So my question is,can i connect it to node-red using serial communication such as RS-232C?if yes,can someone kind enough to teach me how to do it?Thanks in advance

Well, teaching is maybe not what I can do, but I can tell you that it might be possible to connect and communicate with it

Depending on the platform you are selecting (Windows, Linux, PC, RPi) decides what you need to do. Assuming you do not have a serial port in your hw, first you need to get yourself a RS-232 to USB converter. You might also need some 9/25 port adapters, female to female, male to male adapters, null modem cable or converter, etc all depending on the physical sizes of the ports

Next you need to find out what settings you have to configure for the communication to work, baudrate, parity, stop bits etc

Then a protocol description. How to start communication, how to interpret the data, how to send commands

Once you have this, time to connect to Node-RED, build a first flow and start using just serial, inject and debug nodes. Then we take it from there

The Operating system that i use is Window 7 64-bit.I already use an RS-232 to USb converter and link it with my pc.I managed to link it with serial node in Node Red.The result show that it has been connected but in debug dialog there is an error regarding on the data received.It cant show the data correctly.The communication setting that i use is Baudrate 9600,parity None and stop bit is 1.Can you explain to me if what im doing is wrong and how can i fixed it?.Thanks for helping me out with my problem

OK, so how does the data look like that you get?
Can you change the debug node setting to show the complete msg?

If the device does modbus then you may be able to use one of the modbus nodes.

Sure, just need to see what is spitted out for the moment
Next, just to check, would be to set the serial node to deliver binary buffer

Here is the error message.I also cant link with my plc in cx-programmer when i open node-red when i successfully link with it.What is the cause

Only one application can access a serial connection, you will need to quit the first app before opening Node-RED

i how am i to make node-red to read program in my plc?..can you suggest me a solution?

Close the other app, then node red should be able to access the device.

already done it.My problem now is how can node-red read the data from the PLC?because right now i only establish connection with the plc but node-red still cant receive the data

Are you still getting an error? If not then what is happening and what should be happening?

so the chances are that the settings in the serial node don’t match the settings of the device.

You can either use the other programme and write them down or use google to see the devices requirements

What are you trying to do?

If you want to read/write data from/to the plc, you should know the protocol and the communications commands. Generally the plc communication is based on a master/slave method, that means you have to send a command from node-red to the plc and read the answer.

Have a look a the omron documentation:

Can you show me an example?Im trying to read the data in my plc and display it in node-red.Im not very familiar with the master/slave method.

As I previously suggested, possibly one of the modbus nodes will do what you want.

Not so easy to do, read the documentation and you'll realise what it meas.
Search for omron protocol maybe you'll find a node.js example.

1 Like

No, modbus (Modicon protocol) doesn't work. Almost every plc manufacture has an own protocol.


Buildin RS485 on that plc support • Modbus-RTU Easy Master and/or No protocol mode (RS485)
U can connect on both
Try to use node-red-contrib-modbus and your node-red need to be configured as slave coz plc can act only as master
Search after "node-red modbus plc"

Today,i manage to fetch data from the plc using Node Red.But i dont know what data is been received from PLC.Here i attach the picture of program in PLC and node-red debug message