Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with examle code VB 6 Analog output

Hello

sorry for my bad english 🙂

Now I explore NI USB-6008. Work with VB6

2 days cant understand why don't work example programm for Analog Output - Cont Gen Volt Wfm-Int Clk

Example programm for Analog Input  - Is Work very good, but AO :(...

 

error -200077 in line:

'DAQmxErrChk DAQmxCreateAOVoltageChan(taskHandle, physicalChannelTextBox.Text, "aoChannel", minValueTextBox.Text, maxValueTextBox.Text, DAQmx_Val_VoltageUnits2_Volts, "")

 instead of this i try replaec parametrs on their codes... as that so has turned out:

DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "", 100#, 10280, 10123, 100)

and now i have error -200077 in line:

'DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "", 100, clockEdge, DAQmx_Val_AcquisitionType_ContSamps, 100)

 

Once again forgive for my bad English

In advance thanks

 

0 Kudos
Message 1 of 10
(12,005 Views)

now i find in http://forums.ni.com/ni/board/message?board.id=230&thread.id=4097

 

peace of code:

 

DAQmxErrChk DAQmxCreateTask("", taskHandle) 

DAQmxErrChk DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ao0", "", 0, 5, DAQmx_Val_Volts, "")

DAQmxErrChk DAQmxWriteAnalogScalarF64(taskHandle, 1, 10#, 1#, "")

 

i try him, and:

 

in second line i have error 200077, but if i replace  DAQmx_Val_Volts on 10348 then i have error -200492 in third line "Reversed parametr must be Null" i dontunderstand nithing now 😞

 

what i do not right?

 

0 Kudos
Message 2 of 10
(12,002 Views)

I fink that at me a problem in clockEdge, but I will not understand as it to solve: (

this parametr can be:

1)DAQmx_Val_Edge1_Rising

2)DAQmx_Val_Edge1_Falling

and 1 and 2 not work 😞

 

0 Kudos
Message 3 of 10
(12,000 Views)

It again I:) I try to make through  DAQmxWriteAnalogF64 . I receive an error -200492 Reserved parameter must be NULL...
code:

    DAQmxErrChk DAQmxCreateTask("", taskHandle)
    DAQmxErrChk DAQmxCreateAOVoltageChan(taskHandle, "Dev3/ao0", "", 0, 5, DAQmx_Val_VoltageUnits2_Volts, "")
    DAQmxErrChk DAQmxWriteAnalogF64(taskHandle, 2, True, 10, DAQmx_Val_GroupByScanNumber, 1, 50, "")

 

error in third line.... but i don know where 😞

0 Kudos
Message 4 of 10
(11,991 Views)

It is necessary for me on 1 analog output to send only 1 value... Somebody help
Modul 6008   programmning on VB6
In MAX all works right
Analog input too work perfectly - analog output do not want...

I read many tutorials, many posts, advices - but nothnig help ...

 

Vitaliy

0 Kudos
Message 5 of 10
(11,987 Views)

    DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "", 150, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, CLng(25))

in this line i get error  200077. Please tell me, why it so? I work withNI USB 6008. Programming on VB6

 

Vitaliy

0 Kudos
Message 6 of 10
(11,957 Views)

Hi Vitaliy,

 

I appreciate your persistence working with your application. It sounds like you are trying to configure parameters in your code that may be out of range or not supported by your device. I did find an example using DAQmx in VB6 that generates single point AO. I think this may be a great place for you to work from and may provide the functionality you are looking for. I have included a link to the example below for your reference. There are also additional examples that should be installed on your computer and I've included a link that describes this in more detail, but these examples should include the correct formatting of the commands.

 

You may still run into an issue if your parameters are not allowed for your particular model of hardware. If you are still running into issues could you supply more information about the values that your are writing to each command? At this point you have variables in your code, but I am not if there is a particular parameter that is causing your problems.

 

NI-DAQmx: Generate Single Point Analog Output In VB 6

http://zone.ni.com/devzone/cda/epd/p/id/5338

 

NI-DAQmx Examples for Visual Basic 6.0

http://digital.ni.com/public.nsf/allkb/735848148B5B4964862571F5004692C7?OpenDocument

Steve B

0 Kudos
Message 7 of 10
(11,936 Views)

Hi Steve

Thanks big.

Your Example has opened my eyes. All genious is simple:

 

All worked initially, it was necessary to restart simply the unit after appearance of an error 200492 and to write in string DAQmxWriteAnalogScalarF64 (............, ByVal 0)
But I what for tried to write that there Null or ""

 

It realy my mistak - i not attentively reading description of functions and errors

 

Once again thanks
I will go to study the modul further

 

 

Vitaliy

 

 

0 Kudos
Message 8 of 10
(11,922 Views)

Hi, Vitaliy

i know this is an old post but i am reaching out to you because i have searched through and tried everything in my power to get the analog input of Ni6008 using vb6 and have not been successful. could you please point to to the right direction. Could you please share an example with me. 

thanks. 
Roy

0 Kudos
Message 9 of 10
(5,839 Views)

Hello, do you have 6008 communication with VB now? Can you give me some guidance? Thank you!  

0 Kudos
Message 10 of 10
(5,634 Views)