Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus frame

I am still confused, are you talking about sending to the micro or writing to a file ?  Smiley Surprised
0 Kudos
Message 31 of 39
(2,858 Views)

I no longer have the problem with any device that I use right now. From front panel,it will show the value as expected but after write to txt file. the txt file itself doesn't show like the string at front panel. We're discuss on 0x20 value I'm getting after run your program isn't it? This is what I'm trying to tell you. The problem isn't part of the device at all. Can you just try run this code at send back to me the txt file. Just send any modbus frame at Cheat Modbus String. Do you see any changes at the txt file if u send any 0x00? 

0 Kudos
Message 32 of 39
(2,856 Views)
Here it is. No problem no other data in the file then I would expect.
Curious what you see in the txt file.


Message Edited by K C on 11-14-2007 09:44 AM
Download All
0 Kudos
Message 33 of 39
(2,849 Views)

Hi .

I finally know what's going on. The .txt file will show 0x00 if only I open the file back using labview. If I just copy the character string in test.txt file into string indicator and display it in hex, it will show 0x20. I wonder if we save this kind of character in database, and then using another program to open it (not labview), what will happen...

Anyway..I will do some more reading and test for any application using labview. Thanks for wasting your time on me KC.   Smiley Wink

Thanks a lot Smiley Happy

0 Kudos
Message 34 of 39
(2,834 Views)
and if you open the file with a better editor like UltraEdit you can see the binary data without any conversion.
 
No time wasted (I think  Smiley Wink  ) glad that it's solved


Message Edited by K C on 11-14-2007 11:17 AM
0 Kudos
Message 35 of 39
(2,830 Views)
hi...i have some problem when write multiple data to my device. If i want to write single register i will send 13 byte including slave add, function code and CRC for example 0210000600020443480000D059. I'm not sure either the query string that I send in multiple way is correct or not for example 021000060002044348000040400000D059. Is it because of the query string is incorrect so that my device cannot write the data? please view the attachments file for more details. The attachment files shows the error, query string and modbus receive frame.  thanks..
Download All
0 Kudos
Message 36 of 39
(2,802 Views)
Hi,
 
Next time please start a new thread for a new question.
 
The first string has the correct length but I get a different CRC. It is also impossible that the two examples you give have the same CRC Smiley Surprised
 
This is the string:
02 10 0006 0002 04 4348 0000 E9 53
 
02        Slave address
10        Force Multiple Registers
0006    Start register
0002    Number of registers
04        Number of transmitted data bytes
4348    data for first specified register
0000    data for second specified register
E953   CRC
 
Does this help ?
0 Kudos
Message 37 of 39
(2,785 Views)

hi..i already open new topic but no one view my question.heheh...sorry for the typing error.actually i get different CRC when i send single or multiple data .. my concern is more on query string that i send and i'm using modbus library to write multiple data. if  u see in my attachment file the data are send in an array..my problem is i not sure either the query string that i send is correct or not..because if i send more that 13byte , time out error will occured.any idea??

 

u can reply to this add

http://forums.ni.com/ni/board/message?board.id=250&message.id=34993&query.id=83281#M34993  

 

0 Kudos
Message 38 of 39
(2,775 Views)

I saw this question but there was not enough data to understand your question.

I don't use the ModBus lib. so I can't help you with this.

Did you already tried to increase the timeout ?

0 Kudos
Message 39 of 39
(2,763 Views)