1 Reply Latest reply on Oct 27, 2018 2:07 AM by Dan Fishman

    PI SDK: Replicating DataLink's "PIAliasToTag" functionality


      (I'm using PI SDK, even though it's depreciated. I will not be able to use the AF SDK).


      I am currently translating a VBA-based PI tool into C#, and I'm stuck at replicating DataLink's "PIAliasToTag" functionality. I can't find a similar function in the SDK manual, and the Excel tool is performing this action via Application.Run("PIAliasToTag").


      Essentially, I need to know what tag(s) is/are associated with Alias "X" in unit/module "Y" between times "dateStart" and "dateFinish".


      I've tried to approach the issue from a different conceptual angle (e.g., using PIModules["Y"].PIAliases), but my efforts have been fruitless as I can't really find any easy way to look at a particular alias for a particular time period.


      What options exist for searching aliases?



        • Re: PI SDK: Replicating DataLink's "PIAliasToTag" functionality
          Dan Fishman

          There is the PSDKDlg.AliasSearch which can be used for searching.  From what I understand you are using module versions.  To get all of the versions between a time you can try:

           PIModuleVersionList modules = module.Version.Values(startTime, endTime, BoundaryTypeConstants.btInside);


          You can also might find the version.next or Version.Value methods helpful.  I don't recall a method to search for alias besides using the dialog. 

          2 of 2 people found this helpful