Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS-RTU connection with aleatory VISA communication fails

Hi everyone,

 

I have a big problem that I'm trying to repair since a pair of months. I have a MODBUS gateway connected to my pc via RS-485 in RTU mode. The physical implementation is based on Ethernet cable, so I have two connection converters in both endings of the Ethernet cable that wire each line to its corresponding terminal in a RS-485 connector. On the side of the PC i also have an electronic card to convert RS-485 to USB for connect using a USB port for pc's connection. That card is the model USB-COM485-PLUS1 from the company FTDI chip. I have installed on my PC the drivers of the card that configure a virtual COM serial port for my RS-485 communication. On labview I have programmed my interface for communication using a MODBUS library that was installed previously on my PC (I am using my company PC, because i have this problem on my workplace).

 

The problem is that, usually, my system works correctly, and the communication is perfect. I read always the holding registers of my gateway, and i can write the control registers without problems, but, some times, the connection spend more time without communication that reading, and after some hours in that conditions, it fall in continuous fail and doesn't work any more since the next day. That problems persists even if i restart the PC or shut it down for a while. By the other side, I realized that when the communication falls it only fall on the reading wire, because even if the reading communication is with continuous fail, i can write on the corresponding registers of my gateway.

 

I'm sure at 80% that the gateway runs correctly, and I have other installation similar with the same gateway, cable, connections and card working correctly. I tried changing the Ethernet cable, changing the RS-485 to USB conversion card and only when i changed my PC, the problem disappears. So I thought it was a problem of the PC. But some time after I changed the PC, the problem returned. After this, I continue making probes and actually I have the theory that it may be a problem because i have other communications running at the same time in my labVIEW app. I think it may be a problem of incompatibility of drivers or a bridge over different communications that make it fail. Because the pc's where this error disappear has not installed NI RIO drivers.

 

My LabVIEW program also have a communication via Ethernet with a NI cRIO 9076 chassis. That chassis has a module for PROFIBUS communication, also has a module for thermocouple inputs, a module for voltage inputs and other for voltage outputs. All this modules work correctly always. My theory is that some of this other modules in NI cRIO 9076 chassis may cause a conflict that make my system works wrong. Other things that seems me annoying is that i bought recently a new conversion card for RS-485 to USB connection and it doesn't works on my system, I have other two identical cards and they work correctly, and i know that the new card works also in other systems i have.

 

The issue I don't understand is that this problem doesn't happend many times and it seems to be aleatory... The fail that the labVIEW return when it can not read the holding registers is a timeout error because of a frame error. It would be illuminating for me if that error where periodic or systematic, but occurs only a day every two or three weeks and the rest of time works properly. But on my company, when this installation will work continuously, it can't have any day of non-work.

 

So, please, I need help with this Issue, I'm lost int he way of resolving it. Thanks only for read this large post. 🙂

 

Regards, 

 

Joaquín

 

 

PD: Please, don't damn my English, it is not my mother tongue, I'm spanish.

 

0 Kudos
Message 1 of 5
(3,745 Views)
The first thing to check is whether Windows is set to save power mode for the usb port. This must be disabled. The other thing I would suggest is using a good, powered usb port.

I don't see how the Ethernet connection to the cRIO can intefer.
0 Kudos
Message 2 of 5
(3,725 Views)

First of all, thanks for your quick reply.

 

I had the USB port save power mode enabled. I have disabled it. Actually my system works correctly so I can't know if the problem has been solved, but i have a new converter card for RS-485 to USB and it doesn't works, i have other two that work properly but the new only writes, just like when i have the problem commented. So, I think that if i solve the problem with the new card, i can be sure that I will have solved my connection problem. The new card is configured with the same options that the others, except by the port number, i configured COM 3, COM 4 and COM 5 respectively.

 

By the other side, when I said that I think cRIO interferes in MODBUS communication I mean that the only things that changes in PC's that correct the problem are that they have not installed the FPGA module or the RIO drivers. And once i changed my PC, the problem was solved since I installed this module and drivers, moment when the problem reappeared.

 

Thanks again 😉

0 Kudos
Message 3 of 5
(3,703 Views)

Please, the problem is happening often in the last days, I need a solution and I'm really lost, any one can help me?

0 Kudos
Message 4 of 5
(3,677 Views)

Hi MaSaKaBes ;

I hope that ur prob has solved 

I have the same project that you have.

 

here you said 

"On labview I have programmed my interface for communication using a MODBUS library that was installed previously on my PC

my question is - in this case we use visa fonction to read and write the data or the modbus ? and if we use the visa how can we can  get to code fonction "the holding register" ? if not how can I use the modbus to program my labview interface ? 

 

plz I need help 

I'm under pressure of time I have to post my projet to take my graduation 

 

0 Kudos
Message 5 of 5
(3,550 Views)