I need your help
Hi guys.
In the PLCnext Project, I create 2 Program. With each one , I generates variable list.
so, Please explain to me about the use of program, instance variable.
I create a instanance at program1, In the code of program2, I saw it at variable list, but when i add it to code the error was "the variable ... not exist"
Please helpme. Thank you
Comments
Hello Manhkhuong,
please provide more information about the problems you are facing.
Did you have a look at the "Getting Started Tutorials" or the "Help" incluced in the PLCnext Engineer yet?
There is a description of the different variable kinds , local , external , Program Global, Ports ect.
kind regards,
Oliver
I can show you specific example.
I create 2 program with name as "CONVERT" and "CACULATOR".
In CONVERT program, I create some variable:" xRun" with Usage as instance ( or program), "xDone" with usage as external.
In "CACULATOR" program, I want to reuse those variable. With "xDone " Variable , it worked well.
with "xRun Variable i cant give it into program because the errror "the xRun variable is not exist" happen.
That is my problem.
Thank you.
Hello,
this is a normal behaviour. Variables with a usage set to instance or program can only be used in the program where they are declared.
Instance variables can be assigned for each instance of the same program. Program variables can be used inside the program and in function block instances used in that program.
In order to use variables also in other programs, they must be declared as external. Another way to exchange variables between programs is the use of port variables.
OK. thank for your supports.