PLUS+1 User Forum
PLUS+1 Tools => PLUS+1 GUIDE => Topic started by: bryantmorris on July 10, 2017, 02:32:40 PM
-
Hello all,
I've been using Plus+1 for a number of years now and as the time goes on I'm pushing plus+1 product into more complex applications. I tend to use call modules with ST in them as much as possible as I'm used to writing code on other PLC brands I use.
One thing that does annoy me in Plus+1 is the inability to use global variables that I can just reference from any ST function that I may be using. Is there any method of doing this in Plus+1?
Look forward to your response.
-
I work with Plus+1, Guide only. No other language.
I put my values in busses. - It is OK.
If you have a page, you have one or more local values on input or output.
You can use more than once the "Input" and the "Output"-symbol for the same value. So, here you don't need to draw a lot of lines to connect them.
Here, you can copy the "Input"or "Output"-symbols.
If you have questions about this, I could send you an example.
-
Thank you for the reply Marbek,
But your answer is basically no, it is not possible to have Global Variables as I asked about.
I understand it doesn't really fit in with the structure of the Plus+1 development environment, but it would be a nice feature to have in the future.
-
A global variable list is possible and can be used in the Structured Text environment (possibly the other IEC 61131-3 environments too). I've attached an image showing where you can make this list. It's in the Project Manager tree in the program name (bottom of the tree)-->PLCFile.xml-->Global Variables. Right click the Global Variables folder to insert the list.
-
Thank you Tom,
I will try what you said and see how it works.
-
Hi all,
How are global variables accessed in a POU using structured text? Is it a VAR_IN or a VAR_IN_OUT?
Let me know
-
I actually haven't made use of the global variable feature in GUIDE, but for other 61131-3 structured text usage the global variable is just use in the code without needing to be declared at all in the POU. So, basically just try using it.
-
Var_Global - Define global variables inside the Global Variables file
In your ST code, just simply reference the name defined in the Global Variables file. Use Ctrl+Space to bring up the wizard as you are typing to select the name from.
Just FYI, you can also use "Retain" after declaring a structure so the program doesn't forget it when the Plus+1 is turned off. "Var_Global Retain" for example
-
Hello,
The replies are correct. You declare the global variables in a list under Global Variables and then you just reference them in your code.
We have not got support for Var_Global Retain yet, sorry.
Stefan
-
How have we not got support for Retain? Isn't Retain a IEC function?
Any application that is IEC compliant I have ever used has the Retain function and they all work in the same way, the value is stored to memory when changed so in the event of a power off, it is remembered.
How do we achieve this in Plus+1?
-
I believe Retain does work in the ST POU's... just not in the Global Variable List.
-
Any news on supporting retain variables in Plus+1 from the Danfoss guys?
-
I believe retain variables do work in ST. Are you using the latest version of GUIDE?
-
Hi all!
VAR RETAIN works in ST in PLUS+1 GUIDE but not for GLOBAL variables.
You declare RETAIN variables by adding the keyword RETAIN behind the keyword for the type of variable (VAR) in the declaration part of programming objects.
Examples
In a POU:
VAR RETAIN
iRem1 : INT;
END_VAR
I hope this helps!
Best regards
Nilla
PLUS+1 Helpdesk team
-
Hi all!
Some clarification to my latest statement. As stated in the Release notes for PLUS+1 GUIDE v6.0.8;
"Limited support for RETAIN variables. Only local variables of basic integer types in function block POUs called directly from graphical code are currently supported."
Best regards
Nilla
PLUS+1 Helpdesk team