6 Replies Latest reply on Jun 25, 2010 9:26 AM by hanyong

    Case sensitive tag names

    massuthe

      Hi,

       

      I am using the PI SDK to create tags. However, the following code snippet throws an exception when I want to create two different tags with the names "foo" and "Foo":

      
      

      PIPoint point;

      point = _piServer.PIPoints.Add("foo", "classic", PointTypeConstants.pttypString, null);
      try
      {
        point = _piServer.PIPoints.Add("Foo", "classic", PointTypeConstants.pttypString, null);
      }
      catch (System.Runtime.InteropServices.COMException comExc)
      {
          Console.WriteLine(" Warning: " + comExc.Message + " (Code: " + comExc.ErrorCode + ")");
      }

       

       

      gives me the output:

      
      

      Warning: Point with this tag name already exists.  Foo (Code: -2147220429)

       

      Any solutions?

       

      What about having language special characters, like Polish or German letters, in a tag name? Does this work (somehow)?

        • Re: Case sensitive tag names
          Asle Frantzen

          Hi.

           

          I don't have a solution, but I believe it is correct that pi point naming is case-insensitive!

            • Re: Case sensitive tag names
              MichaelvdV@Atos

              I also believe PI tagnames are case insensitive.

               

              Why do you want to have case-sensitive tagnames? What is the application in your case?

                • Re: Case sensitive tag names
                  massuthe

                  Hi,

                   

                  I want to use the PI SDK to create, change, and delete PI tags and its timed values dynamically, determined by raw data that come from, e.g., a (MS SQL) database (and other sources).

                   

                  Unfortunately, the identifiers of the tags in my app are UTF-8 strings. So I get several "the point does already exist" exceptions when trying to bring a time series from my database to PI.

                   

                  Restrictions of the PI Server would mean that I have to artificially restrict the capabilities of my existing time series management systems :-( At least if I want to have full compatibility between them.

                  • Re: Case sensitive tag names
                    Michael

                    From the manual

                     

                    "Case Sensitivity
                    The system preserves the case of all strings, including the tag, but searches are not casesensitive.
                    For example, a string entered as BatchStart is stored exactly as entered. Subsequent
                    retrievals of this string retain the same capitalization. A search for this string does not require
                    that the capitalization match."

                     

                     

                     

                    You can call me a traditionalist, but I still prefer ASCII for such identifiers. If you can add such restrictions to your source system, this would be the easiest. Otherwise you can create a naming convention and store the original name in one of the tag attribs.

                     

                    For the "normal" user "foo" and "Foo" is anyway the same.

                     

                    Michael

                     

                     

                      • Re: Case sensitive tag names
                        MichaelvdV@Atos

                        Michael

                        Otherwise you can create a naming convention and store the original name in one of the tag attribs.

                         

                        I don't think string attribute fields support UTF-8 (could be wrong here).

                         

                        IMO it is better for a system to not use case sensitive identifiers, because they can be quite confusing. So, as for having UTF-8 tag identifiers, that would be a real enhancement, but case insensitive search is a good thing (straight forward, not confusing)

                          • Re: Case sensitive tag names
                            hanyong

                            What I know is the PI server uses multi-byte characters to store configuration information.

                            Peter Massuthe

                            What about having language special characters, like Polish or German letters, in a tag name? Does this work (somehow)?

                            PI SDK handles the string information as UTF-16 strings, and that gets converted before it sends the information to PI. The conversion is done using the system codepage settings. Reverse is true when reading information out from the PI Server, PI SDK gets multi-byte character string and converts it to UTF-16. If the codepage settings is the same on the clients that is writing in and reading out from the PI server, then the characters should get converted correctly. 

                             

                            I have seen users have part of their tagnames with Chinese characters. There are some limitations though, and more information is available in the whitepaper "Localization with PI" available in the Library section.

                             

                            I believe there are development plans for PI server to use UTF-16 in the future. Just not too sure when will that be coming.