4/13/2023 0 Comments Set st language![]() (Coil) END_VAR // Schedule the main program to be executed every 20 ms TASK Tick ( INTERVAL := t #20 ms ) PROGRAM Main WITH Tick : Monitor_Start_Stop END_CONFIGURATION PROGRAM Monitor_Start_Stop // Actual Program VAR_EXTERNAL Start_Stop : BOOL ON_OFF : BOOL END_VAR VAR // Temporary variables for logic handling ONS_Trig : BOOL Rising_ONS : BOOL END_VAR // Start of Logic // Catch the Rising Edge One Shot of the Start_Stop input ONS_Trig := Start_Stop AND NOT Rising_ONS // Main Logic for Run_Contact - Toggle ON / Toggle OFF - ON_OFF := ( ONS_Trig AND NOT ON_OFF ) OR ( ON_OFF AND NOT ONS_Trig ) // Rising One Shot logic Rising_ONS := Start_Stop END_PROGRAM Function block example ![]() 0 : BOOL // Digital output of the PLC (Address 0.0). 0 : BOOL // Digital input of the PLC (Address 0.0) ON_OFF AT % QX0. ![]() b_ON_OFF : BOOL // Global variable to represent a boolean. PLC configuration CONFIGURATION DefaultCfg VAR_GLOBAL b_Start_Stop : BOOL // Global variable to represent a boolean.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |