Reading multiple addresses from MC Protocol (Mitsubishi FX PLC)

  1. Show a small screenshot of how you configured the MC READ
  2. Try reading D990 - does that timeout or does it return a value?

@Steve-Mcl
i set MC protocol node to D990,99 and it give me timeout error as a result it did
not worked
and the code i mention about is i removed ,99 from it and it worked for MC Protocol node but for buffer it say "Error: data is not an array or a buffer"

I need to see a small screenshot of how you configured the MC READ for D990,99

Please set it again & operate it.

Also set the debug node to show the complete message. Include that in your screenshot.

@Steve-Mcl


This is the image

Please clear the debug output

Please set the "Output Format" to Array on the MC READ

Please set the debug node to "show complete message"

Please press the inject again

Please send another screenshot with the debug msg expanded

After Doing it it still shows me Timeout error

[
    {
        "id": "e95a7b2e1151c8ce",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a3d02109deacdab5",
        "type": "group",
        "z": "e95a7b2e1151c8ce",
        "name": "FAKE:  Read D990,99 \\n (99 Words starting from D990) \\n Replace me with MC READ Node",
        "style": {
            "label": true
        },
        "nodes": [
            "354fb8229f36ba34"
        ],
        "x": 474,
        "y": 27,
        "w": 217,
        "h": 114
    },
    {
        "id": "9d5fe86ef9060dfc",
        "type": "buffer-parser",
        "z": "e95a7b2e1151c8ce",
        "name": "Convert array ro named values",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "int16le",
                "name": "extrusionRodNumber",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "extrusionTime",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "temperatureGiven",
                "offset": 4,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "temperatureSetting",
                "offset": 6,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "rapida",
                "offset": 28,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "chamdaDe",
                "offset": 30,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "protecaob",
                "offset": 32,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "protecaoa",
                "offset": 34,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "freagem",
                "offset": 36,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "limitPressureOfMasterCylinder",
                "offset": 42,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "veloc4",
                "offset": 44,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "veloc3",
                "offset": 46,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "veloc2",
                "offset": 48,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "rapida",
                "offset": 50,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "fillingPressureGiven",
                "offset": 52,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "slopeGivenOfBreakthroughPressure",
                "offset": 54,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "velocityAttenuationRatio",
                "offset": 58,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "velocityAttenuationStroke",
                "offset": 60,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "maximumStrokeGiven",
                "offset": 68,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "actualValueOfCoil",
                "offset": 136,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "breakthroughPressure",
                "offset": 160,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "residualPosition",
                "offset": 172,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderPosition",
                "offset": 174,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "rateOfDecay",
                "offset": 176,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfMainCylinder",
                "offset": 182,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "speedGiven",
                "offset": 184,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "settingPointOfCoil",
                "offset": 186,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfSideCylinder",
                "offset": 188,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "coilCurrent",
                "offset": 190,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderSpeed",
                "offset": 192,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "swap16",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "value",
        "resultTypeType": "return",
        "multipleResult": true,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 430,
        "y": 240,
        "wires": [
            [
                "f2595a732b6b660f"
            ]
        ]
    },
    {
        "id": "69fd61c05090c7fa",
        "type": "inject",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "D990,99",
        "x": 140,
        "y": 140,
        "wires": [
            [
                "9fac3f141851276c"
            ]
        ]
    },
    {
        "id": "f2595a732b6b660f",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "name": "debug 390",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 320,
        "wires": []
    },
    {
        "id": "354fb8229f36ba34",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "g": "a3d02109deacdab5",
        "name": "PLC Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 100,
        "wires": []
    },
    {
        "id": "9fac3f141851276c",
        "type": "MC Read",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "topic": "",
        "connection": "68f68eb02a618617",
        "address": "D990,99",
        "addressType": "str",
        "outputFormat": "1",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 340,
        "y": 140,
        "wires": [
            [
                "354fb8229f36ba34",
                "9d5fe86ef9060dfc"
            ]
        ]
    },
    {
        "id": "68f68eb02a618617",
        "type": "MC Protocol Connection",
        "name": "",
        "host": "192.168.2.20",
        "port": "5001",
        "protocol": "TCP",
        "frame": "1E",
        "plcType": "Q",
        "ascii": false,
        "PLCStation": "2",
        "PCStation": "255",
        "PLCModuleNo": "2",
        "network": "2",
        "octalInputOutput": false,
        "timeout": "1000"
    }
]

@Steve-Mcl
above code has the changes you showed me please refer

Sorry, but if you are not going to do what I ask, I cannot help you any more.

