OMRON-PLC read and write

Hi guys, I need to read and write data from an Omron-plc (CP1L) to a raspberry pi 4 with :
1- rs 232 to USB cable or
2- USB-b To USB or
3- rs232 to ethernet cable using node-red. Can you please help me?

Do you have an Ethernet module fitted to the PLC?

If not, then you could (probably) use the CP1W-CIF41 Omron adaptor to give the PLC ethernet THEN you can use this node: node-red-contrib-omron-fins (node) - Node-RED

2 Likes

Hi, thank you for your reply. I ordered an Ethernet to RS232 module. But I don't know how to set up the fins nodes. Can you please explain to me?

Which module?

FINS is an Ethernet protocol - meaning it needs to connect to the PLC Ethernet stack (without serial in the mix)

1 Like

So with which node I can read data from my PLC with this R3232 to ethernet module?

I have been working on a C-MODE (host protocol) addition that might do the job (but it is not released - only in a development branch) other than that, you can build CMODE (host protocol) commands in node-red and send them (via serial or to a serial server) and process the response. The OMRON manuals have extensive details on hostlink protocol.

1 Like

Thank you . With this device that I have I can add a VCOM port and I can set a host IP address . Still doesn't work with fins nodes ?

Do you already have the Ethernet-serial device?

1 Like

yes ,







Ok, so could you open a putty or hyperterminal, connect the the VCOM and transmit @00RD0000001057* followed by a CR (carriage return AKA ASCII 13 - you can do this with alt - 1 - 3 on number keypad if enter key doesnt work)

Do you get a response?

If not,

  • are you using an official OMRON Serial Cable?
  • have you set the Serial Server settings to match PLC settings? ( I see you have set speed 57600 8-n-1 - does this match the COM port settings of the PLC)
  • do you see the COM LED flicker on the PLC?

If none of that works, please state exactly what your setup is (including cable numbers, pin outs, PLC settings etc)

1 Like

Hi, so I have tested and released (beta) of the package that supports C-Mode commands (hostlink serial protocol)

You would need to install the package via command line to test it node-red-contrib-omron-fins@1.0.0-beta-1 (you do this in your node-red user directory - usually c:\users\user-name\.node-red or ~/.node-red)

Demo...

