Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Illegal modbus response from serial card

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.

 

0 Kudos
Message 1 of 24
(5,375 Views)

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

0 Kudos
Message 2 of 24
(5,348 Views)

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
0 Kudos
Message 3 of 24
(5,344 Views)

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.

0 Kudos
Message 4 of 24
(5,341 Views)

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.

0 Kudos
Message 5 of 24
(5,339 Views)

 

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 ?

0 Kudos
Message 6 of 24
(5,309 Views)

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.
0 Kudos
Message 7 of 24
(5,243 Views)

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.

 

0 Kudos
Message 8 of 24
(5,224 Views)

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.

 

Download All
0 Kudos
Message 9 of 24
(5,211 Views)

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.

 

Message Edited by K C on 05-04-2009 01:13 PM
0 Kudos
Message 10 of 24
(5,205 Views)