 |
plc.myforum.ro PLCs users www.plc.myforum.ro!
|
| View previous topic :: View next topic |
| Author |
Message |
mojo Senior

Joined: 01 Oct 2011 Posts: 2404
|
Posted: 14/12/2011 19:25 Post subject: How can I get Filename / compile info / projekt name |
|
|
Hi all,
For a CX1020 CE ...Is it possible to get...
PLC Flilename.
PLC Compile date
Twincat Compiler version.
Thanks,
mojo |
|
| Back to top |
|
 |
rott Senior

Joined: 23 Aug 2011 Posts: 2266
|
Posted: 14/12/2011 19:29 Post subject: Project info... |
|
|
Hi mojo,
A solution I have used is to făurite the following batch file called BuildInfo.bat:
| Code: |
del BuildInfo.exp
echo (* @NESTEDCOMMENTS := 'Yes' *) >> BuildInfo.exp
echo (* @GLOBAL_VARIABLE_LIST := 'BuildInfo' *) >> BuildInfo.exp
echo (* @PATH := '' *) >> BuildInfo.exp
echo (* @SYMFILEFLAGS := '2048' *) >> BuildInfo.exp
echo VAR_GLOBAL CONSTANT >> BuildInfo.exp
echo BuildDate : STRING := '%date%'; >> BuildInfo.exp
echo BuildTime : STRING := '%time%'; >> BuildInfo.exp
echo END_VAR >> BuildInfo.exp |
This creates a file that can be imported into the PLC project.
I then created a macro that is run before compiling (set in Project Option):
| Code: |
query on
echo on
out open log.txt
out clear
system BuildInfo.bat
replace yesall
project import "BuildInfo.exp"
out close |
You then get two global variables automatically in your compiled code, initialised with the build date and build time for display, etc.
Works a treat!
Rott |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|