I am able to write directly to a digital output on my Mitsubishi PLC, in my case Y6 and Y7 but when I try to write False to turn the output off it always says true and never turns the output off?
This is because a string of False is NOT false
which is basically true
. Change the drop-down to number and enter 0 or 1.
Better still, change it to msg.payload
and pass the value in from the inject node.
As for returning true, that is to signify the value was received by the plc.
Thought I tried it every which way but apparently not.. got it working but for the Address dropdown I have it at string since there is not number option.
[
{
"id": "0e4c4e876be57fe0",
"type": "MC Write",
"z": "1edb34811118b980",
"name": "Output Y6",
"topic": "",
"connection": "8bf9ce709d0bac70",
"data": "payload",
"address": "Y6",
"addressType": "str",
"dataType": "msg",
"errorHandling": "throw",
"outputs": 1,
"x": 1080,
"y": 1020,
"wires": [
[
"d40f63709511ea3f"
]
]
},
{
"id": "478c742ed3ad45e1",
"type": "inject",
"z": "1edb34811118b980",
"name": "ON",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 870,
"y": 1020,
"wires": [
[
"0e4c4e876be57fe0"
]
]
},
{
"id": "d40f63709511ea3f",
"type": "debug",
"z": "1edb34811118b980",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1270,
"y": 1020,
"wires": []
},
{
"id": "ca625bb2e78d2101",
"type": "inject",
"z": "1edb34811118b980",
"name": "OFF",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 870,
"y": 1100,
"wires": [
[
"0e4c4e876be57fe0"
]
]
},
{
"id": "56b584be43b166f3",
"type": "MC Write",
"z": "1edb34811118b980",
"name": "Output Y7",
"topic": "",
"connection": "8bf9ce709d0bac70",
"data": "payload",
"address": "Y7",
"addressType": "str",
"dataType": "msg",
"errorHandling": "throw",
"outputs": 1,
"x": 1080,
"y": 1180,
"wires": [
[
"9ba76175f1fea81d"
]
]
},
{
"id": "7c1013dc01ca015e",
"type": "inject",
"z": "1edb34811118b980",
"name": "ON",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 870,
"y": 1180,
"wires": [
[
"56b584be43b166f3"
]
]
},
{
"id": "9ba76175f1fea81d",
"type": "debug",
"z": "1edb34811118b980",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1270,
"y": 1180,
"wires": []
},
{
"id": "c05b335492076ce5",
"type": "inject",
"z": "1edb34811118b980",
"name": "OFF",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 870,
"y": 1260,
"wires": [
[
"56b584be43b166f3"
]
]
},
{
"id": "8bf9ce709d0bac70",
"type": "MC Protocol Connection",
"name": "PLC1",
"host": "192.168.1.15",
"port": "3001",
"protocol": "UDP",
"frame": "3E",
"plcType": "Q",
"ascii": false,
"PLCStation": "",
"PCStation": "",
"PLCModuleNo": "",
"network": "",
"octalInputOutput": false,
"timeout": "1000"
}
]
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.