Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

ni6008 visual basic analog out error -200077

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....

0 Kudos
Message 1 of 10
(3,595 Views)

Hi icrook63,

 

This error is commonly seen when trying to perform a hardware timed output on the USB 6008 as the device lacks this capability.

 

Do you set the timing properties of the task anywhere in your code?

0 Kudos
Message 2 of 10
(3,547 Views)

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

0 Kudos
Message 3 of 10
(3,532 Views)
The USB-6008 has no output clock as you can see from the specs. You can't use s timing function at all. You have to output your signal one point at a time.
0 Kudos
Message 4 of 10
(3,529 Views)

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...

0 Kudos
Message 5 of 10
(3,473 Views)
It's quite simple. Since there is no clock, you cannot specify any timing. I don't have my c reference handy do I don't know if you can specify on demand with the function. In LabVIEW, you simply skip the function altogether.
0 Kudos
Message 6 of 10
(3,470 Views)

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 ?

0 Kudos
Message 7 of 10
(3,465 Views)

Hi icrook63,

 

I should have been more clear, the reason I asked if you'd set timing was that if you had it would cause the error you're seeing as Dennis has explained.

0 Kudos
Message 8 of 10
(3,434 Views)

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

0 Kudos
Message 9 of 10
(3,384 Views)

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.

0 Kudos
Message 10 of 10
(3,334 Views)