[{"id":"1e3d488899442e63","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Read D300[5]","plcSeries":"CSJP","hostNumber":0,"headerCode":"RD","p1":"300","p2":"5","p3":"","x":520,"y":900,"wires":[["6f28a1bf4f0f1279"]]},{"id":"eab4f15d02965743","type":"C-Mode Response","z":"7ecba32db86f0617","name":"","x":950,"y":900,"wires":[["593fd0917c0eed02"]]},{"id":"1d9c4152b061277a","type":"inject","z":"7ecba32db86f0617","name":"trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":900,"wires":[["1e3d488899442e63"]]},{"id":"b724ed24d7ab4420","type":"serial request","z":"7ecba32db86f0617","name":"","serial":"5abddf654cd7c41c","x":790,"y":900,"wires":[["eab4f15d02965743"]]},{"id":"593fd0917c0eed02","type":"debug","z":"7ecba32db86f0617","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"","statusType":"counter","x":1130,"y":900,"wires":[]},{"id":"d55e47925d055523","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Write DM area","plcSeries":"CSJP","hostNumber":0,"headerCode":"WD","p1":"","p2":"","p3":"","x":520,"y":960,"wires":[["6f28a1bf4f0f1279"]]},{"id":"854639688e75a6c6","type":"catch","z":"7ecba32db86f0617","name":"","scope":["eab4f15d02965743"],"uncaught":false,"x":990,"y":960,"wires":[["0ed83a6223dfcadb"]]},{"id":"2a077efedc791411","type":"inject","z":"7ecba32db86f0617","name":"D300 [0,0,0]","props":[{"p":"p1","v":"300","vt":"str"},{"p":"p2","v":"[0,0,0]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":960,"wires":[["d55e47925d055523"]]},{"id":"6f28a1bf4f0f1279","type":"delay","z":"7ecba32db86f0617","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"10","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":705,"y":900,"wires":[["b724ed24d7ab4420"]],"l":false},{"id":"fedec3b8b770d49b","type":"inject","z":"7ecba32db86f0617","name":"D300 [-1,-2,-3] (bad data)","props":[{"p":"p1","v":"300","vt":"str"},{"p":"p2","v":"[-1,-2,-3]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":210,"y":1000,"wires":[["d55e47925d055523"]]},{"id":"df99ad47a8bd3b23","type":"inject","z":"7ecba32db86f0617","name":"D300 [65535,9999,10000]","props":[{"p":"p1","v":"300","vt":"str"},{"p":"p2","v":"[65535,9999,10000]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":210,"y":1040,"wires":[["d55e47925d055523"]]},{"id":"eb49cf62e07c6ea8","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Read dynamic","plcSeries":"CSJP","hostNumber":0,"headerCode":"","p1":"","p2":"","p3":"","x":500,"y":1180,"wires":[["6f28a1bf4f0f1279"]]},{"id":"d7363e6cb06c1aed","type":"inject","z":"7ecba32db86f0617","name":"RR 100 5","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"RR","vt":"str"},{"p":"p1","v":"100","vt":"num"},{"p":"p2","v":"5","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Read CIO","x":160,"y":1160,"wires":[["eb49cf62e07c6ea8"]]},{"id":"3c352e98e3202941","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Write dynamic","plcSeries":"CSJP","hostNumber":0,"headerCode":"","p1":"","p2":"","p3":"","x":500,"y":1300,"wires":[["6f28a1bf4f0f1279"]]},{"id":"d609f2b4d7a9c285","type":"inject","z":"7ecba32db86f0617","name":"WR 100 [0,1,2]","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"WR","vt":"str"},{"p":"p1","v":"100","vt":"num"},{"p":"p2","v":"[0,1,2]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Write CIO100","x":180,"y":1260,"wires":[["3c352e98e3202941"]]},{"id":"65365e1f385bae05","type":"inject","z":"7ecba32db86f0617","name":"WR 100 [65535,9999,10000]","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"WR","vt":"str"},{"p":"p1","v":"100","vt":"num"},{"p":"p2","v":"[65535,9999,10000]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Write CIO100","x":220,"y":1300,"wires":[["3c352e98e3202941"]]},{"id":"f613c7f34f9c8230","type":"inject","z":"7ecba32db86f0617","name":"RH 50 10","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"RH","vt":"str"},{"p":"p1","v":"50","vt":"num"},{"p":"p2","v":"10","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Read HR","x":160,"y":1200,"wires":[["eb49cf62e07c6ea8"]]},{"id":"f9fce412bb2aa69f","type":"inject","z":"7ecba32db86f0617","name":"WH 52 [0,1,2]","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"WH","vt":"str"},{"p":"p1","v":"52","vt":"num"},{"p":"p2","v":"[0,1,2]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Write HR52","x":170,"y":1360,"wires":[["3c352e98e3202941"]]},{"id":"74112485758bd950","type":"inject","z":"7ecba32db86f0617","name":"WH 50 [65535,8,7,6,5,4,3,2,1,0]","props":[{"p":"topic","vt":"str"},{"p":"headerCode","v":"WH","vt":"str"},{"p":"p1","v":"50","vt":"num"},{"p":"p2","v":"[65535,8,7,6,5,4,3,2,1,0]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Write HR50","x":230,"y":1400,"wires":[["3c352e98e3202941"]]},{"id":"c072f49b7fbb104f","type":"comment","z":"7ecba32db86f0617","name":"** SETUP COM PORT **","info":"","x":810,"y":860,"wires":[]},{"id":"8d310d8f7ec001aa","type":"comment","z":"7ecba32db86f0617","name":"Read and Write to the area determined dynamically by input parameters","info":"","x":330,"y":1120,"wires":[]},{"id":"4ddc6196f128a907","type":"comment","z":"7ecba32db86f0617","name":"Read and Write DM area (address and count determined by input parameters)","info":"","x":350,"y":860,"wires":[]},{"id":"4e5d4243059aaae0","type":"inject","z":"7ecba32db86f0617","name":"trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":700,"wires":[["8ccea540558de6e3"]]},{"id":"8ccea540558de6e3","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Read D310[2]","plcSeries":"CSJP","hostNumber":0,"headerCode":"RD","p1":"310","p2":"2","p3":"","x":520,"y":700,"wires":[["6f28a1bf4f0f1279"]]},{"id":"28f61fe4f41c56d3","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Write D310 1, D311 2","plcSeries":"CSJP","hostNumber":0,"headerCode":"WD","p1":"310","p2":"[ 1 , 2 ]","p3":"","x":500,"y":740,"wires":[["6f28a1bf4f0f1279"]]},{"id":"f29dee8fb458d67c","type":"inject","z":"7ecba32db86f0617","name":"trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":740,"wires":[["28f61fe4f41c56d3"]]},{"id":"3e3aaaf497c9267b","type":"C-Mode Command","z":"7ecba32db86f0617","name":"Write D310 65535, D311 0","plcSeries":"CSJP","hostNumber":0,"headerCode":"WD","p1":"310","p2":"[65535, 0]","p3":"","x":480,"y":780,"wires":[["6f28a1bf4f0f1279"]]},{"id":"60a6e5ec4388b19e","type":"inject","z":"7ecba32db86f0617","name":"trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":780,"wires":[["3e3aaaf497c9267b"]]},{"id":"4985fe9cfe3a3e9a","type":"comment","z":"7ecba32db86f0617","name":"Read and Write fixed DM areas (D310 & D311)","info":"","x":260,"y":660,"wires":[]},{"id":"0ed83a6223dfcadb","type":"debug","z":"7ecba32db86f0617","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"","statusType":"counter","x":1130,"y":960,"wires":[]},{"id":"5abddf654cd7c41c","type":"serial-port","serialport":"COM5","serialbaud":"9600","databits":"7","parity":"even","stopbits":"2","waitfor":"@","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"*","bin":"bin","out":"char","addchar":"","responsetimeout":"1000"}]
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.