Adaptation of the acquisition data
private void SetAcquisitions(Channel channel)
{
//AmsNetId and AmsPort need the TwinCAT.Ads.dll
AdsAcquisition acq = new AdsAcquisition();
acq.AmsNetIdExchange = "localhost";
acq.TargetPort = 851;
acq.IsSymbolBased = true;
acq.SymbolName = "Variables.fSine";
acq.DataType = Scope2DataType.REAL64;
acq.SampleTime = (uint)(10 * TimeSpan.TicksPerMillisecond);
AcquisitionInterpreter acquisitionInterpreter = new AcquisitionInterpreter();
acquisitionInterpreter.Acquisition = acq;
channel.AddMember(acquisitionInterpreter);
}
The acquisition class of a channel describes the connection between the scope and the respective value of the machine controller. Therefore, for example, the name and size of a variable are expected at this point.
The acquisition object is hierarchically positioned below an AcquisitionInterpreter, which possesses further variable-independent information. Furthermore, the AcquisitionInterpreter is a member of a channel and, depending on the chart type, a channel may contain several AcquisitionInterpreters for the various axes. An acquisition can be appended directly to a channel as in the sample and the interpreter is automatically generated.