HI Daniel,
I would like to know how do I send a simple request to the xArm 6 with Node-Red? As this is the function code that I want to send to the xArm itself
// Convert payload string to buffer
msg.payload = Buffer.from([0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x29]);
return msg;
Below is the whole flow and the node-red modbus configuration
[
{
"id": "9d917b22f0302b26",
"type": "inject",
"z": "da1d1d735d73916f",
"name": "reset print",
"props": [
{
"p": "topic",
"vt": "str"
},
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "00 01 00 00 00 09 01 10 00 30 00 01 02 00 05",
"payloadType": "str",
"x": 560,
"y": 80,
"wires": [
[
"5beb62d04db97127"
]
]
},
{
"id": "5beb62d04db97127",
"type": "function",
"z": "da1d1d735d73916f",
"name": "function 3",
"func": "// Convert payload string to buffer\nmsg.payload = Buffer.from([0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x29]);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 700,
"y": 80,
"wires": [
[
"cfbbd6d03a47c642"
]
]
},
{
"id": "cfbbd6d03a47c642",
"type": "modbustcp-write",
"z": "da1d1d735d73916f",
"name": "",
"topic": "",
"dataType": "HoldingRegisters",
"adr": "1",
"server": "54b193381bed3aa4",
"x": 850,
"y": 80,
"wires": []
},
{
"id": "54b193381bed3aa4",
"type": "modbustcp-server",
"name": "",
"host": "192.168.5.201",
"port": "502",
"unit_id": "1",
"reconnecttimeout": "1"
}
]
Hope to hear from you soon!