Hi
I'm experimenting with a T7B Panel, is it possible to edit existing or add new tags at runtime?
Thanks
Add new tags at runtime
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Add new tags at runtime
No, you can not add new tags easily at runtime, nor do not know why you would want to. A tag is a variable with a global scope in iX Developer. You can use C# variables for things like for loops.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
-
- Posts: 13
- Joined: Mon Mar 11, 2013 8:48 am
Re: Add new tags at runtime
What about if you were to edit a Tag's Item ID in real time to result in a different location in your controller for a value?
(i.e. I have a controller A that has point a: 1,1,1 and I one to dynamically switch to point b: 1,2,1 to get the value from point b instead of point a).
SFP_DATA1.GlobalDataSubItems[0].DataItems[0].ItemID = "98," + Globals.Tags.sys_SFP_Selection.Value.String + ",1";
(i.e. I have a controller A that has point a: 1,1,1 and I one to dynamically switch to point b: 1,2,1 to get the value from point b instead of point a).
SFP_DATA1.GlobalDataSubItems[0].DataItems[0].ItemID = "98," + Globals.Tags.sys_SFP_Selection.Value.String + ",1";
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Add new tags at runtime
That would over complicate the project. Why not just have multiple tags and have them all mapped to different memory addresses? The issue with dynamically changing tag<->PLC register mappings is that it is not easy to know which tag is mapped to which register during runtime.
You can use screen aliasing to switch which tags a particular screen is using at any one time.
If you have lots of tags and are worried about polling your PLC to much I could see wanting to change the tag<->PLC register mapping. Since iX dev only polls tags that are set to Always Active or on a screen, PLC data transfer is normally not an issue.
You can use screen aliasing to switch which tags a particular screen is using at any one time.
If you have lots of tags and are worried about polling your PLC to much I could see wanting to change the tag<->PLC register mapping. Since iX dev only polls tags that are set to Always Active or on a screen, PLC data transfer is normally not an issue.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
-
- Posts: 13
- Joined: Mon Mar 11, 2013 8:48 am
Re: Add new tags at runtime
Well primarily the main purpose was to create a set of tags for a particular set of data points that could be dynamically readdressed. This would allow for generating something that could be more universal across multiple controllers of varying type where point addresses are structured the same but are located in different aspects of a controller hierarchy. (Yup I know, clear as mud .)
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Add new tags at runtime
To do that, I would create a project with multiple controllers. You can then assign a memory address to each controller in the Tag screen. The active control's mapping will be used. Then by changing the active controller, you will change the mappings.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Add new tags at runtime
Thanks Mark,
I think we can utilize the "change controller" object in association with our own code to handle the requirement.
Cheers
I think we can utilize the "change controller" object in association with our own code to handle the requirement.
Cheers