Vai al contenuto

Using the IDE – Quick Start

The following steps show you how to create, run and debug a simple GF_ProjectVX code PLC program.
  • When a GF_ProjectVX code is started for the first time, not all windows and toolbars are shown. You can customize GF_ProjectVX code’s workspace through the View Menu.
Using the IDE – Quick Start-image_0
  • In order to create a new project, select the item New program from the menu Project > New object.
Using the IDE – Quick Start-image_0Select the ST language, insert the new project name (for example, Main) and click OK.It is also possible to assign here the program to one of the available tasks. Using the IDE – Quick Start-image_0GF_ProjectVX code shows now the editor window of the Main program object. On the top of the window there is the local variables editor. The variables editor allows to add, remove, copy and paste variable definitions. Using the IDE – Quick Start-image_0The textual source code editor is placed in the bottom part of the window.
  • Insert a new local variable by clicking the Insert record button in the Project bar. Alternatively, you can use the Insert option of the Variables menu.
Using the IDE – Quick Start-image_0
  • Edit the name (for example, Counter) and the type of the variable. A double-click in the type field opens the type selection dialog. Choose the INT data type.
  • Implement a simple counter in ST language, as shown below.
Using the IDE – Quick Start-image_0In order to be executed, the program Main has to be assigned to a task. In the Workspace window, right-click on the Slow task and select the Add program option. The Object browser window pops up. Using the IDE – Quick Start-image_0
  • Select the Main program and click OK. The picture below shows the Workspace window after the successful completion of the operation.
Using the IDE – Quick Start-image_0
  • Select Simulation mode from Debug menu.
Using the IDE – Quick Start-image_0Rename your VPLC1 workspace as PLCExampleWsp, and then click OK. Using the IDE – Quick Start-image_0
  • VPLC1 is a software which emulates a simple programmer controller provided with digital and analogue I/O. It is possible to interact with simulator as explained in GF_ProjectVX _sim manual or briefly in Resources tab.
The status of VPLC1 I/O is available in GF_ProjectVX code as the Target variables listed in the Library window. Using the IDE – Quick Start-image_0
  • With GF_ProjectVX code connect to VPLC1 through the apposite button on the toolbar.
Using the IDE – Quick Start-image_0
  • Press F7 ((or select the menu option Project-Compile) to compile the application. Verify that the compilation ends with 0 warnings – 0 errors, otherwise correct the errors and compile again.
  • Download the code by means of the appropriate toolbar command.
Using the IDE – Quick Start-image_0PLC is now running on VPLC1. You can see the GF_ProjectVX code bottom bar indicating Source ok – Connected. Using the IDE – Quick Start-image_0
  • Open the Watch window through the View menu, then select the variable in the text editor with a double click and drag and drop it into the Watch window.
The Watch window should display the value of the Counter variable which should increment continuously Using the IDE – Quick Start-image_0You are at the end of this very simple but complete (edit-compile-download-debug) working session with GF_ProjectVX code.Further steps you should take in order to acquire a deeper knowledge of the tool include the use of the other languages, function & function blocks, global variables, libraries, real time debugging and so on. Refer to the following sections of this manual to obtain the necessary information.