LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read functions make loops take wayyy more time than they should

Hi,

I'm currently new to Labview and I'm actually experiencing a problem with my Program.

I'm using the Visa read function to read the inputs from my Lock-in amplifier.

Sadly my While-loop needs to wait for it each time meaning that each loops take more time to be done.

Any way to use a similar VI that takes less time to resolve?

By the way does VI read fuction wait for each machine input or does it simply return the old value each time it waits for a new one?

 

You'll find attached to this My VI. I highlighted the part that could cause this Problem.

Thanks for taking the time to read my message.

0 Kudos
Message 1 of 4
(2,243 Views)

Hi Lukas,

 

does VI read fuction wait for each machine input or does it simply return the old value each time it waits for a new one?

VISARead will wait as long as it needs to. It will return in case of:

- the requested amount of bytes is received

- a TermChar is found in the input stream

- an error occurs (including TimeOut)

It will (and can) NOT return any old/stale data: when the data is read from the input buffer the input buffer will be cleared…

 

I'm using the Visa read function to read the inputs from my Lock-in amplifier.

Sadly my While-loop needs to wait for it each time meaning that each loops take more time to be done.

I cannot check your VI due to its LabVIEW version, but I guess your amplifier needs some time to answer your VISA request.

What does the manual/spec sheet of that amplifier tell about communication speeds/response times?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,237 Views)

Thank you for your fast respons!

I think the problem is the communication speed of the Lock-in Amplifier.

 

0 Kudos
Message 3 of 4
(2,216 Views)

What amplifier are you trying to communicate with?  What exactly is the messaging protocol?

 

I did notice that you are not configuring your serial port.  That could be one issue.  Can't really say any more until we know the message protocol.


GCentral
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 4 of 4
(2,214 Views)