Final project – creating a simulated assembly line
Our final project will consist of a production line. The line will consist of a function block for a facade and another function block that will have the following methods:
- Turn on the motors
- Home the motors
- Start the motors
The first thing that we will want to do is create the mentioned methods with an access specifier of Public and a return type of BOOL
. Once that is done, create a GVL called outputs
and set the following variables:
{attribute 'qualified_only'} VAR_GLOBAL motorState : WSTRING; startMotors : BOOL; MotorsOn : BOOL; END_VAR
The HomeMotor
method will consist of the following:
outputs.motorState := "motors homed";
The StartMotors
method will consist of the following:
outputs.startMotors := TRUE;
Finally, the TurnMotorsOn
method will...