Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write error Arduino after hours of execution

Solved!
Go to solution

Hi,

 

I'm currently working on a test bench project involving 3 serial communications and one USB communication (USBTMC). I'm using a state machine model.

One of the steps of my state machine is to send a char to my Arduino by serial port to commute a relay.

This operation is done approximatively each 30 seconds. 

I'm using very basic VISA write, and still, randomly i've got a VISA write timeout after hours of executions. After that the Arduino do not response any more, the only thing i can do is to close the visa and reopen the visa communication. Then it works again.

 

The solution i get for the moment is to do a specific error handling that closes the VISA and reopen it. It works but i would like to have a clue on what is happening. I'm not satisfied with this patch.

 

I tried to run this step of the state machine in a while loop until I have the error, but i never happens. So maybe my error is coming  from my other serial communications. 

 

Have you ever experienced a similar problem ? do you have a clue on what i could be ? 

 

Have a great day,

 

Nicolas L

 

 

 

 

0 Kudos
Message 1 of 6
(3,542 Views)
Solution
Accepted by topic author nlefoulon

Your computer may be putting your USB ports to sleep after a few hours of inactivity. Maybe try messing with your Windows power settings.

0 Kudos
Message 2 of 6
(3,487 Views)
Solution
Accepted by topic author nlefoulon

Sounds like USB selective suspend power settings causing issues.

See links in - https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/VISA-Limitations-Number-of-Instruments-Type-...

0 Kudos
Message 3 of 6
(3,481 Views)

Thank you for your precious advice, i'm trying this out. I'll let you know if my problem is solved 🙂. Actually my usb port should be active at least once each 1 minute. The cycle of my state machine last about 1 minute.

0 Kudos
Message 4 of 6
(3,473 Views)
Solution
Accepted by topic author nlefoulon

@nlefoulon wrote:

🙂ctually my usb port should be active at least once each 1 minute. The cycle of my state machine last about 1 minute.


I have found that not to matter.  Windows will randomly decide what to turn off whatever it wants unless you turn off the USB suspend.  You should also go through the device manager and specifically turn off the power setting for each USB hub.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,446 Views)

Ok it's good to know that. I've checked, it was already on "off".

 

I've been running my test bench for the whole day, i haven't got any problems for the moment !

Thank you all for your help.

0 Kudos
Message 6 of 6
(3,439 Views)