Y_MA_CalcCircleCenter
Given two points on a circle, radius, direction , and path, this FB calculates the center of the circle.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_INPUT | ||||
| B | Enable | BOOL | The function block will continue to execute every scan while Enable is TRUE and there are no errors. | FALSE |
| V | X1 | LREAL | X coordinate of starting point. | LREAL#0.0 |
| V | Y1 | LREAL | Y coordinate of starting point. | LREAL#0.0 |
| V | X2 | LREAL | X coordinate of ending point. | LREAL#0.0 |
| V | Y2 | LREAL | Y coordinate of ending point. | LREAL#0.0 |
| V | Radius | LREAL | Radius of the circle. | LREAL#0.0 |
| V | PathChoice | MC_CirclePathChoice | If the path length is larger than 180 degrees, use MC_CirclePathChoice#Longest. If the path length is 180 degrees or less, use MC_CirclePathChoice#Shortest. | MC_CirclePathChoice#ClockWise |
| V | Direction | MC_CirclePathChoice | If the circle path travels clockwise use MC_CirclePathChoice#Clockwise. Otherwise if the circle path travels counterclockwise use MC_CirclePathChoice#CounterClockWise. | MC_CirclePathChoice#ClockWise |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | The Valid output indicates that the function block is operating normally and the outputs of the function block are valid. | |
| B | Error | BOOL | The Error output is set to TRUE if an error has occurred during the operation of the function block. The output is cleared when the Execute or Enable input becomes FALSE. | |
| E | ErrorID | UINT | The ErrorID output provides the identifier of the error when there is an active error in the function block execution. The output is cleared when the Execute or Enable input becomes FALSE. | |
| V | CenterX | LREAL | X coordinate of the center of the circle | |
| V | CenterY | LREAL | Y coordinate of the center of the circle | |
Error Description:
Refer to the Function Block ErrorID List list.