I am new to DAQmx and .NET. In my application I need to activate a clock out on counter 2 (HW pci 16 E 4). I went through all the steps like the sampling examples but instead of Analog input I used counter output , and setup the pulse ratios.
When I click the switch in the user interface ( a user control databinded to the clock output) the output works. Since I need to activate it programmatically I tried to call the daQmxUserControl11.Start() method but this causes the following error :
An unhandled exception of type 'NationalInstruments.DAQmx.DaqException' occurred in nationalinstruments.daqmx.dll Additional information: Specified operation cannot be performed while the task is running. Task Name: DAQmxTask1 Status Code: -200479
You are probably getting that error because you are starting the task twice, and this cannot be done. You can actually find examples that does exactly what you want in the following folder:
Thanks a lot, I also discovered that dragging the user control onto my user interface doesn't allow alternate activation. ( I actually tried stopping and then starting but the result was the same )
Calling the routines as indicated in the header comments also gave some hiccups ( I had to remark some code to get the system working progrtammatically.