Global Variable shows 0.0 on PS2 (Freelance 2016)
we have recently installed a second PS (800F) on our site, and wanted to use some variables from PS1 to controll PS2.
so in a fbd on PS1 we read the REAL value from a local variable and wrote it to a REAL global variable located on PS2. so far so good, the Global variable shows the same value as the local variable in PS1
we then created a new fbd on PS2 and inserted the global variable. if i hover the mouse pointer over it it shows the correct value (1200.0).
but here is the problem: the line from the variable shows 0.0, even though the value of the variable is 1200.0.
any idea what we did wrong?
would be nice if you can attach screenshot via next answer to get clear picture,
usually if in commissioning mode variable shows value then line connecting that variable to another pin of function block or any other variable will show value, too. by hovering over mouse on the line. But I always rely by adding variable in value window and if that show value in value window then it's variable is receving a value,
via right click on variable and select enter variable option and say ok. even this can be done for lines, but lines are not permanent in value window if user goes offline and again comes back online, lines are forgotten. anyway that is other topic.
By the way if PS1 and PS2 both are in same project, then by enabling/making those variable as global variable you can call in or use directly same variable in another controller, No need to pass value in local variable, can save some memory :)
to make variable global, in variable list export those variable, in column 'X' just write 'Y' instead of 'N' and one pop up window will appear, select change option there and now those variables can be accessed/used in any controller across the project.
First we should clarfy one thing: there are no "global" or "local" variables. The only difference is "latcom export". Latcom means the value of this variable is sent from the station who hosts this one to all other stations. This results the variable can be read everywhere and write only on the hosting station.
So if you say "... in ... PS1 we ... wrote it to a ... variable located on PS2." this cannot work. This should not even become plausible. (Maybe new bug in 2016?)
You should locate your "global" variable in PS1 and select "export". After this you can read this variable in PS2 too.