From 08:00 PM CDT Friday, August 12 - 01:00 PM CDT Saturday, August 13, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic problem with timing 1 DO

Solved!
Go to solution

Hi everyone,

 

I am using a 6229 PCI card and Labview 8.5 with XP.

 

 I need to generate every 10 secs a Digital Output that is  low for 3 secs low and high the rest of the time. I have attached the VI that works fine with my previous values (500 ms and 2000 ms). However I get a low state for 1 sec, 2secs or 3 secs but not continously 3 secs when I used it with the 3secs/10secs values.

 

It works if I use the values 3secs/15secs  (15 secs or higher).

 

There must be a problem with my looping but I don't understant what the problem is, since the outside loop should be waiting for the inside loop to finish before starting a new loop. I don't get why my low state time is affected by the exterior time loop...

 

This is probably a basic pb for you, but any help would be great,

 

Regards,

 

Marc 

0 Kudos
Message 1 of 4
(2,659 Views)
Solution
Accepted by topic author marc france

It seems overly complex. Below is an alternative. I used the Delay function since it has the error in/error out connections to enforce data flow. I also changed the type of DAQmx Write since you seem to be only writing to a single line.

 

Message Edited by Dennis Knutson on 11-20-2008 09:03 AM
Message 2 of 4
(2,654 Views)

Hello.

 

The best solution is to use a counter rather than a digital out line, and to set a frequency of 0.1Hz and a duty cycle of 0.7 . You would have in this case a better timing accuracy for your generated signal.

 

Regards

 

Message Edité par mehdi.afif le 11-21-2008 08:27 AM
Message Edité par mehdi.afif le 11-21-2008 08:28 AM
Message Edité par mehdi.afif le 11-21-2008 08:29 AM
0 Kudos
Message 3 of 4
(2,636 Views)

Hi Dennis and Mehdi,

 

Thank you for your help. Dennis, you solution works out fine and I will use it. However, if anybody could tell me why my VI has this strange behaviour. I would like to understand what  the problem is.....?

 

Mehdi, I know the 2 output counters are more accurate, but I don't need any very accurate outputs for the moment. I prefer to leave them available in case I need them in the futur.

 

 Best regards,

 

Marc 

0 Kudos
Message 4 of 4
(2,614 Views)