Difference between revisions of "Project Example: Flip Flop (Structure Text)"
(Created page with "FF ST creation") |
Noam.nitzan (talk | contribs) |
||
Line 1: | Line 1: | ||
− | FF ST | + | |
+ | The task's purpose is to set and reset an output. <br/> | ||
+ | The main program initializes a startup process in the softMC. <br/> | ||
+ | After the startup process is done, the program sets 'Done' variable and a global variable. <br/> | ||
+ | After 'Done' variable is set, programs 'Axis1' and 'Axis2' are called. <br/> | ||
+ | The application uses two drives and their outputs. <br/> | ||
+ | <br/> | ||
+ | |||
+ | After installation of device description file (created by the Configurator) to Device Repository, the drive's address will be declared in the Axis Pool: | ||
+ | |||
+ | [[File:FF A1.PNG|border|600px]] [[File:FF A2.PNG|border|600px]] | ||
+ | <br/> | ||
+ | <br/> | ||
+ | |||
+ | 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): | ||
+ | |||
+ | [[File:FF CDHD I_O.PNG|border|600px]] | ||
+ | <br/> | ||
+ | <br/> | ||
+ | |||
+ | The main program uses 'softMC_Startup' FB ('mc_st' Instance) to initialize a startup process in the softMC. A rising edge detection will set the 'Done' variable (and also a global variable), which will call programs 'Axis1' and 'Axis2': | ||
+ | |||
+ | [[File:FF main program ST.PNG|border|850px]] | ||
+ | <br/> | ||
+ | <br/> | ||
+ | |||
+ | When programs 'Axis1' and 'Axis2' are called, output5 is turned on.<br/> | ||
+ | If output5 is turned on, the 'SR' FB is enabled with output1 as 'Q1' ('SR_0' Instance). <br/> | ||
+ | Input1 will trigger the 'set' function and input2 will trigger the 'reset' function.<br/> | ||
+ | Programs 'Axis1' and 'Axis2' are similar:<br/> | ||
+ | |||
+ | [[File:FF Axis1 ST.PNG|border|750px]] [[File:FF Axis2 ST.PNG|border|590px]] | ||
+ | <br/> |
Revision as of 16:50, 14 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 'Done' variable and a global variable.
After 'Done' variable is set, 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. A rising edge detection will set the 'Done' variable (and also a global variable), which will call programs 'Axis1' and 'Axis2':
When programs 'Axis1' and 'Axis2' are called, output5 is turned on.
If output5 is turned on, the '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: