Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Input from Single Channel using multiple tasks

Hello, I'm new to Measurement Studio.  I tried searching for the answer on here and the help with no luck.

I am using VB.NET 2010, and Measurement Studio 2012.

 

In my application I need to display voltage input values differently. 

-1st I need a Continuous Waveform graph that displays the data at a high sample rate.

-2nd I need to display the values at a much slower sample rate say 1/sec, using a standard textbox.

 

My initial thought was to create a continuous task for the waveform, and a second task that is on a timer that calls the ReadSingleSample, for the textbox. As you probably know this caused an error.   

 

 

"NI Platform Services:  The specified resource is reserved. The operation could not be completed as specified.

Task Name: _unnamedTask<2>

Status Code: -50103"

 

Any help on how to accomplish this would be greatly appreciated.

0 Kudos
Message 1 of 3
(5,030 Views)

Hello Matt0316,

 

That error is indicative of creating multiple tasks of the same type for the same device. This is a very common resource reserved error. I recommend staying away from creating multiple tasks for this part of your application. Have a look at these two articles to get a better understanding of the customizations possible with Measurement Studio Waveform Graphs as well as the Waveform Data Types. Consider using the "AfterDraw" event to grab the latest plot data available. With some other logic in place, you can update your textbox with the most recent data if a certain time variable has met your criteria.

 

Jeff L.

0 Kudos
Message 2 of 3
(5,015 Views)

Hello Matt0316

 

In slow speed cycle you read last value from last data of high speed cycle.

 

Lubo

 

 

0 Kudos
Message 3 of 3
(4,938 Views)