Adaptation of the acquisition data
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.
private void SetAcquisitions(Channel channel)
private void SetAcquisitions(Channel channel)
{
AdsAcquisition xAcquisition = new AdsAcquisition();
xAcquisition.AmsNetIdExchange =PLCNetID;
xAcquisition.TargetPort = 851;
xAcquisition.SymbolBased = true;
xAcquisition.SymbolName = "Variables.aBufferSine[1]";
xAcquisition.DataType = Scope2DataType.REAL64;
xAcquisition.SampleTime = (uint)(1 * TimeSpan.TicksPerMillisecond);
AcquisitionInterpreter xAcquisitionInterpreter = new AcquisitionInterpreter();
xAcquisitionInterpreter.Acquisition = xAcquisition;
channel.AddMember(xAcquisition);
AdsAcquisition yAcquisition = new AdsAcquisition();
yAcquisition.AmsNetIdExchange =PLCNetID;
yAcquisition.TargetPort = 851;
yAcquisition.SymbolBased = true;
yAcquisition.SymbolName = "Variables.aBufferSine[1]";
yAcquisition.DataType = Scope2DataType.REAL64;
yAcquisition.SampleTime = (uint)(1 * TimeSpan.TicksPerMillisecond);
AcquisitionInterpreter yAcquisitionInterpreter = new AcquisitionInterpreter();
yAcquisitionInterpreter.Acquisition = yAcquisition;
channel.AddMember(yAcquisition);
AdsAcquisition zAcquisition = new AdsAcquisition();
zAcquisition.AmsNetIdExchange =PLCNetID;
zAcquisition.TargetPort = 851;
zAcquisition.SymbolBased = true;
zAcquisition.SymbolName = "Variables.aBufferSine[1]";
zAcquisition.DataType = Scope2DataType.REAL64;
zAcquisition.SampleTime = (uint)(1 * TimeSpan.TicksPerMillisecond);
AcquisitionInterpreter zAcquisitionInterpreter = new AcquisitionInterpreter();
zAcquisitionInterpreter.Acquisition = zAcquisition;
channel.AddMember(zAcquisition);
}