I want to use the Modbus Ethernet Master Query Write function to send a hexadecimal command over ethernet. My problem is that the registers are numeric u16 and thus won't accept letters, but my command contains letters. As a hex my command is 4B 52 44 47 3F 20 30 0D 0A, so each pair is in one register, so I need to be able write a mixed number and letter in some of the registers. Is there a way to do this?
Solved! Go to Solution.
You could write
19282 = 0x4B52
17479 = 0x4447
16160 = 0x3F20
12301 = 0x300D
2560 = 0x0A00
to 5 U16 registers.
Make your control or constant show the radix. Set it to be Hex display. Now you can type those hex values in using 0-9,A-F.
As a hex my command is 4B 52 44 47 3F 20 30 0D 0A, so each pair is in one register, so I need to be able write a mixed number and letter in some of the registers. Is there a way to do this?
You can also use a string constant like this:
Are you sure it's a "hex command for Modbus"?
I guess its a string serial command, KRDG? 0\r\n, that I have converted to hex for use with modbus tcp/ip
Modbus TCP/IP does not have any "commands" that look like that.
Perhaps you mean just TCP/IP communications with an instrument. But it is not Modbus.
You can find details about Modbus communication here. https://modbus.org/tech.php
It is an instrument specific RS232 command that I would normally send as a string using VISA write, so I was incorrect calling it a Modbus command. My understanding from the application engineer is that I can convert this command to a hex, and send it via Modbus TCP/IP Ethernet to our programmable automation controller, which should be able to send this to the instrument and read the response, via a boot program. I am very new to Modbus, so I'm learning as I go.