# Node-red-omronplc

**URL:** <https://discourse.nodered.org/t/node-red-omronplc/49347>\
**Category:** Industrial\
**Created:** [4 August 2021 20:32 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347 "2021-08-04T20:32:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 20:32 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/1 "2021-08-04T20:32:40Z")

</div>

I am using node-red-omronplc to communicate RS485 to an Omron PLC. I'm able to read and write information from the controller using static information in the nodes, but I cannot find a way to set the information from outside the node.  
Are there examples to go with this code?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/385ba18dd3906590fd606e1733be82c9ff791075.png)

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [4 August 2021 20:37 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/2 "2021-08-04T20:37:28Z")

</div>

> [@Garry](#):
>
> but I cannot find a way to set the information from outside the node.

Try replacing your highlighted info with **{{msg.payload}}** and then feed the information from another node, `function`, `inject`, etc. as **msg.payload = "1234000056780000"** or something similar.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffa3ef213a8e2bdbe7438dc133a6dd87c6548bd1.png)

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 21:01 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/3 "2021-08-04T21:01:33Z")

</div>

Thanks for the recommendation.  
It did not work.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca0e5a74fcbf3f2716117733ae52ed404df129f0.png)  
Anything put in for the data is placed directly on the output. It does not get interpreted. This then causes an error.  
Garry

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [4 August 2021 21:03 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/4 "2021-08-04T21:03:35Z")

</div>

Then it sounds like you need to take this up with the author of that node

---

<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:** [4 August 2021 21:05 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/5 "2021-08-04T21:05:13Z")

</div>

What PLC is it? Is there no option of an Ethernet connection?

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 21:06 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/6 "2021-08-04T21:06:09Z")

</div>

Thanks Gunner.  
I know this is the link for the software.  
[https://flows.nodered.org/node/node-red-omronplc](https://flows.nodered.org/node/node-red-omronplc)  
How do I send the author a message?  
Garry

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 21:08 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/7 "2021-08-04T21:08:47Z")

</div>

Hi Steve-Mcl,  
This is an Omron CP1H it has an RS485 port that I can send and receive information, but I am unable to change any hardcoded addresses and values in the node.  
It does not have an Ethernet port or I would be using the FINS communication nodes that work well with the Omron.  
Thanks,  
Garry

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [4 August 2021 21:13 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/8 "2021-08-04T21:13:42Z")

</div>

> [@Garry](#):
>
> How do I send the author a message?

Hmm, no git-hub link, just one to npm... sorry, I have no idea. Looks like a random contrib with no support option.

Try searching for alternate nodes?

- [Library - Node-RED](https://flows.nodered.org/search?term=omron+&type=node&type=flow&type=collection)

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 21:15 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/9 "2021-08-04T21:15:03Z")

</div>

Thanks Gunner,  
I appreciate the information.  
Garry

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 August 2021 21:43 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/10 "2021-08-04T21:43:19Z")

</div>

Try. npm ls owner (package name)

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [4 August 2021 23:30 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/11 "2021-08-04T23:30:11Z")

</div>

C:\Users\gclsh\>npm ls owner node-red-omronplc  
C:\Users\gclsh  
`-- (empty)

Thanks for the suggestion.It looks like this was not filled out by the programmer.  
Garry

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [5 August 2021 00:49 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/12 "2021-08-05T00:49:16Z")

</div>

Do any of the alternative nodes work for you?

---

<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 August 2021 06:17 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/13 "2021-08-05T06:17:13Z")

</div>

Try leaving the field blank and set the incoming msg...

Function...

```auto
msg.numberOfWord = 2;
return msg

```

Or use a change node

Ps, can you screenshot the built in help from the sidebar.

---

<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 August 2021 07:02 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/14 "2021-08-05T07:02:28Z")

</div>

Nevermind, I had a look at the src, its 100% hard coded.

Also, tried searching the noremal places for the creator `wijdanAriff` and the project (on github, gitlab, google etc) - nowhere to be found.

Luckily, it is licensed as ICS so if I get a chance later today or later this week, I will look at the feasibility of publishing a dynamic version of it.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 August 2021 08:31 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/15 "2021-08-05T08:31:55Z")

</div>

sorry I had the command above backwards

```auto
npm owner ls node-red-omronplc
wijdanariff <wijdanariff93@gmail.com>

```

So you could try email.

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [5 August 2021 10:26 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/16 "2021-08-05T10:26:22Z")

</div>

Hi Steve-Mcl,  
Thanks for looking into this. That would be great to have a dynamic version. Other than the hard coding on the omron-command node, the program works well.  
Here are the 4 variables that need to be dynamic.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03f65049450d118f29add43c8abd0c29562a2297.png)  
Host Number - Two ASCII digits - 00 to 31 - This represents the controller to communicate.  
Header Code - Two ASCII digits - This represents the function that is required to either read or write to the controller.  
Beginning Word - four ASCII digits - This is the starting memory location to read or write.  
Number of Word - This can be the number of words when reading (4 ASCII digits) or up to 240 ASCII words for the information to write.  
[https://www.edata.omron.com.au/eData/Networks/Host\_Link/W182-E1-1A.pdf](https://www.edata.omron.com.au/eData/Networks/Host_Link/W182-E1-1A.pdf)  
Here is the manual for reference if you have any questions.

I appreciate the help.  
Thanks again,  
Garry

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [5 August 2021 10:27 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/17 "2021-08-05T10:27:19Z")

</div>

Thank you dceejay.  
I will send the owner an email.  
Garry

---

<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 August 2021 10:27 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/18 "2021-08-05T10:27:46Z")

</div>

No bother, I am fairly up to speed on all things OMRON (I wrote the omron-fins nodes)

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [5 August 2021 10:34 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/19 "2021-08-05T10:34:26Z")

</div>

Great job on the Omron FINS node!  
The Omron Host Link or C-command modes will work with the current CP1 series. It will also work with the older 'K' series, C200H, C2000 , C20, etc. These two protocols cover the Omron line.  
Garry

---

<div class="post-metadata">

**Author:** ![Garry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garry/32/43427_2.png) [@Garry](https://discourse.nodered.org/u/Garry)\
**Post date:** [5 August 2021 11:11 UTC](https://discourse.nodered.org/t/node-red-omronplc/49347/20 "2021-08-05T11:11:04Z")

</div>

Here is what I would like to do with this modified node.  
I have a blog that teaches how to program PLCs.  
[https://accautomation.ca/](https://accautomation.ca/)  
Here is the series on the CP1H.  
[https://accautomation.ca/series/omron-plc-cp1h-series/](https://accautomation.ca/series/omron-plc-cp1h-series/)  
Recently I started to post about Node-RED and how to use this to communicate to PLCs (Modbus TCP / RTU), create a dashboard, and store information in a SQL database. (SQLite)

> **[Node-RED IoT Enabling Software | Acc Automation](https://accautomation.ca/series/node-red-iot-enabling-software/)**
>
> Node-RED is an enabling software for IoT. (Internet of Things) This means that we can communicate to control and read information from industrial equipment. Logging of information to databases and analyzing this information is easily achieved....

I thought that I would show how to communicate to the CP1H controller using Node-RED after a question was asked.  
Thanks,  
Garry

[Next page](https://discourse.nodered.org/t/node-red-omronplc/49347.md?page=2)
