Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 Communication with multiple devices problem

Solved!
Go to solution

Dear all,

 

I have been working on creating a software to communicate with multiple devices with RS485 protocol. I have created my own VIs to only use VISA Open, VISA Write, VISA Read and VISA Close and no additional driver.

 

As the devices require different configurations (Baud rate, Parity, etc.), I need to open and close the COM Port each time I want to send or read something. Everything seems to work fine but after a random time of execution (may be 5 minutes, 15 minutes, 20 minutes,...), the line seems to be busy and no device can then give a positive answer until I turn off everything and restart.

 

I am using a temperature sensor (Tecon), two pressure sensors (Keller), one MFC (Bronkhorst), one gauge (Pfeiffer) and eight RS485 Relays and I am running a loop every 2 seconds to make measurements.

 

I will try to insert an error detector in each device's VI but if someone has already experienced such an issue, I would be very glad to hear some advice !

 

Thanks in advance for your answer !

 

Bests

Mathias

0 Kudos
Message 1 of 8
(4,801 Views)

to change baudrate etc, it is not always necessary to open and close the visa session.

Look inside the initialize vi to set these independently of open and close.

greetings from the Netherlands
0 Kudos
Message 2 of 8
(4,780 Views)

You mean that I should just use VISA Open at the beginning of my program and then change the configuration once I want to speak to one device in particular and then use VISA Close only at the end ?

 

Would it be more efficient or faster ?

0 Kudos
Message 3 of 8
(4,778 Views)

Hi,

 

RS-485 is not a protocol but it is the hardware layer. Your devices probably use the ModBus protocol.

Show me your basic VI and a manual of one of the devices.

 

Kees

Message 4 of 8
(4,777 Views)

Here are the examples for the Brooks MFC and for the Keller pressure sensor.

I open these VIs independently in a main VI. Please send me your remarks and thank you very much in advance.

 

Brooks RS485 manual from page 4-3

Keller RS485 manual from page 5

0 Kudos
Message 5 of 8
(4,773 Views)

Hi,

 

Had a quick look at your VI and I see two things.

 

First you are sending hexadecimal data so you should disable the termination character at the Configure port.

Second the time between write and read could be a bit short. But this depends on the performance of your device.

 

Kees

0 Kudos
Message 6 of 8
(4,769 Views)

Thank you for this answer.

 

It helps me a little more but the problem is not solved yet. I will try looking from my side.

 

Regards

0 Kudos
Message 7 of 8
(4,765 Views)
Solution
Accepted by topic author matbeg

It seems that the problem is coming from one device in particular. When I remove it from the line, everything is working fine for indefinite time.

I'll try to contact the seller and get more information about it.

 

Anyway thank you for your advice K C and Albert.Geven.

 

Bests,

Mathias

0 Kudos
Message 8 of 8
(4,745 Views)