Steve-Mcl / node-red-contrib-omron-fins

A Node-RED node to directly interface with OMRON PLCs over FINS Ethernet protocol
MIT License
13 stars 4 forks source link

Correct communication format #6

Closed FrantaD closed 3 years ago

FrantaD commented 3 years ago

Hi,

I am testing communication between PLC NX102-1100 and RPI with NodeRed.

PLC NX102-1100:

IP: 192.168.250.10/24 (port 2) FINS node address: 10 FINS/UDP port number: 9600 Memory settings: DM enable Global Variable: TestFins - INT - %D0 - retain

RPI NodeRed:

IP: 192.168.250.11/24 Connection Node properties: image

Connect FINS:

This is how I set it according to the help and it doesn't work. image image image

And this is how it works, but only the connection. Disconnection does not work. image image

Q: How is it supposed to be right?

Write data by FINS write:

image image image

Q: What is the correct response format for one INT variable.

Thank you for your help Frantisek

Steve-Mcl commented 3 years ago

Hi, please tell me ... node-red version (visible on the node-red menu) nodejs version (run node -v)

This is how to read a value... image

Example...

[{"id":"c27543e7.83a9c","type":"FINS Read","z":"a2a9b7f9.ae1948","name":"","connection":"dfa87a08.a088f8","addressType":"msg","address":"topic","countType":"num","count":1,"msgPropertyType":"msg","msgProperty":"payload","outputFormatType":"list","outputFormat":"unsignedkv","x":730,"y":40,"wires":[["6845a434.51820c"]]},{"id":"80f39ad6.addbf8","type":"inject","z":"a2a9b7f9.ae1948","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"D100","payload":"","payloadType":"str","x":560,"y":40,"wires":[["c27543e7.83a9c"]]},{"id":"6845a434.51820c","type":"debug","z":"a2a9b7f9.ae1948","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":910,"y":40,"wires":[]},{"id":"dfa87a08.a088f8","type":"FINS Connection","name":"My PLC","host":"192.168.0.1","port":"9600","MODE":"CSCJ","ICF":"128","DNA":"","DA1":"","DA2":"","SNA":"","SA1":"","SA2":""}]
FrantaD commented 3 years ago

node-red version: 1.2.6 nodejs version: 12.20.0

About FINS Write:

Thank you for the example I have already discovered my mistake.

image

For others, this is my working configuration: PLC:

image image image image

NodeRed: image image [ { "id": "76a42c51.9d5c34", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "c27543e7.83a9c", "type": "FINS Read", "z": "76a42c51.9d5c34", "name": "", "connection": "1f37dade.2df355", "addressType": "msg", "address": "topic", "countType": "num", "count": 1, "msgPropertyType": "msg", "msgProperty": "payload", "outputFormatType": "list", "outputFormat": "unsignedkv", "x": 330, "y": 160, "wires": [ [ "6845a434.51820c" ] ] }, { "id": "80f39ad6.addbf8", "type": "inject", "z": "76a42c51.9d5c34", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "D0", "payload": "", "payloadType": "str", "x": 150, "y": 160, "wires": [ [ "c27543e7.83a9c" ] ] }, { "id": "6845a434.51820c", "type": "debug", "z": "76a42c51.9d5c34", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "x": 550, "y": 160, "wires": [] }, { "id": "d5beeae8.a7efe8", "type": "FINS Write", "z": "76a42c51.9d5c34", "name": "", "connection": "1f37dade.2df355", "addressType": "msg", "address": "topic", "dataType": "msg", "data": "payload", "msgPropertyType": "msg", "msgProperty": "payload", "x": 330, "y": 240, "wires": [ [ "6845a434.51820c" ] ] }, { "id": "66d78d52.2ef9d4", "type": "inject", "z": "76a42c51.9d5c34", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "D0", "payload": "77", "payloadType": "str", "x": 150, "y": 240, "wires": [ [ "d5beeae8.a7efe8" ] ] }, { "id": "1f37dade.2df355", "type": "FINS Connection", "name": "NX102", "host": "192.168.250.10", "port": "9600", "MODE": "NJNX", "ICF": "0x80", "DNA": "0", "DA1": "10", "DA2": "0", "SNA": "0", "SA1": "11", "SA2": "0" } ]

Steve-Mcl commented 3 years ago

Thank you for the example I have already discovered my mistake

So this is now resolved? Can we close this?


Notes (for anyone else reading)...

Explanation of the the problem @FrantaD shows... image

when writing values, you should choose number type... image

FrantaD commented 3 years ago

The connect and disconnect commands still don't work for me, but I don't seem to need them.

The problem was solved for me and it is possible to close it.

Steve-Mcl commented 3 years ago

Yes, that does appear to be an issue.

I will leave this open until I fix it (but as you say, it makes no difference - the node auto connects, you simply cannot issue a disconnect)

TBH, I think I copied that text in the help from my Mitsubishi node (MITSI comms (in my experience) have been terrible (especially TCP) and the disconnect/connect capabilities were important. Omron connections seem to works for very long periods without issue)

Steve-Mcl commented 3 years ago

@FrantaD fixed in new version 0.3.1

Thank you for taking the time to report the issue.