Read Data from Omron machine (use OmFins protocoll)

Hi, i'm trying to connect pvc Omron CJ2M machine to node red and reading data... I've tryed more type of connections, but all connections don't work.
I copy here my flow, hoping someone could help me...

[
    {
        "id": "04134de5c5d2d498",
        "type": "tab",
        "label": "LINEA PVC 22 - Read",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "41306e90b760cc3b",
        "type": "FINS Read",
        "z": "04134de5c5d2d498",
        "name": "",
        "connection": "f3549e198b43fa16",
        "addressType": "str",
        "address": "D922",
        "countType": "num",
        "count": "1",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "outputFormatType": "buffer",
        "outputFormat": "buffer",
        "x": 290,
        "y": 260,
        "wires": [
            [
                "342308a822cf88a5"
            ]
        ]
    },
    {
        "id": "e10257e8ca8b44b1",
        "type": "inject",
        "z": "04134de5c5d2d498",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 125,
        "y": 260,
        "wires": [
            [
                "41306e90b760cc3b"
            ]
        ],
        "l": false
    },
    {
        "id": "342308a822cf88a5",
        "type": "debug",
        "z": "04134de5c5d2d498",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 260,
        "wires": []
    },
    {
        "id": "33c787acadb693be",
        "type": "FINS Read",
        "z": "04134de5c5d2d498",
        "name": "",
        "connection": "2cd5a6f8d25e577d",
        "addressType": "str",
        "address": "D798",
        "countType": "num",
        "count": "2",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "outputFormatType": "signed",
        "outputFormat": "",
        "x": 290,
        "y": 340,
        "wires": [
            [
                "be03cf830769ddb3"
            ]
        ]
    },
    {
        "id": "5b2d89736719801f",
        "type": "inject",
        "z": "04134de5c5d2d498",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 125,
        "y": 340,
        "wires": [
            [
                "33c787acadb693be"
            ]
        ],
        "l": false
    },
    {
        "id": "be03cf830769ddb3",
        "type": "debug",
        "z": "04134de5c5d2d498",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "msg",
        "x": 530,
        "y": 340,
        "wires": []
    },
    {
        "id": "a47d7265ebe9fdc3",
        "type": "inject",
        "z": "04134de5c5d2d498",
        "name": "Connect with options (UDP)",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "options",
                "v": "{\"host\":\"10.1.3.90\",\"port\":9600,\"protocol\":\"udp\",\"DNA\":0,\"DA1\":90,\"DA2\":0,\"SNA\":0,\"SA1\":21,\"SA2\":0}",
                "vt": "json"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "connect",
        "x": 180,
        "y": 80,
        "wires": [
            [
                "2118a34b98213b50"
            ]
        ]
    },
    {
        "id": "2118a34b98213b50",
        "type": "FINS Control",
        "z": "04134de5c5d2d498",
        "name": "",
        "connection": "f3549e198b43fa16",
        "clockType": "json",
        "clock": "",
        "connectOptionsType": "msg",
        "connectOptions": "options",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "commandType": "msg",
        "command": "topic",
        "x": 410,
        "y": 100,
        "wires": [
            [
                "9e1bbf66267727fa"
            ]
        ]
    },
    {
        "id": "f19758a6ac8d6e45",
        "type": "inject",
        "z": "04134de5c5d2d498",
        "name": "Disconnect from PLC",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "disconnect",
        "x": 160,
        "y": 120,
        "wires": [
            [
                "2118a34b98213b50"
            ]
        ]
    },
    {
        "id": "9e1bbf66267727fa",
        "type": "debug",
        "z": "04134de5c5d2d498",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 610,
        "y": 140,
        "wires": []
    },
    {
        "id": "e2014019fbcbcdc1",
        "type": "FINS Control",
        "z": "04134de5c5d2d498",
        "name": "",
        "connection": "2cd5a6f8d25e577d",
        "clockType": "msg",
        "clock": "",
        "connectOptionsType": "msg",
        "connectOptions": "options",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "commandType": "connect",
        "command": "",
        "x": 400,
        "y": 180,
        "wires": [
            [
                "9e1bbf66267727fa"
            ]
        ]
    },
    {
        "id": "80d293f1280e6099",
        "type": "inject",
        "z": "04134de5c5d2d498",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 180,
        "wires": [
            [
                "e2014019fbcbcdc1"
            ]
        ]
    },
    {
        "id": "f3549e198b43fa16",
        "type": "FINS Connection",
        "name": "PVC22",
        "host": "10.1.3.90",
        "port": "9600",
        "MODE": "",
        "MODEType": "CJ",
        "protocol": "",
        "protocolType": "env",
        "ICF": "",
        "DNA": "",
        "DA1": "",
        "DA2": "",
        "SNA": "",
        "SA1": "",
        "SA2": "",
        "autoConnect": false
    },
    {
        "id": "2cd5a6f8d25e577d",
        "type": "FINS Connection",
        "name": "PVC 22 A",
        "host": "10.1.3.90",
        "port": "9600",
        "MODE": "",
        "MODEType": "CJ",
        "protocol": "",
        "protocolType": "udp",
        "ICF": "80",
        "DNA": "0",
        "DA1": "90",
        "DA2": "0",
        "SNA": "0",
        "SA1": "21",
        "SA2": "0",
        "autoConnect": true
    }
]

