CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Oct 18, 2017 11:59 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Jun 08, 2016 8:31 pm 
Offline

Joined: Mon Apr 28, 2014 7:05 pm
Posts: 81
Hi all,

Is it possible to call a method from a visualisation?


Top
   
PostPosted: Fri Jun 10, 2016 3:18 pm 
Offline

Joined: Mon Apr 28, 2014 7:05 pm
Posts: 81
Hello?


Top
   
PostPosted: Mon Jun 13, 2016 8:02 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2160
Hi,

have you tried the execute ST-Code option?

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Jun 13, 2016 12:12 pm 
Offline

Joined: Mon Apr 28, 2014 7:05 pm
Posts: 81
Yes I tried and could not make it work.

Maybe I did it wrong. Is it supposed to work?


Top
   
PostPosted: Mon Jun 13, 2016 3:09 pm 
Offline

Joined: Sat Apr 16, 2016 5:23 pm
Posts: 64
When I tried this I got the following error:

"The input action Execute ST-Code has statements which are no assignments. This feature is only supported for the target visualization."

_________________
Rick


Top
   
PostPosted: Fri Mar 10, 2017 5:25 pm 
Offline

Joined: Thu Jan 26, 2017 5:00 pm
Posts: 16
I'm assuming you are trying to assign your text variable a value?

If you are, you need to set-up your text variable as a global variable and then put '%s' for strings or '%5.2f' for numbers in the Text property. The properties section is found in the visualization.

Then in the Execute ST Code put something like 'Text_Variable:="STRING";' If you are trying to call a method whenever the text box is clicked, you need to write something like 'ClassObject.Method();' in order to call methods from function blocks inside the Execute ST Code command.

Quick note about the Execute ST Code for input configuration, you can't press enter for a new line without exiting the input configuration. I recommend copying and pasting the code you want to put in there as a way to compensate for this bug.


Top
   
PostPosted: Fri Mar 10, 2017 11:46 pm 
Offline

Joined: Tue Dec 03, 2013 11:52 pm
Posts: 38
rmoudy wrote:
Quick note about the Execute ST Code for input configuration, you can't press enter for a new line without exiting the input configuration. I recommend copying and pasting the code you want to put in there as a way to compensate for this bug.

Have you tried pressing CTRL + ENTER for a new line? This has always worked for me.


Top
   
PostPosted: Mon Mar 13, 2017 8:38 pm 
Offline

Joined: Thu Jan 26, 2017 5:00 pm
Posts: 16
Comingback4u wrote:
Have you tried pressing CTRL + ENTER for a new line? This has always worked for me.


No, I wasn't aware that CTRL + ENTER is for entering new lines for the 'Execute ST Code'. Thanks for the tip!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 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