Try to access time-stamped Data from an HostScope with Microsoft .Net Framework functions using VB

1 次查看(过去 30 天)
Hey everybody,
I'm working on a GUI to access an application running on a xpc-target pc. I'm using VS2010 and I'm programming in VB. For the implementaion of signal monitoring I'm using Hostscope objects and ScopeSignal objects with Microsoft .Net Framework functions.
At the moment I'm able to recieve the logged Data for any signal I've added to the Scope, but only the Data and no Time. I get an Array of the zerobased rank 1, but I'm only able to read-out an Array of rank 0.
Example:
Private real_sig As MathWorks.xPCTarget.FrameWork.xPCHostScopeSignal
Private hscope As MathWorks.xPCTarget.FrameWork.xPCHostScope
Private hscope_sig As MathWorks.xPCTarget.FrameWork.xPCHostScopeSignalCollection
hscope_sig = hscope.Signals
real_sig = hscope_sig.Add(aout_real)
Dim l As Integer = (hscope.NumSamples - 1)
Dim Daten_real(l) As Double
Daten_real = real_sig.HostScopeSignalDataObject.GetData
I'm pretty sure you also can get the Time of a scope object, at least it is possible with C Api, Com Api and MATLAB.
Does anyone of you know how to get the Time to the Data of an HostScope object?
thanks for your answers
Svenja

采纳的回答

Shiva Arun Kumar
Shiva Arun Kumar 2012-2-7
Hi Svenja,
You can get the Time Data using the DataTimeObject of the xPCHostScope class. For example (C# code):
xPCHostScopeCollection hscopes = tgscopes.HostScopes;
xPCHostScope hscope = hscopes[3];
xPCDataHostScSignalObject dHostObj = hscope.DataTimeObject;
double[] timeinfo = dHostObj.GetData();
Hope that helps,
Shiva

更多回答(1 个)

Svenja
Svenja 2012-2-7
Hey Shiva,
thanks a lot, this way it works.
Svenja

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by