10-11-2011 08:58 AM
I've picked up some old traditional DAQ code and can't tell what the sequence actually does. My main question is what effect, if any, do the statements following the first GPCTR_Control(..., ND_PROGRAM) have?
Reset counter 0: GPCTR_Control(iDevice, ND_COUNTER_0, ND_RESET)
Set Application: GPCTR_Set_Application(iDevice, ND_COUNTER_0, ND_SINGLE_TRIG_PULSE_GNR)
Use several "GPCTR_Change_Parameter" calls and one "Select_Signal" call to set up timebase, gating, outputs, etc.
Arm counter: GPCTR_Control(iDevice, ND_COUNTER_0, ND_PROGRAM)
All is well up to this point. But then these calls are performed. Are they ignored because the counter is already armed? Or do they perform their normal functions?
Reset high and low counter counts using "GPCTR_Change_Parameter"
Change where output pulses occur with "Select_Signal"
Re-Arm the counter: GPCTR_Control(iDevice, ND_COUNTER_0, ND_PROGRAM)
Thanks for any help you can offer. Ed Perkins
10-12-2011 03:35 PM
Hey Ed,
Have you tried running the code to see it works? If there is no error returned, then these commands run and most likely do something. Once you arm the counter, you can change certain parameters about it (like frequency, duty cycle, etc), but you just can't change what the terminal the counter is coming out of, or other hardware related parameters. So the only thing that may give you an error is if you are trying to change which line the counter output comes out of (is this what you mean by "Change where output pulses occur").
You can always try changing a parameter that you can measure after you already arm the counter, then run the code and test if that parameter actually changed. I hope this helps!
-Nathan H