From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

start and stop of a program

Solved!
Go to solution

hi everyone

 

i modify a bit the pulse and transition Vi. i aquire a signal from DAQ instead of a sign wave, now i want to control the input data by means of a start stop button i found, 

but the problem is that it is not working, i also want to start the program for 5 seconds after pressing the start button and then it should stop automatically after 5 seconds.

i am posting my vi, looking forward for suggestions  

thanks

 

 

0 Kudos
Message 1 of 17
(4,963 Views)

I suggest You use the Elapsed time VI as you do't want to hang your application for the period of 5 sec. When the Time Elapsed fires you just stop the application.

Of course you have to add some additional logics that ignores the Elapsed time signal unless the button is pressed, and of course you have to reset the Elapsed time VI when you press the button.

 

Regards,

Marton

NI Hungary 

Message 2 of 17
(4,951 Views)

thanks for the suggestion  Marton  i did the same  as  u mentioned  but i still have a problem  i want  that  i  can  aquire  signal as much as  i want suppose if i  want to get  the  data for 6  seconds then it should  stop after 6 second . 

now in current senario when i press start button to for aquireing signal and stop after few seconds it didnt stop and continue for 3 seconds and then stops i dont understand why?

and when i set the target time it seems to me that it has no function, can u plz help me out of this situation 

thanks

 

0 Kudos
Message 3 of 17
(4,927 Views)

Dear hussain,

 

I'm sorry I think I don't have the idea.

So my understanding for the application:

  1. You press the Start button
  2. The data acquisition starts
  3. If you don't do anything it automatically stops after 5 seconds (or any predefined seconds)
  4. Otherwise if you press the stop button it should be stopped immediately.

Is that correct or you want to do something different?

Anyway the usage of the Elapsed Time is not 100% correct but we may discuss it after clarifying your goal.

 

Regards,

Marton

 

0 Kudos
Message 4 of 17
(4,916 Views)

you r right exactly that what i mean. 

 

if i start it should aquire data for define time in seconds preferably in milliseconds

and if i want to stop it before the defined time, i can press the stop button so that it has to stop immediatly.

 

and please guide me if i am wrong to use elapsed time vi

 

looking forward for ur kind advice

 

best wishes

hussain 

 

0 Kudos
Message 5 of 17
(4,907 Views)
Solution
Accepted by hussain

Dear hussain,

 

In order to make things as easy as possible I created a simple example that can be used as a template for your application.

 

The application itself is basicly two parallel running loops. The upper one is for event management, the lower one is a statemachine.

In this application if you press start then the application won't exit just go idle so you can press start again.

 

Should you have any questions please tell me!

 

Regards,

Marton

Message 6 of 17
(4,891 Views)

Thankyou very much marton , i  will  try to  run my program with this and if i got some problems i will ask you again if u dont mind.

 

regards

hussain 

0 Kudos
Message 7 of 17
(4,873 Views)

Hi,

The solution to this question seems like it could help me, but im using labview v8.5,

is it possible for you to up load the file which would I would be able to open in this version.

 

Thankyou

Daleel

0 Kudos
Message 8 of 17
(4,786 Views)

Dear Daleel,

 

I back-converted the VI to 8.5. see the zip attached 🙂

 

 

Hussain,

 

Should you have any questions please feel free to ask!

 

Regards,

Marton

0 Kudos
Message 9 of 17
(4,764 Views)

Dear Marton

 

Thankyou so much, however i dont thing the new file was attatched, could you reattatch it 🙂

 

thanks for your help

 

Daleel

0 Kudos
Message 10 of 17
(4,741 Views)