# Read Data from Omron machine (use OmFins protocoll)

**URL:** <https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410>\
**Category:** General\
**Created:** [21 July 2022 09:36 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410 "2022-07-21T09:36:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteovi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matteovi/32/64536_2.png) [@matteovi](https://discourse.nodered.org/u/matteovi)\
**Post date:** [21 July 2022 09:36 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/1 "2022-07-21T09:36:19Z")

</div>

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

```auto
[
    {
        "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
    }
]

```

---

<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:** [21 July 2022 09:52 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/2 "2022-07-21T09:52:14Z")

</div>

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

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

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?

---

<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:** [21 July 2022 13:30 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/4 "2022-07-21T13:30:50Z")

</div>

> [@matteovi](#):
>
> IP machine is written in the host 10.1.3.90 -- where i can find subnet mask of the plc

> [@matteovi](#):
>
> Are there some programs to define these parametres you ask?

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9cbdd3fdc7c701eb739fde4fe6ca1469bad26817.png)

> [@matteovi](#):
>
> What do you mean with NODE NUMBER?

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e02e2090fd65fc906d2c42927de446248ca375ea.jpeg)

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`

 

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

```

---

<div class="post-metadata">

**Author:** ![matteovi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matteovi/32/64536_2.png) [@matteovi](https://discourse.nodered.org/u/matteovi)\
**Post date:** [21 July 2022 13:44 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/5 "2022-07-21T13:44:49Z")

</div>

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?

---

<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:** [22 July 2022 08:02 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/6 "2022-07-22T08:02:43Z")

</div>

> [@matteovi](#):
>
> And with correct gateway you mean what precisly?

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.

> [@matteovi](#):
>
> Last question about protocol name, how can i know if the plc uses the udp protocol? Cause i have no info about it.

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

> [@matteovi](#):
>
> And, header error:1005 on node red, how fix it?

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.

---

<div class="post-metadata">

**Author:** ![matteovi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matteovi/32/64536_2.png) [@matteovi](https://discourse.nodered.org/u/matteovi)\
**Post date:** [28 July 2022 12:54 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/7 "2022-07-28T12:54:07Z")

</div>

Ok. Now i've setted correctly info.

 ![setting](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bba664ebf09a436ee948cb5cb961ffee9ebd898c.png)

but i have same error: timeout  
 ![timeout](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0d0695140b924eece8b615659461568cf0a87f0.png)

This is the flow:

```auto
[
    {
        "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
    }
]

```

---

<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:** [28 July 2022 13:24 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/8 "2022-07-28T13:24:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 September 2022 13:25 UTC](https://discourse.nodered.org/t/read-data-from-omron-machine-use-omfins-protocoll/65410/9 "2022-09-26T13:25:18Z")

</div>

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