Lets start simple (i.e. ignore the dynamic connection FINS Control & just set the connection manually)

From your flow, I see you are setting PLC node number as 90, PC node number as 21 and the UDP port as 9600.

Questions...

  1. What is the IP and Subnet Mask of the PLC
    1. Show me a screenshot of the Ethernet settings and the FINS UDP settings
  2. What is the NODE NUMBER dials set to (for the physical port where the PLC is connected to network)
  3. What is the IP and Subnet Mask of the PC where Node-RED is installed
  4. Can the PC where Node-RED is installed PING the PLC?
  5. Do you see any errors in debug?
  6. What status is displayed under the READ node when operated?

I don't know another info about this plc. I only have IP address of the machine and that use omfins protocoll. Are there some programs to define these parametres you ask?
1 - IP machine is written in the host 10.1.3.90 -- where i can find subnet mask of the plc?

  • ether
    2- What do you mean with NODE NUMBER?
    3 - the ip of the pc is the same of the photos uploaded
    4 - yes ping is ok
    5-

    these are the errors (first errors from the D922 node, and the second from D798 node)

In the CX Programmer application.
Did you setup the PLC?

I notice the PLC and the PC are on different subnets. I also note the Pc is a virtual machine.

  • Does the PLC Ethernet settings have correct gateway setting for the network segment?
  • Does the PLC have a node number + IP address of your PC in the "FINS/UDP IP Table"
    image

On the front of the CJ2M PLC are 2 physical dials - I need to know what these are set to.

Typically, the PLC NODE NUMBER should be set to the same as the IP address last octet. In your case, the PLC IP is 10.1.3.90 so I recommend the NODE NUMBER dials are set to 90
Dial x16(1) => 5
Dial x16(0) => A

5x16^1 = 80
Ax16^0 = 10
5A = 90

Yes, I work with a virtual machine and I need to connect this PLC machine.
And with correct gateway you mean what precisly?
Ah ok, ok, I'll ask an I'll tell node number.
Last question about protocol name, how can i know if the plc uses the udp protocol? Cause i have no info about it.
And, header error:1005 on node red, how fix it?

As your PLC is on a different subnet, it should have a gateway set in its IP settings so that responses can be routed back to your VM LAN. You do this in the Ethernet settings in CX Programmer.

This PLC supports UDP and TCP connections. You just need to check in CX Programmer what the port number is set to.

That will likely not happen once you have correct settings.
At this point, i suspect the NODE NUMBER dials are NOT set to 5A (i.e. 90 decimal)
Get the node number dials set correctly & power off/power on the PLC and try again.

Ok. Now i've setted correctly info.

but i have same error: timeout
timeout

This is the flow:

[
    {
        "id": "f1d74b8333dfb708",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "bc4f1736f81bd52d",
        "type": "FINS Read",
        "z": "f1d74b8333dfb708",
        "name": "",
        "connection": "2cd5a6f8d25e577d",
        "addressType": "str",
        "address": "D922",
        "countType": "num",
        "count": "1",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "outputFormatType": "buffer",
        "outputFormat": "buffer",
        "x": 370,
        "y": 120,
        "wires": [
            [
                "8c3a530630d38026"
            ]
        ]
    },
    {
        "id": "91c8b90be62a6b0b",
        "type": "inject",
        "z": "f1d74b8333dfb708",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 205,
        "y": 120,
        "wires": [
            [
                "bc4f1736f81bd52d"
            ]
        ],
        "l": false
    },
    {
        "id": "8c3a530630d38026",
        "type": "debug",
        "z": "f1d74b8333dfb708",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 120,
        "wires": []
    },
    {
        "id": "3847d8f75b5a10f7",
        "type": "FINS Read",
        "z": "f1d74b8333dfb708",
        "name": "",
        "connection": "2cd5a6f8d25e577d",
        "addressType": "str",
        "address": "D798",
        "countType": "num",
        "count": "2",
        "msgPropertyType": "msg",
        "msgProperty": "payload",
        "outputFormatType": "signed",
        "outputFormat": "",
        "x": 370,
        "y": 200,
        "wires": [
            [
                "4fa64919a3b56ac0"
            ]
        ]
    },
    {
        "id": "5e6bd842f3e94c46",
        "type": "inject",
        "z": "f1d74b8333dfb708",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 205,
        "y": 200,
        "wires": [
            [
                "3847d8f75b5a10f7"
            ]
        ],
        "l": false
    },
    {
        "id": "4fa64919a3b56ac0",
        "type": "debug",
        "z": "f1d74b8333dfb708",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "msg",
        "x": 610,
        "y": 200,
        "wires": []
    },
    {
        "id": "2cd5a6f8d25e577d",
        "type": "FINS Connection",
        "name": "PVC 22 A",
        "host": "10.1.3.90",
        "port": "9600",
        "MODE": "",
        "MODEType": "CJ",
        "protocol": "",
        "protocolType": "udp",
        "ICF": "80",
        "DNA": "0",
        "DA1": "90",
        "DA2": "0",
        "SNA": "0",
        "SA1": "21",
        "SA2": "0",
        "autoConnect": true
    }
]

And what are the node dials set to on the front of the PLC??

And do you have the correct gateway and add in the IP settings of the PLC?

Has the PLC been power cycled since changing settings?

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