• 0
bitstre@m

VI hangs until I unplug AD2

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

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hi @[email protected],

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Hi @[email protected],

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

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

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!

Edited by [email protected]

Share this post


Link to post
Share on other sites
  • 0

Hi @[email protected],

I am inclined to agree with you; I am not sure how you would readily provide this functionality either without changing the existing VI to accept an additional input. @attila do you happen to know how this might be done for the Digilent WaveForms VI set?

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

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

 

 

Edited by [email protected]

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

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.

 

Edited by [email protected]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now