jbert
2008-07-17 23:40:09 UTC
I am trying to convert C legacy nidaq functions to nidaq mx for use in Matlab. I didn't write the code and am note familar with either Nidaq or Nidaqmx functions or syntax, so I've been having a lot of difficulty with something that should be simple.Here is the legacy code for starting a counter on the board. errcheck(GPCTR_Control(device, ND_COUNTER_0, ND_RESET)); errcheck(GPCTR_Set_Application(device, ND_COUNTER_0, ND_PULSE_TRAIN_GNR)); errcheck(Select_Signal(device, ND_GPCTR0_OUTPUT, ND_GPCTR0_OUTPUT, ND_LOW_TO_HIGH)); errcheck(GPCTR_Change_Parameter(device, ND_COUNTER_0, ND_COUNT_1, ncounts)); errcheck(GPCTR_Change_Parameter(device, ND_COUNTER_0, ND_COUNT_2, ncounts)); errcheck(GPCTR_Control(device, ND_COUNTER_0, ND_PROGRAM));Here is the legacy code to stop the counter. errcheck(GPCTR_Control(device, ND_COUNTER_0, ND_RESET)); errcheck(Select_Signal(device, ND_GPCTR0_OUTPUT, ND_NONE, ND_DONT_CARE));Any help in converting this would be much appreciated.Thanks,Julie