Hi all,
I’m stuck…
I used to operate an “invertek optidrive E3” with an arduino and an RS485 module.
the aduino was sending this command ( and some other )
start[] = {0x01,0x06, 0x00, 0x00, 0x00, 0x01, 0x48, 0x0A}
The invertek uses the following modbus telegram structure
06 Write single holding register
Master telegram
- Slave address 1 byte = 01
- Function code 1 byte = 06
- Register address = 2 byte = 00 00
- Value = 2 byte = 00 01 ( 00 00 to stop )
- CRC = 2 bytes = XX XX
all the serial devices use
- 9600, 8,N,1
now I want to do this with HA and node-Red.
The setup is as folows
Home Assistant on Raspberry Pi 4
URS TCP232-304 : RS485 to ethernet ( ip 192.168.0.7:502 ) → connceted to RS485 to USB to a serial port monitor-> connected to optidrive - 120Ohm terminal
but looking at the serail monitor it gives the follwing ( looks like the register is shifted and cheksum is gone??? ) :
00 01 00 00 00 06 01 06 00 00 00 01 the bold part is the same…
can someone give me advise?
Tnx Tom
I’ve tried it with this flow :
[{"id":"5b0dada6.2ecd9c","type":"tab","label":"Modbus Switch TCP","disabled":false,"info":""},{"id":"5f76b6c73ea57cf5","type":"modbus-flex-write","z":"5b0dada6.2ecd9c","name":"","showStatusActivities":false,"showErrors":false,"showWarnings":true,"server":"a477577e.9e0bc","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":690,"y":360,"wires":[["ba7f78a1eddedc59"],["d0a3cd468e858854"]]},{"id":"e291aac585e61c6c","type":"function","z":"5b0dada6.2ecd9c","name":"function 1","func":"var fc = 6;\nvar sa = 0;\nvar addresses = 1;\nvar value = 1;\nmsg.slave_ip = \"192.168.0.7\";\nmsg.payload = { \"value\": value, 'fc': fc, 'unitid': 1, 'address': sa, 'quantity': addresses };\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":360,"wires":[["5f76b6c73ea57cf5"]]},{"id":"de246ca2ae167a29","type":"inject","z":"5b0dada6.2ecd9c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":360,"wires":[["e291aac585e61c6c"]]},{"id":"ba7f78a1eddedc59","type":"debug","z":"5b0dada6.2ecd9c","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1160,"y":360,"wires":[]},{"id":"d0a3cd468e858854","type":"debug","z":"5b0dada6.2ecd9c","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1160,"y":420,"wires":[]},{"id":"a477577e.9e0bc","type":"modbus-client","name":"Modbus Switch TCP","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"failureLogEnabled":false,"tcpHost":"192.168.0.7","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]