Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any examples for VB as the "Cont Acq-Int Clk" for ANSI C?

I wanna acquire  continuous datas using the USB-6008 in VB , but I can't find how to use "EveryNCallback" in VB!

 there is any way to acquire  datas continuing for real time computing in VB?

 

 

Thinks!

0 Kudos
Message 1 of 7
(10,009 Views)

Sorry,I had mistook. Today I have read the "Cont Acq-Int Clk" for ANSI C, and found it was not realized the function that I want.

Actually,I want the DAQ device to return the data to heel the every single step sampling but not after a amount of sampling.

 

My English is poor. Ask me if anywhere unclear!

帖子被gamesun在 10-19-2009 06:52 AM
时编辑过了
0 Kudos
Message 2 of 7
(10,001 Views)

Hi there,

 

I'd like to know what is your hardware settings and what is your requirements(like sample rate etc.)

 

So, we have two approachs,

 

1. if your sample rate is very very slow, below around 300Hz,  I think you can perform one sample at one time using software timed acquire, that's ok

 

2. if your sample rate is around 1KHz and above,  I think you should refer to hardware timed acquire, which is what your programme has done,

 

And I think you should learn some more thing about DAQ yourself to perform your task

Best Regards

Hu Yu
0 Kudos
Message 3 of 7
(9,988 Views)

Thanks for your reply,NIhuyu! 

 

At present,I require one channel to sample and I hope the sample rate as fast as possible.(NI USB-6008 Maximum AI Sample Rate is 10kHz)

 

What's the meaning of "hardware settings"? Is it "Channel Parameters" or "Physical Channel" or "input voltage level of the measured signal range"? Maybe those are irrespective.

Or is it driving at my PC hardware?

 

I have found some examples for VB on the www.ni.com the other day.One of them names "NI-DAQmx: Continuous Analog Acquisition with NI-DAQmx Events in Visual Basic 6.0".

It is able to make it by setting the "Samples/Channel/Read:" & "Samples to display" to "1".

 

But new question! After pressing "Start" it does work,but a moment later it show a msgbox saying "In task done event handler" with only one CommandButton "OK".What's the meaning of that?

 

0 Kudos
Message 4 of 7
(9,982 Views)

so there is only one USB-6008, you just get one channel working, and you'd like to set your sample rate as high as possible.

 

Base on these requirements, I think you should do a hardware timed acquisition, that is with a buffer on board. For the PC can not run as fast as your

 

sample rate, we must have a buffer to store samples, the device can acquire sample one by one at a short cycle time, and PC can get a set of samples

 

at a longer time, this is how we implement fast data acquisition on PC.

 

So, in your situation, you can not view the sample one by one, but group by group, you can adjust the parameter in the program to achieve this.

 

Your another question, because VB is rarely used in our application, I don't have any idear about that error, I think it is related to the event engine of windows,

 

 if you set "sample to display" as 1, the event should always take place, you can try your first example on hand, set the parameters like this:

 

sample rate: 10K

samples to read: 3K

 

and see if it can work well,

Best Regards

Hu Yu
0 Kudos
Message 5 of 7
(9,978 Views)

The device can return a set of samples after a amount of sampling(at least 1000 times, that's enough), namely at a longer time.

Maybe there is RAM in the device which I didn't find on the user guide & specifications.

 

Well.Now I have known the bottleneck is the slow reaction of PC.\(^o^)/

 

The examples of VB still doesn't work. its parameters settings show in the picture.

111.JPG

If I set the Sample Rate above 300Hz it show that msgbox after seconds ,if below 300Hz, it can work longer, .

 

And if I set like this:

222.JPG

it can work well,even the Sample Rate up to 10kHz.

 

Wait for anyone who can settle this.

 

Thanks for your patient help,NIhuyu!

 

Yutong Sun

帖子被gamesun在 10-20-2009 04:51 AM
时编辑过了
帖子被gamesun在 10-20-2009 04:51 AM
时编辑过了
0 Kudos
Message 6 of 7
(9,969 Views)

Hello,

 

I am using VB with NI-DAQmx and am having a problem that my VB environment crashes when I close the sample listed above.  "NI-DAQmx: Continuous Analog Acquisition with NI-DAQmx Events in Visual Basic 6.0". 

 

 

I have my own app that crashes also.  I was hoping the example would work but it does the same thing as my code.

 

I was wondering if you have had the same problem and if you were able to fix it.

 

Thanks, David

 

0 Kudos
Message 7 of 7
(9,421 Views)