ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i control the DAQ directly from VB

Actually, it is my first trial to use Visual Basic to get signal from DAQ.
And i don't how to interface them. I have read an article to use DataSocket.
However, it demostrated the OPC demo in OPC sever only, and so i didn't know
how to get the signal directly from DAQ card to monitor the real-time
signal.
Also, i have tried to build a .dll from my VI file which is used to monitor
the DAQ signal. However, the .dll file didn't have any return value or
argument, did it mean i can use this method?
And how can i interface the DAQ using VB?and my ADC model is AT-MIO-16E-2!
Thank you very much
0 Kudos
Message 1 of 2
(3,203 Views)
Hi Sen,
Are you using Measurement Studio ? If so then you can use the DAQ activeX controls.
If not and you are using VB directly, then NI-Daq installs with examples for visual basic ( if you chose the option while installing- if not do a custom install and choose VB support). If so then you should find them under Program Files ->National Isntruments->NI-DAQ->Examples->VisualBasic. These may help you.
Essentially NI-DAQ ships with a .bas file that contains the "declares" for the NI-DAQ dll functions. These files should be in
Program Files ->National Isntruments->NI-DAQ->Includes (look for the .bas files) You can add these to your project to get access to the DAQ functions..

On the second question, do you mean you are using labVIEW to create your dll ? If this
is the case, then when you create your dll (in labVIEW's applciation builder) you have to set the parameters for the function (VI) and also the VI's return values. This will ensure that you can make use of your VI ..If you don't set a return value you really can't use it...Once you set the return value ,and create a dll, then you can use it like any other dll in Visual basic.
Hope this helps...

This link may help you
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/5052ad60f1accc3d862568a100717fd1?OpenDocument
Nandan Dharwadker
Staff Software Engineer
Measurement Studio Hardware Team
Message 2 of 2
(3,203 Views)