Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

changing pulse train rate of GPCTR on 6025E

For the 6025E, I want to configure the GPCTR1 as "pulse train" with user entered variable frequency between 1 and 5Hz. I have done this, but my question is:

Will there be any problems if i try to rapidly change the pulse rate? In some cases, I will be at a "border" which may cause rapid changing of the pulse rate (eg between 4.1 and 4.2Hz)

I have a pulse that is high for 5 ms, and low for between 495ms and 195ms (i.e. high for 5ms, repeated at a user-variable rate between 1 and 5Hz)

-Does the GPCTR allow the "old" pulse to finish its complete cycle (high and low) before starting the "new" pulse, or does it just immediately start outputting the new pulse?
I am worried that if the pulse does not have a chance to
finish the relatively loooong "low" portion, I will end up with the GPCTR sending a series of many pulses immediately after the other, when really I wanted the old pulse's low cycle to finish before starting the new pulse

here is my code (NI_DAQ calls summarized with only the important parameters shown), which is called at every frequency change

changePulse() // called everytime the user updates the pulse
{
-GPCTR_Control( ND_RESET ) // stop the old pulse
-GPCTR_Set_Application( ND_PULSE_TRAIN_GNR )
-GPCTR_Change_Parameter( ND_COUNT_1, low ) // set the low period
-GPCTR_Change_Parameter( ND_COUNT_2, high ) // set the high period
-Select_Signal( ND_LOW_TO_HIGH ) // to output the pulse on the pin
-GPCTR_Control( ND_PROGRAM ) // start with the new pulse
}
0 Kudos
Message 1 of 3
(3,493 Views)
Yes, NI-DAQ will allow the current pulse to finish before loading the new pulse specs. The only problem you may run into is that the new pulse specs may not get loaded fast enough and another pulse at the old rate may begin.

Brian
0 Kudos
Message 2 of 3
(3,493 Views)
thank you! that is what I was hoping you would say!
0 Kudos
Message 3 of 3
(3,493 Views)