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.

Appendix F: Command Line-/Command File<br />

history for each particular object. (see above: check out)<br />

The defined comment will be stored with the check-in-action in<br />

the version history for each particular object.<br />

Keywords for the command parameters:<br />

The following keywords, enclosed in "$", can be used in command parameters:<br />

$PROJECT_NAME$ Name of the current CoDeSys project (file name without extension<br />

".pro", e.g. "project_2.pro")<br />

$PROJECT_PATH$<br />

Path of the directory, where the current CoDeSys project file is<br />

(without indication of the drive and without a backslash at the end,<br />

e.g. "projects\sub1").<br />

$PROJECT_DRIVE$ Drive, where the current CoDeSys project is (without backslash at<br />

the end, e.g. "D:")<br />

$COMPILE_DIR$<br />

$EXE_DIR$<br />

Compile directory of the current CoDeSys project (with indiciation of<br />

the drive and without backslash at the end, e.g.<br />

"D:\codesys\compile")<br />

Directory where the codesys.exe file is (with indication of the drive<br />

and without backslash at the end, e.g. D:\codesys)<br />

Example of a command file:<br />

A command file like shown below will open the project file ampel.pro, will then load a watch list, which<br />

was stored as w.wtc, will then start the application program and write – after 1 second delay - the<br />

values of the variables into the watch list watch.wtc (which will be saved) and will finally close the<br />

project.<br />

file open C:\projects\CoDeSys_test\ampel.pro<br />

query off ok<br />

watchlist load c:\work\w.wtc<br />

online login<br />

online run<br />

delay 1000<br />

watchlist read<br />

watchlist save $PROJECT_DRIVE$\$PROJECT_PATH$\w_update.wtc<br />

online logout<br />

file close<br />

This command file will open the project ampel.pro, will load an existing watchlist w.wtc, will start the<br />

application program, after 1 second will write the variables values to the watch list w_update.wtc,<br />

which will be saved in the directory "C:\projects\CoDeSys_test" and then will close the project again.<br />

A command file is called in a command line like shown here:<br />

"" /cmd ""<br />

CoDeSys V2.3 10-73

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

Saved successfully!

Ooh no, something went wrong!