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: 

AnalogWaveformSample examples for VB

I would like to write an application for acquiring multiple waveforms using VB 2005 (VB 😎 with the Measurement Studios VS2005 assemlies.  Analog sampling has not been an issue, but I would like the timestamping that appears to be part of the AnalogWaveformSample.  I cannot find any examples on how to effectiviley configure channels / timing / tasks for use with this class and the help files do not more than state what it is, not how to use it.  I would appreciate any insite on acquiring waveforms using VB.  Thank you.
0 Kudos
Message 1 of 2
(2,969 Views)
Hi John,

Are you already using the AnalogWaveform<TData> class in your application? If so, then you can access the timestamp through the Timing property.  If you are not using this class, then a good starting point is the shipping example GlobalContinuousAI (located in the <MeasurementStudioVS2005>\DotNET\Examples\DAQmxWithUI\GlobalContinuousAI folder) which uses this class along with the AnalogMultiChannelRead class.  In this example, adding a statement like: data(0).Timing.TimeStamp would allow you to get/set the timestamp for the first channel of data.  Note that the return type of the EndReadWaveform method is AnalogWaveform<TData> which means the timing information is set based off the execution of the AI task. Otherwise, the timing property is set to Empty when creating an analog waveform using a constructor.

As far as the AnalogWaveformSample<TData> class goes, you can look at it just as a sample of the AnalogWaveform<TData> class (as it states in the help) which is why there is an Owner property of AnalogWaveform<TData> type.  Thus, the timestamp will be set if the Owner's Timing property is not Empty. Otherwise, no timestamp will be available.  Let me know if this helps.

Have a great day,

Ecleamus Ricks, Jr.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(2,948 Views)