Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

"wait until done" and "is done" on PXI-5422, Labview RT

Hello-

 

I am developing for a PXI-5422 arb waveform generator on a PXI real-time target. I am outputting a fixed waveform (~5 ms in duration) each time an external trigger is received on PFI0. I am operating in stepped trigger mode.

 

I need to be able to toggle the output on and off, i.e. make the 5422 stop responding to the trigger on command. When I turn it off, I need to complete the current cycle of the output waveform before holding at a fixed level. To do this, I inserted "wait until done.vi" before an "abort generation" vi that activates when I give the command to stop. (When I hit a button on the front panel, it activates a case on the target that goes through "wait until done" to "abort generation"). The problem is, "wait until done" doesn't actually seem to recognize that waveform generation is done  - it just times out, and then aborts generation, which can occur in the middle of a subsequent waveform.

 

To investigate further, I inserted "Is Done.vi" and hooked to an indicator. This test confirmed that "Is Done" does NOT return "Done" once each waveform has completed, while the system waits for the next trigger. 

 

From what I can tell, there is a surprising lack of information out there about the "wait until done" and "is done" vi's, so maybe I am misunderstanding what they can do. However the help file seems to indicate that they should work with stepped trigger. Is there another way to get a signal that tells me the 5422 is done generating a waveform and back to waiting for a trigger? Or a different way to shut off the response to the trigger?


I am relatively new to Labview and very new to PXI and real-time, so I appreciate any assistance.

 

Thanks,
Steve

0 Kudos
Message 1 of 8
(7,564 Views)

Hey Steve76,

 

How often are you receiving external triggers into your PFI line? Also how long of a duration is your "Wait Until Done.vi" set for?  I'm still looking into this for possible reasons the VIs wouldn't for work correctly for you.

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 2 of 8
(7,535 Views)

Hi DavidP-

 

Thanks for replying. I have generally had external triggers coming in the PFI line at 70 Hz, or ~14 msec intervals, but I tried slowing it down significantly. I played with the timeout value on "Wait Until Done," trying from around 20 msec up to as much as 2000 msec.

 

I have been able to do something similar using scripting, but I would like to be able to do this without resorting to scripting as well.

 

Thanks for your help,

 

Steve

0 Kudos
Message 3 of 8
(7,532 Views)

Hey Steve76,

 

From my experience, this type of scenario where we would want to use scripting.  To do the functionality you're wanting, scripts will be the easiest way.  Is there any reason why you're wanting to not use them?

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 4 of 8
(7,509 Views)

Hi DavidP-

As I have learned about scripting I agree that this appears to be the way to go. So this concern has become less important to me. Still, it would be good to know whether I am misinterpreting what these functions are supposed to do?

Thanks for your help,
Steve

0 Kudos
Message 5 of 8
(7,507 Views)

Hi Steve76,

There is an error in the documentation that I think is the cause of your confusion. Wait until done and Is done will not work with a stepped trigger. The reason for this is a stepped trigger is essentially a repeat forever statement constantly monitoring the trigger signal and therefore will never be “done”. If you use a signal trigger then you will notice that the Vis should operate as expected. I hope this clears things up and I have filed a corrective action request to correct this error. I apologize for any inconvenience it has caused. I also agree that scripting will most likely be the best solution to your issue. Please let us know if you have any trouble writing the script to accomplish this task and we will be more than willing to help out. 

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 6 of 8
(7,491 Views)

Hey Steve76,

 

Our FGEN cards have a total of five states, Idle, Done, Generation, Wait for Trigger, and Hardware Error.  What the Wait Unitl Done.vi and Is Done.vi functions do is block other operation and wait for the card to reach a Done state or check to see if the paramter for Done has been set by the card, respectively. If you look in the FGEN Help file found in Start>>All Programs>>National Instruments>>NI-FGEN>>Documentation and to go the location NI Signal Generators Help>>Devices>>NI 5422>>Theory of Operation>>Hardware State Diagram, you'll find a section describing the Done state.  Here in the second sentence it mentions that this state only occurs at the end of a Generation state configured for Single trigger mode.

 

Aborting the generation (which you aren't doing due to you wanting to complete the current cycle) will take the card into an Idle state which will not have the correct parameter set to true for the functions to recognize.

 

Similar to DAQmx's function calls the Wait Until Done function is a blocking function that will continuously poll the parameter until it's true or times out.  The Is Done function will only check the parameter, return its values, and then allow the computer to pass and continue with the program.

 

I hope this information clarifies some of your questions.  Let me know if you need more information.

Thanks,

Message Edited by David P. on 04-15-2009 10:15 AM
David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 7 of 8
(7,488 Views)

JaceD and DavidP-

Thanks for your help. I will pursue the scripting approach.

Steve

0 Kudos
Message 8 of 8
(7,476 Views)