Jump to content
  • 0

VI hangs until I unplug AD2


bitstre@m

Question

Hello, 

I created a sub VI which contains a simple analog channel acquisition flow using the the AD2. I wanted to use a START and a STOP button to control its operation. However, once I hit the START button, the VI hangs and won't respond to any front panel action until I unplug the AD2 device. It's probably something fundamentally wrong with the way I am implementing it.

Any help would be greatly appreciated.

Thanks

 

Capture.PNG

Capture2.PNG

Scope Hang Debug.vi AD (SubVI).vi

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Hi @bitstre@m,

I'm not a LabVIEW expert, but should your Scope Start input on your block diagram be connected to something? I'm not sure what options are available in the VI, but there usually is a manual trigger option. That's normally done via a button within WaveForms itself, but maybe there is a way to connect it to the Trigger Source.

Thanks,
JColvin

Link to comment
Share on other sites

Hi JColvin,

After I hit the Start Button, the execution starts fine and the AD2 waits for the trigger condition.
I turned on "Highlight Execution" I noticed that execution is stopped inside the DWF MSO Read vi (see image attached) which is expected since the trigger has not arrived yet. However, I want to be able to interrupt it when I hit the STOP button but it seems like no other event has the ability to interrupt the DWF MSO Read vi (other than unplugging the AD2).

Any suggestions?

image.png

Link to comment
Share on other sites

Hi @bitstre@m,

Normally, this would be done by pressing the "Stop" button once the acquisition is going.

I'm not sure on the getting the two VIs to play nicely with each other, but it may be possible to add in the existing DWF MSO Stop.vi (which from the description is the equivalent of this button on the WaveForms application) that you can find in the source files for the VI (in the case of LabVIEW 2020, this is located for me in "LabVIEW 2020->vi.lib->DigilentWF->DWF MSO Stop). It should be on the function panel in Measurement I/O->Digilent WF VIs->MSO->Utility.

Thanks,
JColvin

Link to comment
Share on other sites

Hi JColvin,

Yes the DWF MSO Stop.vi is available but I am wondering how to use it once the DWF MSO Read.vi has been called.

It seems like once once we are inside DWF MSO Read.vi there's no way to abort or return unless all data has been read from the device data buffer.

I'm hoping there's a simple solution that someone can suggest.

Thanks!

Link to comment
Share on other sites

I'm wondering if the DWF MSO Stop.vi function would be able to stop or interrupt the DWF MSO Read.vi function if I invoke it using the same instrument handle from a structure running in parallel. Would it have equal or greater priority?

I'll wait for @attila's input.

 

Thanks

 

 

Link to comment
Share on other sites

In terms of priority, that'll depend on how LabVIEW processes it since it runs things simultaneously somewhat? I'm not sure how it works on those finer details. The main catch is that while the stop VI will complete, I imagine that when the now processed stop condition flows through the yellow error wire (presuming that is where it is stored), LabVIEW will not further process that data until DWF MSO Read.vi is completed, so unless there was a way to interrupt that flow, it may not work.

Link to comment
Share on other sites

I changed my VI and inserted a MSO Query Acquisition Status between the MSO Run and the MSO Read. I also put an event structure and a loop to check for Stop button in the same loop. This allows me to hold off on trying to read the data from the instrument until acquisition is complete and check for stop button event. 

I still can't stop the execution with the Stop button on my front panel.

I'm just trying to emulate the functionality of the Stop button in the WaveForms app, in which, regardless of the status of the MSO, you can hit stop and halt execution. This should be simple to emulate with the Digilent WaveForms VI's.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...