How to edit Modbus node

Hello Everyone,

I am using [https://flows.nodered.org/node/node-red-contrib-modbus] node.
But in this node I can not pass inputs.
So i want to edit this node or if edit is not possible so how can i create same node.

Here is my flow..

[{"id":"55c442eb.43a9bc","type":"tab","label":"MODBUS","disabled":false,"info":""},{"id":"151671a5.6ceb7e","type":"modbus-read","z":"55c442eb.43a9bc","name":"","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"0","quantity":"1","rate":"30","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"7fc2c7fb.5e9108","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":138.56943893432617,"y":164.4722499847412,"wires":[["74d003dd.8d9c3c"],[]]},{"id":"ddde68e0.dd56d8","type":"debug","z":"55c442eb.43a9bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":510,"y":162,"wires":[]},{"id":"edd6f8d.1b47c08","type":"modbus-write","z":"55c442eb.43a9bc","name":"","showStatusActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"0","quantity":"1","server":"7fc2c7fb.5e9108","emptyMsgOnFail":false,"x":500,"y":400,"wires":[["f0d1b8df.ccff28"],["f0d1b8df.ccff28"]]},{"id":"91d27086.106a6","type":"inject","z":"55c442eb.43a9bc","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":400,"wires":[["6a80c017.9bf12"]]},{"id":"f0d1b8df.ccff28","type":"debug","z":"55c442eb.43a9bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":400,"wires":[]},{"id":"6a80c017.9bf12","type":"random","z":"55c442eb.43a9bc","name":"","low":"1","high":"10","inte":"true","property":"payload","x":320,"y":400,"wires":[["edd6f8d.1b47c08"]]},{"id":"74d003dd.8d9c3c","type":"function","z":"55c442eb.43a9bc","name":"","func":"var res=msg.payload[0];\nmsg.payload={\n    \"Time\": new Date().getTime(),\n    \"Value\":res\n    \n}\nreturn msg;","outputs":1,"noerr":0,"x":332.57989501953125,"y":162.00698947906494,"wires":[["ddde68e0.dd56d8","6a49e8be.b2e058"]]},{"id":"e8099a83.4656a8","type":"encrypt","z":"55c442eb.43a9bc","name":"","algorithm":"AES","key":"123","x":400,"y":280,"wires":[["7608e33f.6a167c","6b89964a.6b93d8"]]},{"id":"6a49e8be.b2e058","type":"json","z":"55c442eb.43a9bc","name":"","property":"payload","action":"str","pretty":false,"x":250,"y":280,"wires":[["e8099a83.4656a8"]]},{"id":"7608e33f.6a167c","type":"debug","z":"55c442eb.43a9bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":240,"wires":[]},{"id":"4319a78f.6fcf28","type":"debug","z":"55c442eb.43a9bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":320,"wires":[]},{"id":"6b89964a.6b93d8","type":"decrypt","z":"55c442eb.43a9bc","name":"","algorithm":"AES","key":"123","x":540,"y":320,"wires":[["4319a78f.6fcf28"]]},{"id":"7fc2c7fb.5e9108","type":"modbus-client","z":"","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"}]```

What do you mean by that?

In this node at the place of input inject button is there but i want to pass parameters externally
so for passing the parameters i want to change this node like a function node( 1 input and output) I don't want inject button.

Sorry, still don't understand. What exactly do you want to do that you can't?

In Above Screen shot There are two modbus nodes is there
one is modbus read and another is modbus write.
In modbus write we can pass inputs but in modbus read, we can not pass inputs.
I want to pass inputs in modbus read node also for setting up the modbus read node internal parameters.

OK, that is now clear. Have you looked at the Flex Getter node?

Yes, but that is different.
I want to use read node for reading registers.
I don't know much about Flex Getter node.

Doesn't the flex getter node do exactly what you want? Did you read the help text for it?
What do you need to do that it cannot?

Thank you for help.
One more thing I want to know,
Is device discovery possible in modbus?

I don't think so, but I haven't used modbus for 20 years so I may be a little out of date. A quick google search suggests not.

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