LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make the loop works for one time even if the enable or the boutton still on

i want to run the program inside a loop for one time and end the loop even i stil pressing the condition button or enable button and redo the program in loop when i release the button and press it again ?
any help 

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

I read that four times and have no idea what you are asking.  Perhaps post some code with a description of how you expect it to work?

0 Kudos
Message 2 of 7
(2,924 Views)

@AlyMagdy wrote:

i want to run the program inside a loop for one time and end the loop even i stil pressing the condition button or enable button and redo the program in loop when i release the button and press it again ?


Make the "condition button" latch when released and it will only be true until the value is read once by the code, then revert to false automatically.

 

More complicated scenarios might require a shift register that maintains state.

 

Please show us a simplified version your VI, tell us how you use it, what happens, and what you expect to happen instead.

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

i'm trying to send data sequently , the problem is when press send the data sends and repeating the sneding data until i release the send button.
i want to send the data if i presse send for one time even i still pressing send and send it again if release the send button and press it again

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

Hi,

 

your image shows just a bunch of race conditions and RubeGoldbergs.

But I don't see any "press send the data" button…

 

Maybe you post the VI related to your question?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(2,901 Views)

I agree with everything Gerd said.

 

  • Is this a subVI are are you using "continuous run" mode?
  • What is the point of your local variables? Reading a local variable and wire it to it's own indicator in just pumping hot air. Obviously you have no idea what a local variable is.
  • What is the point of your sequence structure? Execution is fully determined by dataflow alone.
  • Why do you have three case structures if all depend on the same value. You could put all code into one. Since they only depend on a diagram constant, you can event delete them.

I recommend to start with some basic LabVIEW tutorials.

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

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 7
(2,864 Views)