Node-red-contrib-mcprotocol quality "bad" on some write requests

Hello, i have succeeded with pulling data from "Nordpool" and send it to an Array of 48 reals in my Mitsubishi PLC, but it's a 50/50 if the request returns a "good" or "bad" quality, it does write the data every time, but I would like to know why it returns "bad" quality sometimes.


1 Like

How fast are you hitting the PLC?

Are there multiple READ and / or WRITE MC Protocol nodes in operation at the same time?

Are the PLC and Node-RED on same network range or is there routing involved? (curious as to why you are using a 162 public IP address)

Are you monitoring the PLC at the same time with the ladder program? If memory serves me, port 5001 is the same port the programming tool uses. Maybe you could use a dedicated port number as setup on the "Open Settings" of the Ethernet card?

Hello, thanks for the fast reply.

There is only this one write request and no read requests.
i'm doing a new request every 30 seconds

this is a test setup, so just a network cable from the PLC, the Node Red and my computer in a common switch.

I am connected with a USB cable from my computer to the PLC to make sure it wasn't the monitoring connection that slowed it down. and i also tried disconnecting the plc software and it still happens.

all code is made in FB and ST :smiley:

PLC IP: 162.0.9.21
Node Red IP: 162.0.9.6
PC IP: 162.0.9.19

Is the PLC running a large program or have high cycle times (What is the PLC scan time)?

Could you try a different port?

Also, could you share your flow (use CTRL-E to export & use the forums code button </> before pasting into the reply)

[{"id":"54378ae8.967044","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"845fa91e.57e518","type":"nordpool-api","z":"54378ae8.967044","area":"DK1","currency":"DKK","timeSpan":"hourly","x":355.6666946411133,"y":256.0000162124634,"wires":[["76afda24.047224"]]},{"id":"a5682d2a.30792","type":"inject","z":"54378ae8.967044","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":172.66669082641602,"y":256.0000886917114,"wires":[["845fa91e.57e518"]]},{"id":"dd884d62.6e02a","type":"MC Write","z":"54378ae8.967044","name":"Mitsubishi PLC","topic":"","connection":"7fb7e572.9e27fc","data":"prices","address":"DREAL1112,48","addressType":"str","dataType":"msg","errorHandling":"msg","outputs":1,"x":793.6666870117188,"y":256.3333406448364,"wires":[["a8cbc3ad.739e6"]]},{"id":"a8cbc3ad.739e6","type":"debug","z":"54378ae8.967044","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1011.6667747497559,"y":256.3333406448364,"wires":[]},{"id":"76afda24.047224","type":"function","z":"54378ae8.967044","name":"Conversion","func":"var dataObj = { prices: [] }\n    for (var i = 0; i < msg.payload.length; i++) {\n        dataObj.prices.push(msg.payload[i].Price);\n    }\n   node.send(dataObj);\nreturn;","outputs":1,"noerr":0,"x":563.0000152587891,"y":256.0000104904175,"wires":[["dd884d62.6e02a"]]},{"id":"7fb7e572.9e27fc","type":"MC Protocol Connection","z":"","name":"Lendum Vandværk","host":"162.0.9.21","port":"5001","protocol":"UDP","frame":"4E","plcType":"Q","ascii":false,"PLCStation":"0x0","PCStation":"1","PLCModuleNo":"03xff","network":"1","octalInputOutput":false,"timeout":"10000"}]

also Scantime seems to be <1 ms.
i am not dedicated Mitsubishi PLC user, but ill see if i can figure out how to change the port, got a colleague who is better at this stuff :smiley:

same issue on port 5000 but i don't know if this is used by default aswell

Yes, I think 5000 & 5001 are built-in ports for TCP and UDP. I forget because they changed over the years and A, QnA, Q, series.

Try ports >= 3000 - they worked for me.

See this detail heavy reply...

Sorry for the late reply, other tasks called :smiley:

I now have connection on Port 3002 on the QJ71E71-100 ethernet card.

it also was running for a few hours without a single error, and suddenly the connection crashed and could not write any values to the PLC until I reset the PLC then it worked again for a short time. I cant imagine it being "overloaded" with this little data, witch was send with a 10 seconds interval.

TCP or UDP?

Show me the "open" setup

it's a UDP connection.

The port is not opened directly in the "Open" settings, but by a "FB".


image

Never had much success with ladder defined ports. Also always completely avoid structured ladder projects for mitsi Q (it is horrid) oh and if you have the choice, dump mitsubishi altogether - OMRON C series are far superior (imo) and cx-programmer is many many many miles ahead of gx in terms of usability and quality

Anyhow...

You will need to inspect the head buffer values for that card when the connection fails and cross-reference them with the manual for that card.

You might also get some clues from GX developer "ethernet diagnostics"

I will point out that, as you have witnessed, restarting the PLC is the only solution, so this particular issue you are seeing is probably a hardware thing. Did you try sending a disconnect/connect msg to the node to see if the connection recovered?

Lastly what settings are you using on the config node?

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