AnsweredAssumed Answered

Module database version, getting the right tag from the alias

Question asked by parasyn on Feb 4, 2016
Latest reply on Feb 4, 2016 by gregor

I have a pi ace calculation and an MDB that links alias to tags where the tags change rarely.  But I need to keep the definition of the old tags so that I can recalculate old data.

All my mdb structure is set up with a date of 1/1/1970.

Yesterday I added my first tag change version for 1/1/2016.

I use the following code.

 

 

public static PIACEPoint GetPIACEPoint(PIACEPoint point, string alias)
 {
 PIACEPoint pt = new PIACEPoint();
 pt = point;

 moduleOlderVersion = (PIModule)module.Version.Value(point.ExeTime, RetrievalTypeConstants.rtAuto); 
               
                // unfortunately the alias contains part of the path, need to strip the path off
 alias = alias.Substring(alias.IndexOf(@"\") + 1);

 pt.SetTag(Path, moduleOlderVersion.PIAliases[alias].DataSource.Name, TagAliasUsedType.TagAliasAsInput);

 return pt;
 }

 

Before I call this code, I can look at the piacepoint and see a structure called taginfo which contains the correct alias.

After I call this code, the taginfo structure is still there but the alias is replaced with the tagname.

I need the alias to stay in tact.

Is there a better way of finding the tag for the right module?

Outcomes