05-06-2014 01:51 PM
HI,
I have a problem running the following under vb in excel..
Status = DAQmxCreateTask("", taskHandle)
Status = DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ao0", "NULL", "0", "5", DAQmx_Val_Volts, "NULL")
Status = DAQmxStopTask(taskHandle)
Status = DAQmxClearTask(taskHandle)
In the case of ..mxCreateAO.... status returns -200077, it's ok (0) for the other lines, but I don't know what is wrong. Any suggestions greatly appreciated....
05-09-2014 03:46 AM
05-10-2014 02:22 PM
Hi Adam and thanks for your reply...
The timing statement I've used is as follows:
Status = DAQmxCfgSampClkTiming(taskHandle, "/Dev1/OnboardClock", 100, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000)
Hopefully this is ok, but I can't say I'm totally sure...
Best Regards
05-10-2014 03:10 PM
05-17-2014 12:00 PM
Hi Dennis,
OK, agreed, the manual says software timed only... However, I'm confused by the second post asking suggesting this could be a timing error.. The only other statement I can think of that 'controls' the timing is ...
Status =DAQmxWriteScalarF64(taskHandle,"FALSE",1,1,"NULL")
which is after the Status = DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ao0", "NULL", "0", "5", DAQmx_Val_Volts, "NULL") and since this is where the error occurs I don't see how the WriteScalar statement can solve the problem..
Perhaps you could expand on the timing issue ?
Thanks again for your help...
05-17-2014 01:12 PM
05-17-2014 04:07 PM
Hi again,
just noticed that in
DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ao1", "NULL", "0", "5", DAQmx_Val_Volts, "NULL")
DAQmx_Val_Volts = empty
according to the compiler.. I would of thought it should have returned a value ? Could this be the problem ?
05-20-2014 03:42 AM - edited 05-20-2014 03:43 AM
05-24-2014 04:04 PM
HI,
ok, originally I didn't have any timing just the DAQmxWriteScalarF64 statement. I put the timing in to see what happened, but as pointed out it's not a valid thing to do. I know the 6008 is working as I can use it in SignalExpress and Labview. I can also access the logic outputs without error..( see below ). I'm still no nearer getting the analog going though.. If anyone has any thoughts please let me know....
Best Regards
Private Sub Write_Logic_0_Click()
Status = DAQmxCreateTask("", taskHandle)
Status = DAQmxCreateDOChan(taskHandle, "dev1/port0/line0:7", "", DAQmx_Val_ChanForAllLines)
Status = DAQmxStartTask(taskHandle)
' Write zeros or ones to the digital lines
Dim i As Integer
Dim writeArray(0 To 7) As Byte
For i = 0 To 7
' Reverse Logic
writeArray(i) = 1
Next
Status = DAQmxWriteDigitalLines(taskHandle, 1, True, 10#, DAQmx_Val_GroupByChannel, writeArray(0), sampsPerChanWritten, ByVal 0&)
Status = DAQmxStopTask(taskHandle)
Status = DAQmxClearTask(taskHandle)
End Sub
05-29-2014 04:23 AM
icrook63,
Have you tried looking at the VB DAQmx examples and running them to see if they run correctly?
The KB here lists where you can find examples for DAQmx in text based languages including VB 6.0, it might be worth seeing if you can get your device working using one of these.