CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Fri Jul 28, 2017 6:05 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Execute on Visu open
PostPosted: Wed Dec 14, 2016 12:08 pm 
Offline

Joined: Tue Dec 03, 2013 10:51 am
Posts: 2
Hi,

I was wondering whether there is a way of executing code on when a specific visu has been opened.

E.g., I want to pass a visu a DATE_AND_TIME, but I need to use DTSplit on it so I can populate various elements with the year, month, day, etc.

Note - I'm using CODESYS 3.5.5.4, which has a bug where I cannot initialise visu variables properly, and I cannot upgrade to SP9 at this moment in time.


Top
   
 Post subject: Re: Execute on Visu open
PostPosted: Thu Dec 15, 2016 9:51 pm 
Offline

Joined: Tue Dec 03, 2013 11:52 pm
Posts: 33
I use 3.5.5.4 also but I'm not aware of the bug you are talking about so not sure if this will help.

If you open up your Visualization Manager and check the box that says "Use CurrentVisu Variable" you can setup a trigger to run like:

Code:
//sudo code not checked
var
   fb_PageCheckTrigger   :   R_TRIG;
   sPage            :   STRING   :=   'Home';
end_var

fb_PageCheckTrigger(CLK:= VisuElemes.CURRENTVISU = sPage);
IF fb_PageCheckTrigger.Q THEN
   //Code to execute when page is open
END_IF


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited