Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Arduino: timeout error from Visa Serial write

Solved!
Go to solution

Arduino: timeout error from Visa Serial write

I am using Arduino Mega 2560 to control 16 solenoid valves by ON/OFF 16 relays.
The VI operate very well on my laptops (Samsung I5-7200U and Acer I3-2330M) but unstable on PCs (Core duo).  After a few iterations, time-out error (1073807339) has appeared. I tried using both LIFA and LINX, but this error still occurs.
That problem does not occur when I disconnected loads (solenoid valves) to the circuit.

I attached the VI.

 

0 Kudos
Message 1 of 7
(289 Views)

Re: Arduino: timeout error from Visa Serial write

Are the solenoids DC powered? If so do they have built in snubbers or diodes to quench the back EMF voltage spike when they are turned off? I mention this because you state it works fine when the solenoids are disconnected. Also wonder if you have a ground loop since the laptop (floating from AC mains) works but the PC's do not. May be a shot in the dark but worth mentioning.

 

Can you supply make/model of solenoids and a sketch of how things are wired up?

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 2 of 7
(260 Views)

Re: Arduino: timeout error from Visa Serial write

Hi. Thank you for your fast reply.
My solenoids use 24 VDC power. Model: SMC 10-VQ1200Y-5.
I uploaded the circuit diagram.

0 Kudos
Message 3 of 7
(253 Views)
Highlighted

Re: Arduino: timeout error from Visa Serial write

The LV application works well without the solenoid attached, so there is no problem with the code.

You have to narrow down to the electrical circuit and HW connection problem. 

 

It seems that this post is similar to your problem.

Large load (solenoid, chiller, heater, etc) activation/deactivation kills LIFA USB communication. Wh...

Message 4 of 7
(251 Views)

Re: Arduino: timeout error from Visa Serial write

I'd try putting some reverse biased diodes (ie 1N4004) across each of the solenoid coils first.

Not sure of the spec's on your relays, they may need some also.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 5 of 7
(234 Views)
Solution
Accepted by topic author atupha
01-16-2019 11:55 PM

Re: Arduino: timeout error from Visa Serial write

The problem has been solved by adding a ceramic capacitor to each relay. 
Relay module has built-in capacitors, diodes, and optoisolators. But it seems that is not enough.
When the load is connected to the circuit, the arc generates at the contact each time the relay is turned on / off. 
Then Arduino is reset, leading to a disconnection from the computer.

The laptop's USB port seems to filter noise better than PC.
I'm not sure about these things but my system has been working well anyway.
Thank you very much for your help.

Message 6 of 7
(188 Views)

Re: Arduino: timeout error from Visa Serial write

Good detective work, I did not even consider contact arcing. Alternative is to use Solid state Relays for the solenoids.

 

-AK2DM

 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 7
(173 Views)