@Steve-Mcl
i did it

Now try adjusting the count.

Try D990,50 - does that work?

Try D990,30 - does that work?

Try D990,9 - does that work?

@Steve-Mcl
It worked For D990,30


But the problem is for Buffer

Yes, that is expected because of small data READ size!
Lets figure out READing the higher addresses first.


Good. Now lets try reading a single D from higher up.

For now, until we understand what is happening, DELETE the wire from MC READ ---x---> Buffer Parser node

Next, please answer every question...

  1. What do you get for address D1023
  2. What do you get for address D1024
  3. What do you get for address D1025
  4. What do you get for address D1086
  5. What do you get for address D1087
  6. What do you get for address D1088
  1. What do you get for address D1023
  2. What do you get for address D1024
  3. What do you get for address D1025
  4. What do you get for address D1086
  5. What do you get for address D1087
  6. What do you get for address D1088

@Steve-Mcl

[0,2,420,194,146,487,0,0,0,0,0,200,128,6000,5000,4000,3000,2000,1000,0,3,280,400,400,400,400,100,10,30,0,0,128,300,400,15653,50,10,6,0,200,280,230,3,3,800,120,32,0,2,0]

Where to find it in this message

No, please do what I asked.

  1. What do you get when you set MC READ to READ ONLY 1 address - D1023
  2. What do you get when you set MC READ to READ ONLY 1 address - D1024
  3. What do you get when you set MC READ to READ ONLY 1 address - D1025
  4. What do you get when you set MC READ to READ ONLY 1 address - D1086
  5. What do you get when you set MC READ to READ ONLY 1 address - D1087
  6. What do you get when you set MC READ to READ ONLY 1 address - D1088

By the way, that data HAS 50 elements but you said...

So did D990,50 actually work OK?

@Steve-Mcl What are you trying to do

So did D990,50 actually work OK?

YES

  1. What do you get when you set MC READ to READ ONLY 1 address - D1023

400

  1. What do you get when you set MC READ to READ ONLY 1 address - D1024

15653

  1. What do you get when you set MC READ to READ ONLY 1 address - D1025

50

  1. What do you get when you set MC READ to READ ONLY 1 address - D1086

0

  1. What do you get when you set MC READ to READ ONLY 1 address - D1087

0

  1. What do you get when you set MC READ to READ ONLY 1 address - D1088

930

@Steve-Mcl
As we are discussing on D tag Address
i still dont under stand how we would get D_bit and M and Y in this or would i have to create a different node for them

Good.

Now, we need to find the max read size. 99 should work but as it doesnt, try lowering it until it works.

  1. Try setting MC READ to D990,98 - does it work?
  2. Try setting MC READ to D990,97 - does it work?
  3. Try setting MC READ to D990,96 - does it work?
  4. etc etc etc

Tell me the highest ,nn count number that works.


To make this easier - use this flow:

chrome_I2wEiJz7Xj

[{"id":"fd3e1507fad47c81","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":640,"y":540,"wires":[["6548196310afdda8"]]},{"id":"8d08c518904584a4","type":"inject","z":"99321f37fd961305","name":"read next address","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":540,"wires":[["46bbd1491909db56"]]},{"id":"6548196310afdda8","type":"debug","z":"99321f37fd961305","name":"PLC Data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":620,"wires":[]},{"id":"46bbd1491909db56","type":"function","z":"99321f37fd961305","name":"address maker","func":"\nif (msg.topic === 'set-count') {\n    context.set('count', msg.payload)\n    node.status({fill:\"green\",shape:\"ring\",text:\"Set count to \" + msg.payload});\n    return\n}\n\nlet count = context.get('count') ?? 98\nnode.status({ fill: \"green\", shape: \"ring\", text: \"Sending address D990,\" + count });\nmsg.topic = \"D990,\" + count\ndelete msg.payload\n\nif (count > 1) count--\ncontext.set('count', count)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":540,"wires":[["fd3e1507fad47c81"]]},{"id":"76ad3972c996b4e0","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"set-count","payload":"98","payloadType":"num","x":210,"y":500,"wires":[["46bbd1491909db56"]]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

I have explained that before here:

and i WILL explain it again - AFTER we get reliable data for the "D" area working

@Steve-Mcl
Now i gave you the answer of the question you asked before can you please tell what next to do
Means i need the data in the form of
for example
address D990
topic Extrusion
Payload 300
address D992
topic : temp
Payload 450

Yes, I will tell you how to acheive that but you are jumping ahead.

please answer