Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/15/04 00:54
Read: times


 
#62589 - RE: Modbus
Responding to: ???'s previous message
You do not state what Modbus protocol you wish to use.
Of the two that use serial communication there is RTU and ASCII. If you refer to the Modbus specification, they give you sample code for the RTU crc calcs using two methods. This is what I used to write my asm version.

To implement Modbus RTU reception on a 8052 type cpu, I have used timer2 for the character timeout. Each time a character is received, timer2 is reloaded with the time for 3 characters. When timer2 expires, the received data is checked and processed. Note it is not necessary to implement all Modbus commands - I normally implement the multiple register read and write commands. I use a utility called MODSCAN of which a demo can be downloaded off the 'net. This can be used to verify your code. Modbus ASCII is a bit easier to implement in terms of the transport layer but less efficient.
Have a go at writing your own code then ask us specific questions if you have problems.



List of 9 messages in thread
TopicAuthorDate
Modbus            01/01/70 00:00      
   RE: Modbus            01/01/70 00:00      
      RE: Modbus            01/01/70 00:00      
      RE: gimme code            01/01/70 00:00      
   RE: Modbus            01/01/70 00:00      
      RE: Modbus - Ray            01/01/70 00:00      
      refer to the Modbus specification            01/01/70 00:00      
   RE: Modbus            01/01/70 00:00      
      RE: Modbus            01/01/70 00:00      

Back to Subject List