Vai al contenuto

Step 3: creation of the control program

Double-click the PLC icon, then single-click the Edit PLC Application button in the centre window.The PLC GF_ProjectVX code programming tool will be activated.We will now insert the control programme.Single-click Project – New object – New program on the top menu. Step 3: creation of the control program-image_0Select LD in the Language selection.Write on the “Name” filed the name of the program: CNT_MOTOR.Select on the combo box “Task – Assign to” the desidered position (i.e. Normal).Press OK.CNT_MOTOR will be added to the “Normal” list in the Project window and will be opened in the edit window.The edit window is divided into two parts:
  • the variables editor at the top
  • the Ladder chart at the bottom.
We now add support variable I_OUT_RUN (BOOL), which will contain the intermediate calculation value of the motor control output.The bottom window shows a branch.Add a contact –| |– and a Set coil –(S)–Position on the contact and type IN_START on the contact name.Position on the set coil an type I_OUT_RUN.Add a branch to the ladder.Add a contact –| |– and a Reset coil –(R)–Position on the contact and type IN_STOP on the contact name.Position on the set coil and type I_OUT_RUN.Add a branch to the ladder.Add two contact –| |– and a Coil –( )–Position on the first contact and type IN_EMERGENCY on the contact name.Position on the second contact and type I_OUT_RUN on the contact name.Position on the coil and type OUT_RUN. Step 3: creation of the control program-image_0Compile the project with key F7.Connect to the target via icon (Go Online/Offline) and download the program . Respond Yes to the question that will be asked. Step 3: creation of the control program-image_0 Step 3: creation of the control program-image_1On the top menu select View – Tool windows – Watch list to show the watch window.Open the CARDS_IO and drag and drop all the variables (IN_START, IN_STOP, IN_EMERGENCY, OUT_RUN) from the project list to the watch list window. Repeat this operation with the variable added on CNT_MOTOR (I_OUT_RUN). Step 3: creation of the control program-image_0Double-click the names of the variables in the watch window to modify the content of the variables and simulate the behaviour of the process.To go out press again the icon (Go Online/Offline) and through menu File, select Exit. Step 3: creation of the control program-image_0Alternatively you can compile and transfer the PLC through the deployment window. In this case the system may to be not download, requiring a transfer firmware. (See Step 5)