Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Read

I just did some major cleaning up of your code.  The major changes were to make an event for handling each of your commands.  A Timeout event was added to do the reading of oscilloscope data, an Array Value Change event was added for sending the switch data, and a Stop Button Value Change event was added for stopping the main loop.


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
Message 11 of 14
(2,213 Views)

Now the explaination.

 

when run nothing would happen until an event fired.  then the case structure took over but no events will be processed until the while loop completed.  which won't happen until you change the tab.  the code isn't "Bad" but very strangely constructed. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 14
(2,198 Views)

Thanks for Help...Still i want to know what was problem in my previous code??

0 Kudos
Message 13 of 14
(2,175 Views)

@piZviZ wrote:

Thanks for Help...Still i want to know what was problem in my previous code??


Bad architecture.  Likely race conditions due to the use of local variables.  Sending data through the serial port even though nothing changed (this is most likely your culprit).


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
Message 14 of 14
(2,168 Views)