Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Using AI and AIpoint OCX same time in a application is not working

In my Visual Basic Application I am using AI and AIpoint OCX to read data from a DAQ 6025e device.
I am using a timer to collect data for AIPOINT and acquired data event for AI.

When I start application, I got data simultaneously from AI and AIPOINT ocx, but after some time both stop working, and no data comes out from card.

In timer when I check value at AIPoint.singleread
I got empty value.

Please guide me in finding solution.
0 Kudos
Message 1 of 3
(3,182 Views)
I would stay away from using two controls to access the same card simultaneously. The NI-DAQ driver only allows one operation/configuration at a time per card. I'm surprised your set up hasn't crashed since it is not designed to work that way. Mixing timers with events can have unpredictable results because inside the timer callback, VB does not check for any events (since it is not multithreaded), so unattended acquiredData events can potentially result in data loss or an NI-DAQ overflown buffer error.
What you can do is first acquire data from one control, then reset the card and configure it to acquire data from the second control. Although the ideal case would be to only use the CWAI control and change the number of scans you get at a time. You can also try callin
g the CWAI.AcquireData method to synchronously get a low number of samples (eg. one sample).

Regards,
Azucena
NI
0 Kudos
Message 2 of 3
(3,182 Views)
Thanx Aperez,

But now its working..... problem was with my code only.
I dont know but all is working fine, without any error.

Thanx again...
0 Kudos
Message 3 of 3
(3,182 Views)