LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output a value F until an Event Occurs

Hi, 

Can we receive a value F until an Event occurs without using Loops.

 

regards,

0 Kudos
Message 1 of 7
(2,706 Views)

Sure.  I guess.  Receive an "F" from where?

 

Why do you say "output a value" in your title, and "receive a value" in your message?

Message 2 of 7
(2,677 Views)

actually i have two blocks of DAQAssitant  in series generating N pulses (30K) with HI/lo time of 1m, 50% duty cycle.

program is running normal 

but the issue is when user want to stop at the mid of run time, the problem arises that it cannot stop until 1st DAQblock generates all samples.  

So my next approach is to at least stop one block after finishing its task when user presses STOP button.

without Loops is my priority.

thanks

DAQassStop.PNG

 

0 Kudos
Message 3 of 7
(2,668 Views)

I used event structure to solve the issue above. please have a look

0 Kudos
Message 4 of 7
(2,667 Views)

Nothing attached.

 

But I'm thinking you will be far better off if you ditch the DAQ Assistants and use the regular DAQmx functions.  I don't work with counters, so I don't know exactly how you'd do this.  But in general, DAQmx tasks can be set up so they are started, and you can loop to check if they are done, or stop them if you want before they are done.

 

Look in the Example Finder for numerous DAQmx examples.  One or a few of those should show you what you can do.

0 Kudos
Message 5 of 7
(2,662 Views)

attached here

actually i have two blocks of DAQAssitant in series generating N pulses (30K) with HI/lo time of 1m, 50% duty cycle. program is running normal but the issue is when user want to stop at the mid of run time, the problem arises that it cannot stop until 1st DAQblock generates all samples. So my next approach is to at least stop one block after finishing its task when user presses STOP button. without Loops is my priority. thanks

 

DAQassStop.PNG

 

0 Kudos
Message 6 of 7
(2,654 Views)

You need to go back to the tutorials and learn about dataflow. You code makes absolutely no sense.

 

  • Why is there a local variable if the terminal is right there?
  • Your terminal (and local variable) is read once right after the start of the program and then never again. If you want it to be read after the first express VI has executed, the terminal needs to go inside the sequence frame (which currently does nothing!).
  • Learn about state machine architecture. There are plenty of design templates and examples.
  • Learn about mechanical actions of boolean controls (switch when pressed is probably not right in your scenario)
  • Learn about lower level functions instead of express VIs.
  • you said you are using an event structure. I don't see it.
  • ...
Message 7 of 7
(2,649 Views)