Sending serial MODBUS command

This is most likely a simple misunderstanding of serial communications on my part.

I have a RS485 relay module that will accept commands formatted in ASCII or MODBUS messages. I can use "serial transmit ASCII" to send five ASCII characters ( AT+T1) and get the module to work. So the hardware link/baudrate has been validated.

When I try and send the 8 hex numbers (01 06 00 01 03 00 D8 FA) for the MODBUS message, I get not response at all. Could it have something to do with the last two being 2 byte numbers??

Im not sure how to add Blockly Code to this post for you to see.

Patience with me. I've looked at the SPIN MODBUS objects in the OBEX and they seem to just be using FullDuplexSerial and sertx out the hex numbers.

Joel

Comments

  • Looking again at the object I do see that they split the crc word into bytes using crc.byte[1] and arc.byte[0] spin commands. Then send each byte to serial. Im not sure how that could be done in Blockly.
  • Have you tried sending it as (01 06 00 01 03 00 0D 08 0F 0A) ?
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • I gave that a try with no result. I can't find the usb/rs485 converter I bought. That might help me to troubleshoot. I started to write a driver in spin, but I really don't see what that would change.
Sign In or Register to comment.