Need Help on connecting OMRON PLC CP1E with Node-Red

#1

Hello,

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

0 Likes

#2

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

0 Likes

#3

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

0 Likes

#4

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

0 Likes

#5

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

0 Likes

#6

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

0 Likes

#7

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

0 Likes

#8

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

0 Likes

#9

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

0 Likes

#10

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

0 Likes

#11

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

0 Likes

#12

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

0 Likes

#13

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

0 Likes

#14

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:
https://assets.omron.eu/downloads/manual/en/v1/w342_cs_cj_cp_nsj_communications_commands_reference_manual_en.pdf

0 Likes

#15

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.

0 Likes

#16

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

0 Likes

#17

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

#18

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

0 Likes

#19

Hi

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
PS
Search after "node-red modbus plc"
/IQAPPS

0 Likes

#20

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

0 Likes