24.01.2015 Views

PLC Programming

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DDE communcation with the GatewayDDE Server...<br />

.GlobVar1 (* Reads the global variable GlobVar1 *)<br />

Linking variables using WORD<br />

Start the GatewayDDEServer before activating the inquiry in WORD.<br />

In order to get the current value of the variable TEST from the POU <strong>PLC</strong>_PRG through the DDE<br />

interface in Microsoft WORD, a field (e.g., the date) must be inserted in WORD ('Insert' "Field"). Now<br />

when you click on the field with the right mouse button and select the command "Toggle Field Codes"<br />

you can change the field function for the chosen text. In our example, this would look as follows:<br />

{ DDEAUTO GATEWAYDDESERVER "BSP.PRO" "<strong>PLC</strong>_PRG.TEST" }<br />

Click on the field with the right mouse button again, then click on "Update Field" and the desired<br />

variable content appears in the text.<br />

Linking variables using EXCEL<br />

Start the GatewayDDEServer before activating the inquiry in EXCEL.<br />

The following must be entered in Microsoft EXCEL before you can assign a variable to a cell.<br />

=GATEWAYDDESERVER|!<br />

Beispiel:<br />

=GATEWAYDDESERVER|'bsp.pro'!'<strong>PLC</strong>_PRG.TEST'<br />

When you click on 'Edit' then "Links", the result for this link will be:<br />

Type: CODESYS<br />

Source file: C:\CODESYS\PROJECT\IFMBSP.PRO<br />

Element: <strong>PLC</strong>_PRG.TEST<br />

{ DDEAUTO GATEWAYDDESERVER "BSP.PRO" "<strong>PLC</strong>_PRG.TEST" }<br />

Command line options for the GatewayDDEServer<br />

If the GatewayDDE Server is started by a command line, the following options can be attached:<br />

/n The info dialog does not appear<br />

automatically at starting<br />

/s Display of the dialog window /s=h<br />

/s=i<br />

/s=m<br />

/s=n<br />

No<br />

minimized (icon)<br />

maximized<br />

normal<br />

/c Configuration file to be load automatically l /c=<br />

/o Go online with the selected configuration<br />

(autoload or defined by "/c=")<br />

Example:<br />

Command line:<br />

GATEWAYDDE /s=i /c="D:\DDE\conf_1.cfg"<br />

The GatewayDDE Server will be started, the dialog window will appear as an icon, the configuration<br />

which is stored in the file conf_1.cfg will be loaded.<br />

9-4 CoDeSys V2.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!