I have many variables I need to keep track of, so I decided early on that using structures would be the best way to organize things. I have several arrays of structures defined as global variables:
VAR_GLOBALÂ Comp:ARRAY[0..UBound_CompNum]OFstruct_Component;Â Â Â Â Â Â (*Non-retentivecomponentvariables*)Â CompR:ARRAY[0..UBound_CompNum]OFstruct_Component_Retentive;Â Â (*Retentivecomponentvariables*)Â stGlobal:Â struct_Component;Â Â Â (*justfortesting*)END_VAR
Now I want to figure out how to use parameter manager to allow sharing these variables over the CAN network. I've successfully created a "Template parameter list" based on a structure, and I can even create an "Instance parameter list" using that template -- but only if the "Base Variable" is in a POU. For example, if I define a structure "stComp" in PLC_PRG, then I can use "PLC_PRG.stComp" as the base variable for a new instance parameter list. However, if I instead define "stComp" as a Global variable, then I can NOT use "stComp" as the base variable. What am I doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, it looks like I have the global variable problem solved. Simply by putting a period in front of the global variable name it was accepted as the "base variable".
But now that I have that set up, I'm not getting any communication of the variables between the two PLCs. I've set up identical templates and instances in the Parameter Manager section for both PLCs -- with one having all components as "read only" and the other having all components as "write only". How do I initiate a transfer of data? I initially guessed that transfer was automatic and happened whenever a variable was changed or maybe requested -- but that doesn't appear to be the case.
Is this just another case of me missing something really simple?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have many variables I need to keep track of, so I decided early on that using structures would be the best way to organize things. I have several arrays of structures defined as global variables:
Now I want to figure out how to use parameter manager to allow sharing these variables over the CAN network. I've successfully created a "Template parameter list" based on a structure, and I can even create an "Instance parameter list" using that template -- but only if the "Base Variable" is in a POU. For example, if I define a structure "stComp" in PLC_PRG, then I can use "PLC_PRG.stComp" as the base variable for a new instance parameter list. However, if I instead define "stComp" as a Global variable, then I can NOT use "stComp" as the base variable. What am I doing wrong?
Well, it looks like I have the global variable problem solved. Simply by putting a period in front of the global variable name it was accepted as the "base variable".
But now that I have that set up, I'm not getting any communication of the variables between the two PLCs. I've set up identical templates and instances in the Parameter Manager section for both PLCs -- with one having all components as "read only" and the other having all components as "write only". How do I initiate a transfer of data? I initially guessed that transfer was automatic and happened whenever a variable was changed or maybe requested -- but that doesn't appear to be the case.
Is this just another case of me missing something really simple?