To study timing operation using drives, in order to define speed profiles of drives, the script language in the block Cscript comes in handy. The time sequences can be defined and the various motors can be controlled. Also sensor signals like posiiton detectors can be made input for the script. In this way various movement profiles can be programmed.
The script is writtin inside the block Cscript. Global variables S1 and S2 are defined using the blocks Cvar. These blocks always show the value of their variable at the output. The global variable do are automatically defined in the script and keep their value when the script returns. The blocks SWITCH control the switches in the electric circuit diagram.
The animation shows two Dc motors operated by the switches S1 and S2. The left motor can also be reversed in speed by closing the switches S1B1 and S1B2. The block on the conveyor belt will move to the left when the switches S1A1 and S1A2 are closed
At the moment when the block on the conveyor belt is under the grinder, the grinder is started by closing switch S2. When the grinder is finished the conveyor is operated in reverse, transporting the block back to its original position.
The Cscript is easily set up and integrated into the simulation. Using simple if statements a simple program is easily set up or even more complex state flows can be defined.
The animation is created using the OBJECT blocks.