LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop stop based on instrument operation complete

I am trying to measure voltage and frequency data on my PXI while sweeping a voltage using a Source-Meter Unit (Keithley 2450).

I am unsure how to best sync up the data I get from the Keithley and that I measure with the PXI.

 

I am using some internal programs on 2450 that steps through a series of voltages and I want to be measuring other system variables (voltage and frequency) during the sweep. The Keithley provides canned VIs to interact with the 2450 over a USB connection. I have included a screen shot of VI am I modifiying. I want to start the DAQ assistant voltage measurements at approximately the same time as the 2450 gets the "Innitiate" command (the little green VI icon). The Icon with the green flag is a "Wait for operation to complete." The program holds up there until the 2450 tells the PXI that the sweep operation is complete.

 

The main problem I am having is that I am not sure how to exit the while loop that needs to surround my voltage measurment DAQ assistant block based on the excecution of the "Wait for operation to complete" block.

 

I hope I am explaining this well enough. My screen shot might help.

Thanks for any help you might be able to provide.

0 Kudos
Message 1 of 5
(2,456 Views)

ViSnippet.png This might work. ?? pass the error to the while to get it to run immediately after your stop light thing, then, each iteration of the loop checks the boolean, that you are setting within the OPC VI. I used VISA VIs in place of your stoplight & OPC icons.

0 Kudos
Message 2 of 5
(2,420 Views)

This could work and I had thought of maybe using somethign similar. I hadn't thought of using the error line to start the loop. Thanks. Doesn't the local variable (boolean) need to have an initial value? I guess I don't understand how the boolean can be initialized by one part of the code and then updated by another. Could you explain that to me? Thanks!

 

0 Kudos
Message 3 of 5
(2,407 Views)

Yes, you wouldn't want to start the loop with a true value, or the loop would only execute once. What is in the guts of your VI that you want to finish to stop the loop? (the one wired to the right of the stop sign VI)

The point is that you have to import something from that exterior scope, into the loop that indicates, "task in the galaxy far away is done"

0 Kudos
Message 4 of 5
(2,396 Views)

A notifier would be appropriate for this situation.

0 Kudos
Message 5 of 5
(2,385 Views)