03-03-2009 02:47 PM
Hi,
I'm new to programming and labview. Can anyone help me to understand how I can communicate a modbus protocol device using labview. I checked out the examples but am still unsure how the registers work.
Thanks
03-03-2009 02:52 PM
03-09-2009 01:52 PM
Hi jmcbee,
Thanks for your response. Yes, the device communicates via RS232; however, I tried the MB CRC-16 example and did not get any reading. Currently, i'm trying to set up the CRC-16, but after reading through some CRC-16 posts and the communication guide for my device, I found that the CRC-16 direction for your previous post resembled mine. According to the guide:
1. Load a 16 bit register with FFFF (all 1’s). Call this the CRC register.
2. Exclusive OR the first 8 bit byte of the message with the low-order byte of the 16 bit CRC
register, putting the result back into the CRC register
3. Look at the Least Significant Bit of the CRC register and remember it. Call it the LastBit
4. Shift the CRC register one bit right, putting 0 in the top bit
5. If the LastBit was 1, Exclusive OR the CRC register with value A001h (1010 0000 0000
0001)
6. Repeat steps 3,4,5 until 8 shifts have been performed
7. Repeat from step 2 for the next byte of the message until all bytes have been processed
8. The final contents of the CRC register is the CRC value to use
9. When the CRC is placed in the message, the Least Significant Byte is sent first, then the
Most Significant Byte
So, I'm wondering if I can see your vi for SI-M communication card?
thanks
Devin
03-09-2009 01:57 PM
03-09-2009 06:40 PM
download the ni modbus library. http://sine.ni.com/devzone/cda/epd/p/id/4756
There are many examples in the forums for doing reads and writes.
see the llb file i put in this thread.
http://forums.ni.com/ni/board/message?board.id=170&message.id=200988&requireLogin=False
03-10-2009 03:57 PM
Thanks Unclebump, but can you send the link for Modbus library for LV 7.0?
03-10-2009 04:36 PM
Thanks for your help jmcbee,
I have a question regarding the advanced serial write and read. You mentioned that I can read directly off my device using the vi. However, is this true only for a RS232 communicating device since I always thought that I would need to read off the holding register to get, for instance, the temperature that the device reads? Also, for the CRC-16, do I simply connect the read string to the vi?
Thanks, sorry for the trouble.
03-11-2009 11:08 AM