
When modeling the plants and requirements, you assume a certain initial state. That is, for each of the sensors and actuators, you assume an initial location. The initial state for the sensors and actuators of the four workstations are listed on their individual pages.
The hardware mapping files provided as part of the 4K420 course files contain hardware mappings. Each hardware mappings defines, among others, the initialization sequence of its workstation. The initialization sequence ensures that after initialization, the system will be in a state that corresponds to the initial state as provided on the pages for each of the four workstations.
Just before initialization, the hardware mapping turns on lamps 1, 2, and 3, to indicate it is initializing the system. Once initialization is successfully completed, all lamps are turned off, as the initial state of the lamps is off.
Initialization may fail. If this happens, it will be indicated by animating the lamps. The first lamp (and only the first lamp) will be on, then the second lamp will be on, then the third lamp will be on, then the second lamp will be on again, and the cycle repeats. At this point, the only thing you can do, is to resolve the underlying cause of the initialization failure, and to reset TwinCAT.
One of the most common reasons for initialization failure is that the compressed air valve is closed (handle in the horizontal position). Obviously, to use the system, the power supplies (three in total for all four workstations) must be on, and the compressed air valve (one valve for all stations) must be opened (handle in the vertical position). If this is not the case, then certain actuators can’t be enabled, or won’t have any effect. This in turn means that initialization can’t continue to move a certain parts of the system to their proper initial positions, meaning that at the end of initialization certain sensors won’t have their proper initial values.
Another common reason is a sensor that is enabled, but that can not be disabled by means of any of the actuators. An example of this is a sensor that detects and input product, which can only be removed by the user. As long as the product remains at the input position, the sensor will remain on, and initialization will fail, if the sensor is supposed to be off in the initial state.
To figure out the actual sensor that is causing the initialization failure, do the following in TwinCAT:
The following screenshot gives an example: