How to read memories in clp omron with FINS

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

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

Does anyone have a solution or have come across this?

Yes, as mentioned in the readme 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 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 (object) or individual items with a topic ready for pushing your data directly from the PLC to MQTT.

e.g:

Example flow:

[{"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

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

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:

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!

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
}
]

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…

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

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!