Reporting Collector Edge
The Reporting Collector Edge collects the data from the input channels and sends the data to the Reporting Server after an event or after the buffer is filled, depending on the configuration. An event is triggered when the signal of the input channel passes the configured edge at a certain threshold.
Syntax
Definition:
FUNCTION_BLOCK FB_Rpt_CollectorEdge
VAR_OUTPUT
ipResultMessage: Tc3_EventLogger.I_TcMessage;
bError: BOOL;
bNewResult: BOOL;
bConfigured: BOOL;
fbTimeLastEvent: FB_ALY_DateTime;
nBufferCount: UDINT;
END_VAR
Outputs
Name | Type | Description |
---|---|---|
ipResultMessage | Contains more detailed information on the current return value. This special interface pointer is internally secured so that it is always valid/assigned. | |
bError | BOOL | This output is |
bNewResult | BOOL | When a new result has been calculated, the output is |
bConfigured | BOOL | Displays |
fbTimeLastEvent | FB_ALY_DateTime | Stores the timestamp of the last message sent to the reporting server. |
nBufferCount | UDINT | Indicates the number of elements in the buffer. |
Methods
Name | Type | Description |
---|---|---|
Call() | Local | Method for calculating the outputs for a specific configuration. |
Configure() | Local | General configuration of the algorithm with its parameterized conditions. |
Reset() | Local | Resets all internal states or the calculations performed so far. |
SetChannelValue() | Local | Method for passing values to the algorithm. |
SetDisplayName() | Local | Method for describing the input channel. |
SetEdgeValue() | Local | Method for passing values to the edge channel of the algorithm. |
Properties
Name | Type | Access | Definition location | Initial value | Description |
---|---|---|---|---|---|
fTolerance | LREAL | Get, Set | Local | 0.0 | Tolerance value for the Equal / NotEqual comparisons |
Sample
VAR
fbRpt_CollectorEdge: FB_Rpt_CollectorEdge(sNetID:='', nNumChannels:=3);
fbSystemTime : FB_ALY_GetSystemTime;
bEdge: BOOL;
fDataInCh1: LREAL;
fDataInCh2: LREAL;
fDataInCh3: LREAL;
stThresholdEdge: ST_ALY_Threshold;
sReportName: STRING(255);
fTolerance: LREAL;
sDataKey: STRING(255);
nBufferSize: UDINT;
bIncludeTimestamps: BOOL;
aChannelNames: ARRAY [1..3] OF STRING(255);
END_VAR
// Configure algorithm
IF bConfigure THEN
bConfigure := FALSE;
sReportName:= 'Beckhoff Report Template';
fTolerance:= 0;
sDataKey:= 'DataKey101';
nBufferSize:= 1;
bIncludeTimestamps:= TRUE;
aChannelNames[1]:= 'Min';
aChannelNames[2]:= 'Max';
aChannelNames[3]:= 'Avg';
stThresholdEdge.eComparisonOperator := E_ALY_ComparisonOperator.Equals;
stThresholdEdge.fThreshold := 1;
fbRpt_CollectorEdge.Configure(
sConfigId:= sReportName,
sDataKey:= sDataKey,
nBufferSize:= nBufferSize,
bBufferOnEvent:= bBufferOnEvent,
bIncludeTimestamps:= bIncludeTimestamps,
stThresholdEdge:= stThresholdEdge);
fbRpt_CollectorEdge.fTolerance:= fTolerance;
fbRpt_CollectorEdge.SetDisplayName(nChannel:= 1, sDisplayName:= aChannelNames[1]);
fbRpt_CollectorEdge.SetDisplayName(nChannel:= 2, sDisplayName:= aChannelNames[2]);
fbRpt_CollectorEdge.SetDisplayName(nChannel:= 3, sDisplayName:= aChannelNames[3]);
END_IF
// Get current system time
fbSystemTime.Call();
// Call algorithm
fbRpt_CollectorEdge.SetChannelValue(nChannel:= 1, Input:= fDataInCh1);
fbRpt_CollectorEdge.SetChannelValue(nChannel:= 2, Input:= fDataInCh2);
fbRpt_CollectorEdge.SetChannelValue(nChannel:= 3, Input:= fDataInCh3);
fbRpt_CollectorEdge.Call(fbSystemTime.tSystemTime);
Requirements
Development environment | Target platform | Plc libraries to include |
---|---|---|
TwinCAT v3.1.4024.0 | PC or CX (x64, x86) | Tc3_Analytics |