Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

write multiple register using modbus library

eloo..plz help me..i need to write multiple register by using modbus library. what happen is when i try to send more than 1 data there will be time out error. is there anyone can help me to solve this problem??tq.. 
0 Kudos
Message 1 of 5
(3,634 Views)
Hey gdah,
I have a general understanding of what your situation is, but I could use a few more details. You said that your code is timing out with an error, is there a pop with a numeric value or does it hang. Also, have you been able to confirm that the other side has been able to receive any data at all. One thing I would suggest is to use NI-Spy, Start->Programs->National Instruments, to monitor what's happening on the line. Another thing that we can try is to use the example code that comes with the library, MB Serial Master Example.vi, with some changes. In the cluster that is sent to the Master Query vi, change the Starting Address and the Quantity to suit your code.

Hope that this helped
Can Wong
0 Kudos
Message 2 of 5
(3,612 Views)
0 Kudos
Message 3 of 5
(3,605 Views)
Hi Can W,
 
thanks for your advice. In my program i used MB serial master query with some modification in MB modbus command to data unit. I changed the representation format for data array from U16 to SGL. It all works when i used function read input and read holding register. but error will occurred when i used write multiple register. Firstly, I choose write multiple register for its function code. then i try to write only 1 data in the array box in the MB modbus command cluster. the result is shown in the write multiple.jpg file. but when i try to put more than 1 data, errror will occurred as in write multiple(error).jpg. My concern is more on the query string format that i send more multiple data. i not sure if the format is incorrect or correct. can u please help me??..or mayb u can give me some example on write multiple data..tq.. 
0 Kudos
Message 4 of 5
(3,591 Views)
Hey gdah,
I see that there is a duplicate post. Could you repost what you said here on that forum, as to condense it into one thread. The other has a lot more information than this one

http://forums.ni.com/ni/board/message?board.id=140&thread.id=26507&view=by_date_ascending&page=4
Can Wong
0 Kudos
Message 5 of 5
(3,563 Views)