LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slow Execution

I want to execute my vi slowly as it run in normal space it doesnt run properly .

It works fine when i run it with highlighter on.

Whats should i do to slow the pace of the execution?

Boldness has genius, power and magic in it!'
0 Kudos
Message 1 of 3
(2,392 Views)

Are you running this VI with the Run Continuously button?  Do not do that.  You should have a while loop.  Based on what I can see, I would suggest using an event structure inside of a while loop.  On the Boolean value change event, send your command and read the response.  Also have stop button with an event case to stop the while loop.

 

The reason for this is that you should only setup your port once at the beginning of your program and close it once at the end.  If you are using the Run Continuously button, you are opening/configuring and closing your port constantly.  This is bad.

 

Also, you will want to add a small delay between when you send your command and when you read the response.


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 2 of 3
(2,385 Views)

What you need is a delay between the write and the VISA Bytes at Serial Port. That wait you have in there does nothing to give the instrument time to respond. However, since it appears that you are sending a termination character after the 'Ver' command, you should probably set the VISA Configure Serial Port to use the same termination character and not use the VISA Bytes at Serial Port at all. The VISA Bytes at Serial Port and a delay is usually just a hack that can be eliminated with more elegant programming. With a termination character enabled, you specify some high byte count and the read will wait until the character is detected and then automatically terminate. With a delay, you'll be constantly fiddling with it to find the correct time to wait or have a delay that is too long and just wasting time.

0 Kudos
Message 3 of 3
(2,384 Views)