Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Synchronous DataReady event and Asynchronous DataReady event for Continuous Input using AnalogMultiChannelReader

I'm new to the development of a measurement application.

Sorry if my question is wrong or not clear..

 

Now i'm creating a project which acquires multi channel (8 channels) continuous input data by using C# and MAX.

 

By using MAX, "DaqTask.cs" is automatically created, and in this file, "DataReady" event handler

is prepared in order to raise an event when the input data has been acquired.

 

By default, the "DataReady" event handler is called synchronously.

If the process performed at the "DataReady" timing takes time, an exception(previous data is overwritten) happens.

So i changed the "DataReady" event from "Synchronous" to "Asynchronous",

as described in the comment in "EngReadContinuous" method in "DaqTask.cs".

In that comment, it also mentioned about "Memory Optimized",

but i cannot understand what i have to do if i changed the event handler from "Synchronous" to "Asynchronous".

 

Anyway, i checked the analog data notified as the parameter of the "DataReady" event.

 

When i used "Synchronous" for the "DataReady" event, the value of the timestamp is:

(5 samples per channel, and the timestamp is just an example)

 

   <Timestamps of Channel 1 (Nth "DataReady" call)>

   timestamp[0] 2012/03/28 10:28:10.100

   timestamp[1] 2012/03/28 10:28:10.200

   timestamp[2] 2012/03/28 10:28:10.300

   timestamp[3] 2012/03/28 10:28:10.400

   timestamp[4] 2012/03/28 10:28:10.500

 

   <Timestamps of Channel 1 ((N+1)th "DataReady" call)>

   timestamp[0] 2012/03/28 10:28:10.600

   timestamp[1] 2012/03/28 10:28:10.700

   timestamp[2] 2012/03/28 10:28:10.800

   timestamp[3] 2012/03/28 10:28:10.900

   timestamp[4] 2012/03/28 10:28:11.000

 

There is no problem in case of "Synchronous".

The timestamp is increasing correctly.

 

But when i used "Asynchronous" for the "DataReady" event, the value of the timestamp is:

(5 samples per channel, and the timestamp is just an example)

 

   <Timestamps of Channel 1 (Nth "DataReady" call)>

   timestamp[0] 2012/03/28 10:28:10.100

   timestamp[1] 2012/03/28 10:28:10.200

   timestamp[2] 2012/03/28 10:28:10.300

   timestamp[3] 2012/03/28 10:28:10.400

   timestamp[4] 2012/03/28 10:28:10.500


 

   <Timestamps of Channel 1 ((N+1)th "DataReady" call)>

   timestamp[0] 2012/03/28 10:28:10.100

   timestamp[1] 2012/03/28 10:28:10.200

   timestamp[2] 2012/03/28 10:28:10.300

   timestamp[3] 2012/03/28 10:28:10.400

   timestamp[4] 2012/03/28 10:28:10.500


Sometimes the timestamp of Nth and the timestamp of (N+1)th becomes same..

I also checked the acquired data when the timestamp is same as the previous cycle,

the value of the acquired data is also same..

 

I'm not sure whether this phenomenon is related to the "Memory Optimized" description in "DaqTask.cs".

 

I have to solve this problem by 29-March, but i have no idea and there is no expert member of the measurement development in my team..

 

What i want to know is the following three questions..

 

1) When i changed the "DataReady" event from "Synchronous" to "Asynchronous",

what do i have to do other than changing the method to raise the "DataReady" event?

 

2) I understand the "Memory-Optimized Analog Waveform Read Methods" allows for much

more efficient memory usage when performing multiple analog waveform reads.

(By the release notes of the Measurement Studio)

Is there any necessity to change the read methods when i changed 

the "DataReady" event from "Synchronous" to "Asynchronous"?

 

3) Why sometimes the timestamp of Nth and the timestamp of (N+1)th becomes same?

Is there any method to avoid this phenomenon?

 

Thank you very much for reading my questions..

0 Kudos
Message 1 of 1
(4,257 Views)