Vincentbl
2006-10-18 04:10:07 UTC
Hello,
I am using a PCI 6534 board and I want to generate a continuous pattern from onboard memory. The software has to be written in CSharp.
I have found the following code example that is supposed to do this in C++ 6.0
DAQmxCreateTask("",&taskHandle)DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI0",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)DAQmxGetDOUseOnlyOnBrdMem(TaskHandle taskHandle, const char channel[], bool32 *data);DAQmxSetWriteRegenMode(TaskHandle taskHandle, DAQmx_Val_AllowRegen );DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)DAQmxStartTask(taskHandle)//keep doing until stop or errorDAQmxStopTask(taskHandle);DAQmxClearTask(taskHandle);
But I have a hard time finding .Net equivalent functions. Attached is the CSharp code I have been able to come up with. I would appreciate if someone could review this code and point me in the right direction.
I have found very few .Net base source code for NI-DAQmx. If someone could point me to some example code that would greatly help.
Thanks,
Vincent
6534 Continuous Pattern Generation.cs.pdf:
http://forums.ni.com/attachments/ni/70/5635/1/6534 Continuous Pattern Generation.cs.pdf
I am using a PCI 6534 board and I want to generate a continuous pattern from onboard memory. The software has to be written in CSharp.
I have found the following code example that is supposed to do this in C++ 6.0
DAQmxCreateTask("",&taskHandle)DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI0",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)DAQmxGetDOUseOnlyOnBrdMem(TaskHandle taskHandle, const char channel[], bool32 *data);DAQmxSetWriteRegenMode(TaskHandle taskHandle, DAQmx_Val_AllowRegen );DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)DAQmxStartTask(taskHandle)//keep doing until stop or errorDAQmxStopTask(taskHandle);DAQmxClearTask(taskHandle);
But I have a hard time finding .Net equivalent functions. Attached is the CSharp code I have been able to come up with. I would appreciate if someone could review this code and point me in the right direction.
I have found very few .Net base source code for NI-DAQmx. If someone could point me to some example code that would greatly help.
Thanks,
Vincent
6534 Continuous Pattern Generation.cs.pdf:
http://forums.ni.com/attachments/ni/70/5635/1/6534 Continuous Pattern Generation.cs.pdf