01-24-2007 12:59 AM
01-24-2007 01:37 AM
01-25-2007 07:59 PM
I set up the elements accordint with the manual,please see the attached picture.
Function 03 Read Holding Registers
Request Data Frame:
Slave address Function Starting address Hi Starting address Lo No. of Word Hi No. of Word Lo CRC Lo CRC Hi
01H 03H 00H 00H 00H 02H C4H 0BH
When I combine above commands to a string and send the string to serial port, then I can recieve the data. But if I use NIMODBUS and conduct the program then a error occured.
Can you help me to solve this problem?
01-26-2007 02:42 AM
As far as I can see, your settings seem to be OK (assuming that you are really using RTU and that the slave is really 01).
I'm not a Modbus expert, but a quick search shows that Modbus exception 3 is an invalid data value. This doesn't seem reasonable in this case, since you are asking for a value, but I suggest that you try searching more on that and ask the manufacterer of your device.
Also, you can try using another program which can call Modbus to determine where the problem is. Try searching for "Modbus Scanner", for example.
01-26-2007 08:04 AM
01-26-2007 09:59 PM
If I change the Comm settings there is not anything return.
I don't understand why I succeed with string mode but non-succeed with NIMODBUS mode.
01-27-2007 12:32 PM
@青风细雨楼 wrote:
I don't understand why I succeed with string mode but non-succeed with NIMODBUS mode.
What do you mean by "string mode"? Does your device use Modbus ASCII or RTU?
If it is ASCII, then you need to change the input from RTU to ASCII.
01-27-2007 04:55 PM
I would suggest using portmon to watch the data transmitted by the serial port in both modes. Save this info and post it, so we can see what is happening.
http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Portmon.mspx
Also try the llb file I put in reply 4 of this thread.
http://forums.ni.com/ni/board/message?board.id=170&message.id=144504&requireLogin=False
01-28-2007 08:45 PM
01-29-2007 03:58 AM
Your latest example has 2 stop bits configured. The Modbus library sets a single stop bit by default. Could this be the reason?
If you run just the VI that generates the actual Modbus string (MB Serial Modbus Data Unit to String) you will see that it does generate the same checksum.