Releasing internal tags

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
KurtisR
Posts: 6
Joined: Mon Aug 29, 2011 11:20 pm

Releasing internal tags

Post by KurtisR »

Hi Ron,

I have an issue with my application. I have created a function to populate internal tags with external tag information. The function then calls the popup that is mapped to the internal tags. The idea is I can then call this function throughout my application. I have multiple functions - one for each external tag set I have.

Code: Select all

		public void Get_H2O_Temp()
		{
Globals.Tags.Alarm_HiHi_Setpoint = Globals.Tags.H2O_TEMP_HHSP;
Globals.Tags.Alarm_Hi_Setpoint = Globals.Tags.H2O_TEMP_HSP;
Globals.Tags.Alarm_Low_Setpoint = Globals.Tags.H2O_TEMP_LSP;
Globals.Tags.Alarm_LowLow_Setpoint = Globals.Tags.H2O_TEMP_LLSP;
Globals.Tags.Alarm_HiHi_Debounce = Globals.Tags.H2O_TEMP_HHDB;	
Globals.Tags.Alarm_Hi_Debounce = Globals.Tags.H2O_TEMP_HDB;	
Globals.Tags.Alarm_Low_Debounce = Globals.Tags.H2O_TEMP_LDB;
Globals.Tags.Alarm_LowLow_Debounce = Globals.Tags.H2O_TEMP_LLDB;
Globals.Tags.Alarm_HiHi_SDEnable = Globals.Tags.H2O_TEMP_HHEN;			
Globals.Tags.Alarm_LowLow_SDEnable = Globals.Tags.H2O_TEMP_LLEN;
Globals.Tags.Alarm_Name.Value = "H2O Temp";
Globals.Analog_Popup.Show();
		}
		
public void Get_CARB_IPRESS()
		{
Globals.Tags.Alarm_HiHi_Setpoint = Globals.Tags.CARB_IPRESS_HHSP;
Globals.Tags.Alarm_Hi_Setpoint = Globals.Tags.CARB_IPRESS_HSP;
Globals.Tags.Alarm_Low_Setpoint = Globals.Tags.CARB_IPRESS_LSP;
Globals.Tags.Alarm_LowLow_Setpoint = Globals.Tags.CARB_IPRESS_LLSP;
Globals.Tags.Alarm_HiHi_Debounce = Globals.Tags.CARB_IPRESS_HHDB;	
Globals.Tags.Alarm_Hi_Debounce = Globals.Tags.CARB_IPRESS_HDB;	
Globals.Tags.Alarm_Low_Debounce = Globals.Tags.CARB_IPRESS_LDB;
Globals.Tags.Alarm_LowLow_Debounce = Globals.Tags.CARB_IPRESS_LLDB;
Globals.Tags.Alarm_HiHi_SDEnable = Globals.Tags.CARB_IPRESS_HHEN;			
Globals.Tags.Alarm_LowLow_SDEnable = Globals.Tags.CARB_IPRESS_LLEN;
Globals.Tags.Alarm_Name.Value = "Carb Input Press";
Globals.Analog_Popup.Show();			
		}
The functions works great - the first one I call. However all following times i call a different function (other than the first one i call on project start) the internal tags are still mapped to the first set of external tags. For example - with the above code if I call Get_H2O_Temp first then I can control the tags correctly in the controller. However when I call Get_CARB_IPRESS afterwards the internal tags are still linked to the H2O_TEMP_xxx.

I am sure the correct function is being called because there is a text box displaying the "Globals.Tags.Alarm_Name.Value" string and it is updating correctly.

Is there some property of the internal tags that only allow them to be set once? Or should I have some initialize type command on the popup window close event that would release the link to the external tag?

Thank you,
Kurtis

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: Releasing internal tags

Post by Ron L. »

I'm fairly sure there was no intention by the developers that Tag class instances be allowed to be copied to replace other Tag class instances. I've always used the .Value property of tags to exchange data back and forth between different tags.

I will pass your question on to my counterparts and Sweden to see if they have any additional information.

The way I would've implemented the popup screen your describing would have used the Screen Opened and Closing actions. The code would look something like this in the Popup Screen.

Code: Select all

void Screen1_Opened(System.Object sender, System.EventArgs e)
		{
			if (Globals.Tags.IsHT2Temp.Value == 1) {
				Globals.Tags.Alarm_HiHi_Setpoint.Value = Globals.Tags.H2O_TEMP_HHSP.Value;
			}
			else if (Globals.Tags.IsCarbIpress.Value == 1) {
				Globals.Tags.Alarm_HiHi_Setpoint.Value = Globals.Tags.CARB_IPRESS_HHSP.Value;
			}			
		}
		
		void Screen1_Closing(System.Object sender, System.ComponentModel.CancelEventArgs e)
		{
			if (Globals.Tags.IsHT2Temp.Value == 1) {
				Globals.Tags.H2O_TEMP_HHSP.Value = Globals.Tags.Alarm_HiHi_Setpoint.Value;
			}
			else if (Globals.Tags.IsCarbIpress.Value == 1) {
				Globals.Tags.CARB_IPRESS_HHSP.Value = Globals.Tags.Alarm_HiHi_Setpoint.Value;
			}	
			
		}
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

KurtisR
Posts: 6
Joined: Mon Aug 29, 2011 11:20 pm

Re: Releasing internal tags

Post by KurtisR »

Thanks for the reply.

I seen the other topic on here for using popup and it does make sense. It would be cumbersome though to have to assign a pointer to each tag group I need to use in popup. As well as the open/close events of the popup would have a massive amount of scripting in each ;)

I appreciate the help and hopefully Sweden can shed some light on if this is possible or if my method is not possible. It would seem like it is possible as it works for the first tag set assigned.

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: Releasing internal tags

Post by Ron L. »

According to the developers, there is no support for setting a tag to an instance of another tag.

Index addressing (which I didn't mention before) is another option that the current software has. This is documented in section 4.9 of the iX Developer Reference Manual.

https://www.beijerelectronics.com/API/S ... 3D3C1751/1
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

Post Reply