plc.myforum.ro Forum Index plc.myforum.ro
PLCs users www.plc.myforum.ro!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I get Filename / compile info / projekt name

 
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> Other PLCs Reg. U
View previous topic :: View next topic  
Author Message
mojo
Senior
Senior


Joined: 01 Oct 2011
Posts: 2404

PostPosted: 14/12/2011 19:25    Post subject: How can I get Filename / compile info / projekt name Reply with quote

Hi all,
For a CX1020 CE ...Is it possible to get...

PLC Flilename.
PLC Compile date
Twincat Compiler version.
Thanks,
mojo
Back to top
View user's profile Send private message
rott
Senior
Senior


Joined: 23 Aug 2011
Posts: 2266

PostPosted: 14/12/2011 19:29    Post subject: Project info... Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> Other PLCs Reg. U All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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