06-22-2009 03:41 PM
Running a USB 6229, programming with VB6, because I am a strict newby with LV
Following is a code snippet attached to a Command Button:
cmdReadCH0_Click()
Dim Value As Double
'Create task
DAQmxErrChk DAQmxCreateTask("", Handle1)
Task1Flag = True
DAQmxErrChk DAQmxCreateAIVoltageChan(Handle1, "Dev1/ai0:1", "", DAQmx_Val_InputTermCfg_Diff, 0, 0.2, DAQmx_Val_VoltageUnits2_Volts, "")
'DAQmxErrChk DAQmxReadAnalogF64(Handle1, 1, 10, DAQmx_Val_GroupByChannel, Value, 1, 1, 1)
DAQmxErrChk DAQmxReadAnalogF64(Handle1, 1, 10, DAQmx_Val_GroupByScanNumber, Value, 1, 1, " ")
lblCh1.Caption = CStr(Value)
If Task1Flag Then
DAQmxClearTask Handle1
Task1Flag = False
End If
End Sub
I am setting up channel 0 as differential, with a range of 0 to 200 millivolts, 10 second timeout, simply to read and display (for now).
I get RunTime Error '-200492(fffcf0d4)' Measurements: Reserved Parameter must be NULL.
I am obviously not defining the parameters in the function call properly, but which ones?
Thanx for the guidance.
06-23-2009 10:45 AM
Hi JEY2,
This KB discusses the solution to your error. Please let me know if you're still having problems with this. Have a great day!
06-25-2009 02:58 PM
Yes, that KB took care of the problem. I had to increase the size of the buffer to get a good read, but that was simple.
What is the significance of the ":1" in the address "Dev1/ai0:1"?
Thanks again for the help.
JEY
06-26-2009 09:33 AM