11-19-2007 02:04 PM
// create the task
DAQmxCreateTask("",&taskDigitalHandle);
DAQmxCreateDOChan(taskDigitalHandle,"Dev1/port0/line0","",DAQmx_Val_ChanPerLine);
// line 0 high
DAQmxWriteDigitalScalarU32(taskDigitalHandle, 1, 10.0, true, NULL);
// do something (removed)
// line 0 low
DAQmxWriteDigitalScalarU32(taskDigitalHandle, 1, 10.0, false, NULL);
I am getting the warning -200012 (Clock rate specified
exceeds the maximum conversion rate of the ADC) back, which I have no
idea how to resolve.
11-20-2007 09:10 AM
11-20-2007 09:45 AM
01-07-2008 04:20 AM
01-07-2008 09:49 AM
01-07-2008 11:28 PM
Thanku Mr Dennis for giving reply to my problem...
here iam giving detailed information about my problem....
iam using NI PCI 6221 card for conducting Thermal battery test....
here iam suppose to use Digital Output channels for relay on/off purpose....
the method iam using for that is DAQmxWriteDigitalScalarU32(),
this method is working for only one line in a selected port... for example i am using "Dev1/port1/line0"
iam writing code like this
DAQmxCreateTask("",&g_DWriteTaskHandle);
DAQmxCreateDOChan(g_DWriteTaskHandle,"Dev1/port1/line0","port0",DAQmx_Val_ChanPerLine);
DAQmxStartTask(g_DWriteTaskHandle);
DAQmxWriteDigitalScalarU32(g_DWriteTaskHandle, 1, 10.0, 1, NULL);
DAQmxWriteDigitalScalarU32(g_DWriteTaskHandle, 1, 10.0, 0, NULL);
DAQmxStopTask(g_DWriteTaskHandle);
CleanupTask(g_DWriteTaskHandle);
this code is working perfectly for Line0 On/Off is working well.......
but if iam using similary implimentation for "Dev1/port1/line1" On/Off is not responding.....
this is the code iam using for line1
DAQmxCreateTask("",&g_DWriteTaskHandle1);
DAQmxCreateDOChan(g_DWriteTaskHandle1,"Dev1/port1/line1","port1",DAQmx_Val_ChanPerLine);
DAQmxStartTask(g_DWriteTaskHandle1);
DAQmxWriteDigitalScalarU32(g_DWriteTaskHandle1, 1, 10, 1, NULL);
DAQmxWriteDigitalScalarU32(g_DWriteTaskHandle1, 1, 10, 0, NULL);
DAQmxStopTask(g_DWriteTaskHandle1);
CleanupTask(g_DWriteTaskHandle1);
these two are similar if you compare... but workin only for Line0 and not working for Line1.....
so please help me how to correct the problem
01-08-2008 02:32 PM - edited 01-08-2008 02:33 PM
Hi
What I would strongly suggest is to take a look at this knowledge base: Location of ANSI C NI-DAQmx Shipping Examples and DAQmx Library File for Windows and find this example: “WriteDigChan.c”. You will see that you can take a much simpler approach for what you are trying to accomplish. For troubleshooting proposes I would try setting a wait between both “writes” and see what happens. But the example should work fine.
I have attached the source in case you don’t find it. Hope it helps.