From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Event driven DAQ measurements

Hi,

I've hit a little bit of a stumbling block with a voltage measurement I am trying to make.  First off, I'm using the following setup:

Windows XP
Measurement Studio 8.0.1
Visual Studio 2005 (C#)
PCI-6229 DAQ Card

I am writing software for an application that controls 4 instances of an identical station.  Each station has a vacuum pump that I am reading an analog voltage from (differential measurement).  I am using an SCB-100 connector block and using 4 inputs (channels 0, 1, 2 and 3).

The trouble I'm having is that I have structured the program so that I have an class 'station' that includes all of the equipment.  I therefore have 4 instances of a pressure reader.  In a past program that I wrote in Labwindows, I would create a single task that would contain as many channels as there were stations in use.  I haven't done that this time and am trying to create a new task for each channel in use.  I thought that I'd be able to get away with doing this but I'm apparently accessing reserved resources.  I have been careful to make sure that each task is addressing a unique channel but still get the following error:

The specified resource is reserved.  The operation could not be ompleted as specified.

Task Name: _unnamedTask<AC>
status code: -50103

This does not occur when I only activate one channel but does once I activate more than one.  Am I going to have to set it to run the same way as I did before or is there a way around this?  Incidentally, I'm also using events to notify the interface and file writing functions that there is new data, hence the reason for pursuing this structure.

Many thanks in advance...

0 Kudos
Message 1 of 3
(3,515 Views)

Hi acrmartin,

If I understand you correctly, you create a new task for each physical channel of analog input. When you do this you receive a ‘resource is reserved’ error.

This error is occurring because M Series boards have a single analog to digital converter (ADC) multiplexed across all analog input (physical) channels. Because of this, all analog input channels share the same timing element and must therefore be in the same single task. One way to think about the error is that the ADC is the ‘resource’ that is ‘reserved’.

To clear up the error, place all of your analog input channels in the same task. Instead of creating a new task with every station, you can add the corresponding physical channel to the task.

Post back if you have any questions. Have a great day!

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 2 of 3
(3,498 Views)
Ryan,

That makes complete sense - I'll have a crack at it today and let you know how I get on.  Thanks very much.
0 Kudos
Message 3 of 3
(3,483 Views)