# How to read memories in clp omron with FINS

**URL:** <https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802>\
**Category:** Industrial\
**Created:** [30 October 2024 15:52 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802 "2024-10-30T15:52:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReinaldoTP](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ReinaldoTP](https://discourse.nodered.org/u/ReinaldoTP)\
**Post date:** [30 October 2024 15:52 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/1 "2024-10-30T15:52:29Z")

</div>

Hello, I'm trying to read a memory of the real type, however, the data is wrong, I would like to know if there is a block conversion, a method to solve this

 ![nodered](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/7657cba813530d330d4b264a295f2193fa298a9e.png)

This would be the memory to be read, however the value I receive is only those in the photo above

 ![nodered](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0deda93ff142b47e64b7eb88471245d41f779c78.png)

Does anyone have a solution or have come across this?

---

<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:** [30 October 2024 16:39 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/2 "2024-10-30T16:39:38Z")

</div>

Yes, as mentioned in the [readme](https://flows.nodered.org/node/node-red-contrib-omron-fins) you can use the buffer-parser node

> ## Data formats and conversion
> 
> As I use multiple PLCs and didn't want to write boolean / 32bit / float / double functionality into each node (it's best to keep things atomic and good at what they do) so I wrote a separate second node for handling data conversions.
> 
> This node "node-red-contrib-buffer-parser" [node-red-contrib-buffer-parser (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-buffer-parser) is capable of pretty much anything you will need for this or any PLC that returns 16bit data or a NodeJS Buffer.
> 
> In essence, you pull a bunch of data from the plc in one go & convert it all in the buffer-parser node to almost any format you could wish for (bits, floats, 32bit signed / unsigned, byteswapping etc etc). It can do 1 or many conversions all at once. It can send a [grouped item](https://github.com/Steve-Mcl/node-red-contrib-buffer-parser#example-2---array-of-data-to-an-named-objects) (object) or individual items [with a `topic`](https://github.com/Steve-Mcl/node-red-contrib-buffer-parser#example-1---array-of-data-to-mqtt-multiple-topics--payloads) ready for pushing your data directly from the PLC to MQTT.

e.g:

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

Example flow:

```auto
[{"id":"0d817ccfa2b57fc2","type":"buffer-parser","z":"07f7c6534787ceb5","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"destinazione","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"somethingElse","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":900,"y":1140,"wires":[["8112ee1a71a20951"]]},{"id":"5b88b45d5153b159","type":"inject","z":"07f7c6534787ceb5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":900,"y":1040,"wires":[["ad167d9e5083bc49"]]},{"id":"8112ee1a71a20951","type":"debug","z":"07f7c6534787ceb5","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1090,"y":1140,"wires":[]},{"id":"ad167d9e5083bc49","type":"template","z":"07f7c6534787ceb5","name":"Fake PLC Read","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[\n5243,\n17046,\n0,\n0,\n0,\n0,\n0,\n0,\n0,\n0,\n0,\n0\n]","output":"json","x":1080,"y":1040,"wires":[["0d817ccfa2b57fc2"]]}]

```

Just be sure to set the output of the FINS READ node to output a `buffer` or `UINT array`

---

<div class="post-metadata">

**Author:** ![ReinaldoTP](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ReinaldoTP](https://discourse.nodered.org/u/ReinaldoTP)\
**Post date:** [1 November 2024 18:56 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/3 "2024-11-01T18:56:21Z")

</div>

Unfortunately, I'm not able to use buffparse for conversion, I always make an error, I'm using the Omron CLP, has anyone already done any application on this CLP with node-red

---

<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:** [1 November 2024 20:02 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/4 "2024-11-01T20:02:07Z")

</div>

> [@ReinaldoTP](#):
>
> has anyone already done any application on this CLP with node-red

Yes. Me. And I wrote both the buffer parser & Omron nodes.

I even gave you a fully working example using your data values, a screenshot to prove it and a demo flow for you to import!

I'm not entirely sure what else I can do.

Did you set the mode to output a buffer or unsigned array as stated:

> [@Steve-Mcl](#):
>
> Just be sure to set the output of the FINS READ node to output a `buffer` or `UINT array`

Instead of asking for some other person to help, why don't you use the working flow I gave you, replace the "fake PLC" function node with an actual Omron fins read node, add debug node to the output of your find read node and a debug node attached to the buffer parser and show us what you're getting!

---

<div class="post-metadata">

**Author:** ![ReinaldoTP](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ReinaldoTP](https://discourse.nodered.org/u/ReinaldoTP)\
**Post date:** [12 November 2024 22:43 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/5 "2024-11-12T22:43:00Z")

</div>

I was in a rush and ended up not posting the stream. I'm still in my early days with node-red.  
I'm looking for other alternatives but without success, follow the flow I'm using, thank you.

[  
{  
"id": "6ac00b0df044367e",  
"type": "inject",  
"z": "e3e2bab63104a927",  
"name": "",  
"props": [  
{  
"p": "payload"  
},  
{  
"p": "topic",  
"vt": "str"  
}  
],  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"topic": "",  
"payload": "",  
"payloadType": "date",  
"x": 340,  
"y": 680,  
"wires": [  
[  
"df16c70440883ae1"  
]  
]  
},  
{  
"id": "df16c70440883ae1",  
"type": "FINS Read",  
"z": "e3e2bab63104a927",  
"name": "560",  
"connection": "946c4e79a6eb224e",  
"addressType": "str",  
"address": "D2440",  
"countType": "num",  
"count": "2",  
"msgPropertyType": "msg",  
"msgProperty": "payload",  
"outputFormatType": "signedkv",  
"outputFormat": "",  
"x": 470,  
"y": 720,  
"wires": [  
[  
"5d04f1820839acb4"  
]  
]  
},  
{  
"id": "8112ee1a71a20951",  
"type": "debug",  
"z": "e3e2bab63104a927",  
"name": "debug 4",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "false",  
"statusVal": "",  
"statusType": "auto",  
"x": 920,  
"y": 680,  
"wires":   
},  
{  
"id": "5d04f1820839acb4",  
"type": "function",  
"z": "e3e2bab63104a927",  
"name": "function 31",  
"func": "msg.payload.D2440;\nmsg.payload.D2441;\n\n\nreturn msg;",  
"outputs": 1,  
"noerr": 0,  
"initialize": "",  
"finalize": "",  
"libs": ,  
"x": 630,  
"y": 680,  
"wires": [  
[  
"72e1e130f8a916a9"  
]  
]  
},  
{  
"id": "72e1e130f8a916a9",  
"type": "buffer-parser",  
"z": "e3e2bab63104a927",  
"name": "",  
"data": "payload",  
"dataType": "msg",  
"specification": "spec",  
"specificationType": "ui",  
"items": [  
{  
"type": "floatle",  
"name": "D2440",  
"offset": 0,  
"length": 1,  
"offsetbit": 0,  
"scale": "0",  
"mask": ""  
},  
{  
"type": "floatle",  
"name": "item2",  
"offset": 4,  
"length": 1,  
"offsetbit": 0,  
"scale": "0",  
"mask": ""  
}  
],  
"swap1": "",  
"swap2": "",  
"swap3": "",  
"swap1Type": "swap",  
"swap2Type": "swap",  
"swap3Type": "swap",  
"msgProperty": "payload",  
"msgPropertyType": "str",  
"resultType": "keyvalue",  
"resultTypeType": "return",  
"multipleResult": false,  
"fanOutMultipleResult": false,  
"setTopic": true,  
"outputs": 1,  
"x": 730,  
"y": 740,  
"wires": [  
[  
"8112ee1a71a20951"  
]  
]  
},  
{  
"id": "946c4e79a6eb224e",  
"type": "FINS Connection",  
"name": "",  
"host": "10.116.20.140",  
"port": "9600",  
"MODE": "",  
"MODEType": "CJ",  
"protocol": "",  
"protocolType": "tcp",  
"ICF": "0x80",  
"DNA": "",  
"DA1": "88",  
"DA2": "",  
"SNA": "",  
"SA1": "179",  
"SA2": "",  
"autoConnect": true  
}  
]

---

<div class="post-metadata">

**Author:** ![ReinaldoTP](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ReinaldoTP](https://discourse.nodered.org/u/ReinaldoTP)\
**Post date:** [13 November 2024 00:00 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/6 "2024-11-13T00:00:49Z")

</div>

The D2440 memory is a REAL type memory, as it allocates more than one memory it is occupying the D2440 and D2441 where the final value shown on the HMI would be 75.04, I tried some forms of conversion but it didn't work out very well either.

Uploading: Cattura.PNG…

---

<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:** [13 November 2024 00:31 UTC](https://discourse.nodered.org/t/how-to-read-memories-in-clp-omron-with-fins/92802/7 "2024-11-13T00:31:45Z")

</div>

I gave you a working flow. All you had to do was import it and replace the "fake PLC" node with a fins read node that reads 2 WORDS and outputs a buffer...

> [@Steve-Mcl](#):
>
> set the output of the FINS READ node to output a `buffer` or `UINT array`

You have got it set to return a key value object in your flow!

In other words, if the demo works, all you have to do is make sure the data going in to the buffer parser is the same shape and size - use debug nodes to double check what the demo flow feeds into the buffer parser & make sure you set the fins read node to output the same shape data!
