Page 1 of 1
create popup
Posted: Tue Aug 23, 2011 11:42 pm
by jeyaseelan
hi
i new to the ix developer, i need to clarify some doubts about in popup, for other hmi we create only one popup for one type of device for example if we have 5 manual DOL motor we create only one popup for 5 device and we pass the different tag to different motors at the runtime, for the same how to do here, Please anyone help me
regards
s jeyaseelan
Re: create popup
Posted: Wed Aug 24, 2011 9:33 am
by Ron L.
The only way I know to do this is using internal tags (tags without an address) and script. The script would go in the "Opened" and "Closed" events to copy the values between tags. The code would look like this:
Code: Select all
public partial class PopupScreen
{
void PopupScreen_Opened(System.Object sender, System.EventArgs e)
{
if (Globals.Tags.ScreenIDTag.Value == 0) {
Globals.Tags.InternalTag1.Value = Globals.Tags.Tag1.Value;
Globals.Tags.InternalTag2.Value = Globals.Tags.Tag2.Value;
}
else if (Globals.Tags.ScreenIDTag.Value == 1) {
Globals.Tags.InternalTag1.Value = Globals.Tags.Tag3.Value;
Globals.Tags.InternalTag2.Value = Globals.Tags.Tag4.Value;
}
}
void PopupScreen_Closed(System.Object sender, System.EventArgs e)
{
if (Globals.Tags.ScreenIDTag.Value == 0) {
Globals.Tags.Tag1.Value = Globals.Tags.InternalTag1.Value;
Globals.Tags.Tag2.Value = Globals.Tags.InternalTag2.Value;
}
else if (Globals.Tags.ScreenIDTag.Value == 1) {
Globals.Tags.Tag3.Value = Globals.Tags.InternalTag1.Value;
Globals.Tags.Tag4.Value = Globals.Tags.InternalTag2.Value;
}
}
}
- tag_list.JPG (36.51 KiB) Viewed 16231 times
- copy_tags_ex.JPG (82.74 KiB) Viewed 16231 times
In the button "Click" action for the button to open the popup screen you'll need to set the "ScreenIDTag".
- button_click_action.JPG (39.51 KiB) Viewed 16231 times
Re: create popup
Posted: Wed Aug 24, 2011 11:31 pm
by jeyaseelan
Hi Ron L
thank for your reply
i get some idea and i write the script in popup screen open condition, because that the real tags values not updated at time of popup open, when i close and open the popup then only i get the real tags values
i need continuous update when popup screen open
please help me how to do that/
Re: create popup
Posted: Thu Aug 25, 2011 9:20 am
by Ron L.
That is possible, with more scripting, but if this starts to get too complex, you might be better off just making lots of popup screens.
First you need to change the Tags with addresses to "Always Active".
- always_active.JPG (61.42 KiB) Viewed 16223 times
Then you would have to go to the "Script" section under tags and insert some code to the "ValueChanged" actions to update the internal tags.
- tags_valuechange.JPG (115.94 KiB) Viewed 16223 times
Re: create popup
Posted: Mon Aug 29, 2011 3:55 am
by jeyaseelan
hi ron l
again thanks for your replay, but i can't execute this Script for two popups because this script written in value changed when 1 st motor tags value change d the popup displayed the 1st motor value again when i click the 2nd motor button that time also the popup displayed the same value of 1st motor popup value,because the values are stored in the internal tags at the time of value changed, the popup displayed only last stored values for all motor popup
again sorry for disturbance please guide me
again thanks for your support
Re: create popup
Posted: Mon Aug 29, 2011 9:14 am
by Ron L.
I don't understand what you're asking. You're welcome to send me a copy of your project if you would like me to take a look.