FB_ALY_XyShapeMonitor_Circle_2Ch
The XY Shape Monitor Circle 2Ch count the amount of intersections of an XY input with a specified circle shape.
Syntax
Definition:
FUNCTION_BLOCK FB_ALY_XyShapeMonitor_Circle_2Ch
VAR_INPUT
bPersistent: BOOL;
END_VAR
VAR_OUTPUT
ipResultMessage: Tc3_EventLogger.I_TcMessage;
bError: BOOL;
bNewResult: BOOL;
bConfigured: BOOL;
bWithinShape: BOOL;
bIntersection: BOOL;
nCountIntersections: ULINT;
fbTimeLastIntersection: FB_ALY_DateTime;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
bPersistent | BOOL | If the value is |
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 |
bWithinShape | BOOL |
|
bIntersection | BOOL |
|
nCountIntersections | ULINT | Total number of intersections of input signal and shape. |
fbTimeLastIntersection | FB_ALY_DateTime | Timestamp of the last intersection. |
Methods
Name | Definition Location | Description |
---|---|---|
Call() | Local | method calculates the outputs for a given configuration. |
Configure() | Local | General configuration of the algorithm with its parameterized conditions. |
Reset() | Local | Resets all internal states or the calculations made so far. |
SetChannelValue() | Local | Method to pass values to the algorithm. |
Sample
VAR
fbXyShapeMonitor_Circle : FB_ALY_XyShapeMonitor_Circle_2Ch;
fbSystemTime : FB_ALY_GetSystemTime;
stCentre : ST_ALY_XyPosition := ( X:= 4.0, Y := 2.0);
fRadius : LREAL := 1.5;
bConfigure : BOOL := TRUE;
fInputChX : LREAL;
fInputChY : LREAL;
END_VAR
// Configure algorithm
IF bConfigure THEN
bConfigure := FALSE;
fbXyShapeMonitor_Circle.Configure(stCentre, fRadius);
END_IF
// Get current system time
fbSystemTime.Call();
// Call algorithm
fbXyShapeMonitor_Circle.SetChannelValue(1, fInputChX);
fbXyShapeMonitor_Circle.SetChannelValue(2, fInputChY);
fbXyShapeMonitor_Circle.Call(fbSystemTime.tSystemTime);
Requirements
Development environment | Target platform | Plc libraries to include |
---|---|---|
TwinCAT v3.1.4024.0 | PC or CX (x64, x86) | Tc3_Analytics |