# OMRON-PLC read and write

**URL:** <https://discourse.nodered.org/t/omron-plc-read-and-write/61763>\
**Category:** Industrial\
**Created:** [25 April 2022 18:32 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763 "2022-04-25T18:32:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![maliheh.amirfakhry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maliheh.amirfakhry/32/55147_2.png) [@maliheh.amirfakhry](https://discourse.nodered.org/u/maliheh.amirfakhry)\
**Post date:** [25 April 2022 18:32 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/1 "2022-04-25T18:32:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 April 2022 18:44 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/2 "2022-04-25T18:44:54Z")

</div>

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](https://flows.nodered.org/node/node-red-contrib-omron-fins)

---

<div class="post-metadata">

**Author:** ![maliheh.amirfakhry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maliheh.amirfakhry/32/55147_2.png) [@maliheh.amirfakhry](https://discourse.nodered.org/u/maliheh.amirfakhry)\
**Post date:** [10 May 2022 18:46 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/4 "2022-05-10T18:46:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 18:56 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/5 "2022-05-10T18:56:41Z")

</div>

> [@maliheh.amirfakhry](#):
>
> I ordered an Ethernet to RS232 module

Which module?

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

---

<div class="post-metadata">

**Author:** ![maliheh.amirfakhry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maliheh.amirfakhry/32/55147_2.png) [@maliheh.amirfakhry](https://discourse.nodered.org/u/maliheh.amirfakhry)\
**Post date:** [10 May 2022 18:59 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/6 "2022-05-10T18:59:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 19:04 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/7 "2022-05-10T19:04:14Z")

</div>

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](https://github.com/Steve-Mcl/node-red-contrib-omron-fins/tree/c-mode)) 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.

---

<div class="post-metadata">

**Author:** ![maliheh.amirfakhry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maliheh.amirfakhry/32/55147_2.png) [@maliheh.amirfakhry](https://discourse.nodered.org/u/maliheh.amirfakhry)\
**Post date:** [10 May 2022 20:31 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/8 "2022-05-10T20:31:11Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 20:33 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/9 "2022-05-10T20:33:56Z")

</div>

Do you already have the Ethernet-serial device?

---

<div class="post-metadata">

**Author:** ![maliheh.amirfakhry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maliheh.amirfakhry/32/55147_2.png) [@maliheh.amirfakhry](https://discourse.nodered.org/u/maliheh.amirfakhry)\
**Post date:** [11 May 2022 14:50 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/10 "2022-05-11T14:50:38Z")

</div>

yes ,

 ![WhatsApp Image 2022-05-11 at 10.15.47 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/96284d60657c755990354447ead85676ba9e50fc.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.21.02 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13af1fa19ebdfbc5821c5f723c7a3b0c317a495a.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.21.42 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1e51170a9473dde8d47f455c289553081a7aec47.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.21.54 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/d/2d7986de26dbad3dd76c49d01256a75c8beae7da.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.22.31 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/0859c4dfa7a6cadd71af56054cc77d0592977c07.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.22.51 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/5314b48c7cc1c92b382cd42b95f3e08cf99ad1b7.jpeg)  
 ![WhatsApp Image 2022-05-11 at 10.23.01 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/4251a5d6b2ea07617a672a657cf547377be7c1ee.jpeg)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 May 2022 15:33 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/11 "2022-05-11T15:33:14Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 June 2022 10:56 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/12 "2022-06-05T10:56:01Z")

</div>

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...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/941d1ebaa0467b48d7d8d101163521ffb9fa18af.png)

```auto
[{"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"}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 August 2022 10:56 UTC](https://discourse.nodered.org/t/omron-plc-read-and-write/61763/13 "2022-08-04T10:56:56Z")

</div>

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