This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

communication with Modbus in C

Hi!
I work with LPC2138 ARM and i want to establish the communication between the microcontroller and the Modbus.As slave the microcontroller receives a frame from the master(modbus).The problem is that i don't know how the slave can respond to the request from the master.By the way i program with C language.I try with" printf ",but untill now i don't have any success.

Thank you for any Help.

Best regards

Parents
  • You haven't mentioned if you are using the ASCII or RTU form of Modbus.

    You can emit binary strings using embedded hex codes, like "\x10\x12\x14", but normally printf() isn't really the best way if you are using a binary protocol. Then it is normally better to get and put the individual characters.

Reply
  • You haven't mentioned if you are using the ASCII or RTU form of Modbus.

    You can emit binary strings using embedded hex codes, like "\x10\x12\x14", but normally printf() isn't really the best way if you are using a binary protocol. Then it is normally better to get and put the individual characters.

Children