 anouardz
		
			anouardz
		
		
		
		
		
		
		
		
	
			03-18-2015 11:23 AM
Hello,
I want to execute a loop in 1 second then a second loop for 1 second and that's repeated before pressing the button stops. if you can give me some examples it will be better.
Solved! Go to Solution.
 Michel_Gauvin
		
			Michel_Gauvin
		
		
		
		
		
		
		
		
	
			03-18-2015 11:33 AM
Can you give us more detail on what you are trying to accomplish?
03-18-2015 11:41 AM
I want to read and save in tdms file the analog input A0 for 1 second and the analog input A1 for 1 second in daq 6008, but not simultaneously. and that's repeated before pressing the button stops
 VItan
		
			VItan
		
		
		
		
		
		
		
		
	
			03-18-2015 11:42 AM
Something like this?
This is the best I can do without more information.
03-18-2015 11:46 AM
this 3 loops, are they a while loops?
 ben64
		
			ben64
		
		
		
		
		
		
		
		
	
			03-18-2015 11:57 AM
03-18-2015 12:08 PM
yes, but not simultaneously
03-18-2015 12:08 PM
yes, but not simultaneously
 Dennis_Knutson
		
			Dennis_Knutson
		
		
		
		
		
		
		
		
	
			03-18-2015 12:17 PM
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			03-18-2015 12:19 PM
@anouardz wrote:
yes, but not simultaneously
You should always quote the previous post, because it is not clear what you are replying to.
A state machine is the correct architecture, only one loop needed. Simply switch states every desired time interval.
Don't gum up the gears with loops inside loops, etc. It makes the code hard to manage and hard to add functionality later and hard to branch out in case of problems or exceptions.