06-09-2021 01:05 PM
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.
06-09-2021 02:05 PM
You could write
19282 = 0x4B52
17479 = 0x4447
16160 = 0x3F20
12301 = 0x300D
2560 = 0x0A00
to 5 U16 registers.
Regards, Jens
06-09-2021 03:17 PM - edited 06-09-2021 03:18 PM
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.
06-09-2021 04:11 PM - edited 06-09-2021 04:12 PM
Hi Nadweb,
@Nadweb wrote:
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"?
06-09-2021 05:00 PM
I guess its a string serial command, KRDG? 0\r\n, that I have converted to hex for use with modbus tcp/ip
06-09-2021 05:15 PM
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
06-09-2021 05:26 PM
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.