Difference between revisions of "Project Example: Flip Flop (Structure Text)"
Noam.nitzan (talk | contribs) |
Noam.nitzan (talk | contribs) |
||
Line 19: | Line 19: | ||
<br/> | <br/> | ||
− | The main program uses 'softMC_Startup' FB ('mc_st' Instance) to initialize a startup process in the softMC. | + | The main program uses 'softMC_Startup' FB ('mc_st' Instance) to initialize a startup process in the softMC. <br/> |
When the process is done, a global variable will be set TRUE. After that, programs 'Axis1' and 'Axis2' are called. | When the process is done, a global variable will be set TRUE. After that, programs 'Axis1' and 'Axis2' are called. | ||
Revision as of 15:09, 19 February 2017
The task's purpose is to set and reset an output.
The main program initializes a startup process in the softMC.
After the startup process is done, the program sets a global variable and programs 'Axis1' and 'Axis2' are called.
The application uses two drives and their outputs.
After installation of device description file (created by the Configurator) to Device Repository, the drive's address will be declared in the Axis Pool:
In the EtherCAT Slaves section, we can find the I/O mapping for each device. In the picture below input1, input2, output1, output5 are declared as new variables (can also be mapped as existing variables):
The main program uses 'softMC_Startup' FB ('mc_st' Instance) to initialize a startup process in the softMC.
When the process is done, a global variable will be set TRUE. After that, programs 'Axis1' and 'Axis2' are called.
When programs 'Axis1' and 'Axis2' are called, output5 is turned on.
After that, 'SR' FB is enabled with output1 as 'Q1' ('SR_0' Instance).
Input1 will trigger the 'set' function and input2 will trigger the 'reset' function.
Programs 'Axis1' and 'Axis2' are similar:
Visualization
The program is controlled by a graphic interface:
When the startup process of softMC is done, the blue lamp is turned on.
The user can set and reset the outputs of the two drives with special buttons for each function. In addition, the result of the 'SR' FB is shown by the green lamps.