11-12-2007 02:20 AM
It depends how you want to handle your data. As long as you know it is not ascii and you know.
I was wondered about the spaces (0x20) in the ModBus frame. I would not expect it at these positions. Can you show me what you send or are you using the ModBus lib from NI to create the ModBus frames
11-12-2007 02:41 AM
11-12-2007 04:18 AM
It's a bit strange that the 0x00 are changed into 0x20 and that the CRC bytes at the end are correct for 0x00 data.
If the software in your micro is a ModBus slave then you will not get an answer because the CRC is wrong because the 0x00 bytes are changed into 0x20.
Even if you get the data OK the command I don't think the command frame is OK. At least for the ModBus things I know.
I think the data is 1 byte to long. Beside that the length of the requested data is zero (two bytes before the CRC)
I never used the ModBus lib from NI because I use my own (dedicated) VI's for the ModBus communication.
Do you think you can get any further at this moment ? If not you can always try to make a simple com VI that send 1 command and displays the return data.
11-12-2007 09:33 PM
11-13-2007 01:50 AM
It’s not clear to me want you want to do with this VI.
It appends the ‘cheat modbus string’ to the value of the shift register and displays it in the ‘string display’ indicator. So the string in your indicator gets longer and longer until you stop the loop.
You don’t see it because the indicator is too small !!
I think to get further we are going to try something else. Do you know if your micro supports the ModBus loop-back command ?
Or do you have a file with the supported ModBus commands ?
11-13-2007 02:08 AM
11-13-2007 02:34 AM
OK, I understand. From what you show me I cannot understand why the 0x00 are changed into 0x20 while the other bytes remain the same.
I need to know more about what is done with the received data.
11-13-2007 03:13 AM
Me as well. I can't understand either why 0x20 keep showing up. Right now I'm testing the modbus program with a power meter. There's no point if I can display a correct modbus response at the front panel but after write to txt file..it shows something else. I must log every received data anyhow in my application. Where do you think the problem is? If there's something wrong with modbus frame that I send or receive, then why still I get 0x20 even just sending a simple string (display in HEX) from LV?? Is this only happen in my labview or something else...
I'm confused...Let me know what you think ok... ![]()
11-13-2007 05:17 AM - edited 11-13-2007 05:18 AM
Is possible that some VI's are set to ASCII where it should be RTU ?
Just to get things clear, in the last VI you showed you write 0x00 and read back 0x20 ?
11-13-2007 07:17 PM