04-24-2009 09:34 AM
Hi guys,
If I use on board serial port, modbus query and recieve seems OK but when I use multiple RS232 I/O serial card, the modbus frame is showing a wrong response. I checked on communication settings and everything is the same. Do you have any idea what's happening here? I reinstall the driver also cannot work.
Appreciate your ideas.
Thanks.
04-27-2009 09:05 AM
Hi,
What do you mean with 'a wrong response' No data, wrong data, wrong crc. Please tell us what you expected and what you received
04-27-2009 09:19 AM
Hi KC,
Thanks for replying. I guess wrong CRC. I get less byte received and wrong modbus function.
query: 01 03 00 00 00 03 05 CB
recieve: 01 20 10 00 00 00 48 F7
sometimes I get the correct one : 01 03 06 00 00 00 00 00 00 21 75 . But most of the time is wrong. At first I thought it's because of the card driver but using another device seems OK.
Thanks
04-27-2009 09:31 AM
Yes, you are right.
The received string contains another MB function and the CRC is wrong (should be 0x84 0xCD)
As far as I know 0x20 is a dedicated command. So you should check the manual of your device.
But what this got to do with using another RS-232 device ??? I don't know.
04-27-2009 09:40 AM
Hi KC,
This I/O module that we get false string don't have 0x20 function. And this wrong response only happen if we use PCI RS-232 card with multiple I/O ports. If we use PC on-board port, this doesn't happen.
So to make sure that is there something wrong with the PCI card, we tested the PCI card with another device. But that shows fine.
Thanks.
04-28-2009 05:24 AM
OK, Your device looks OK because it works connected to another interface
Your PCI RS-232 card looks OK because you tested it with another device. Also a MB device ??
And, on top of that , occasionally the return data is OK !!
The wrong reply looks like a MB frame but the command does not exists and the CRC is wrong. So we can say the data looks like rubbish.
Am I right this far ?
What language are you using, LV ?
05-03-2009 03:53 PM
Hi,
Yes KC. You're right. I'm using LV 8.2. We also tried using another RS485-RS232 converter and still doesn't work. From my point of view, if on-board com port giving us the right modbus string, there must be something to do with the compatibility of the equipment with the PCI card. Is it possible? I thought the card port should be straight forward.
Thanks.
05-04-2009 02:00 AM
Hi,
It looks like the hardware is giving you trouble, but I am still not convinced that the HW is the real problem. But I have to admit I also can not see the what might be wrong if I look at the data.
Can you post the VI's (or a sub set) that you are using. Or do you use the MB lib from NI ?
Can you try a loopback command. Every MB device should support this. Maybe this will give more information to solve this.
05-04-2009 05:26 AM
Hi KC,
Attached is the program. Yes I'm using Ni modbus library. The I/O card(HW) is only using the 1st 8bit in the 1st register. I also tested with other modbus tester program but the response is the same.
Thanks.
05-04-2009 06:13 AM - edited 05-04-2009 06:13 AM
Hi (I still don't know your name),
I modified your program and added a loopback command. See the Read/Write enum. Can you try this.
It sends 01,08,00,00,AA,55,5E,94 the same dat is returned. 01 = slave add., 08 is loopback command, 0000 is testcode, AA55 is random test data and 5E94 is CRC.
First see if this works.