3 Replies Latest reply on Feb 8, 2012 2:30 PM by gkrueger

    Any way to set a null tag reference for a PB Value object using the .SetTagName method?

    gkrueger

      I'm creating some scripts to dynamically update some Value objects on a display.  But there are cases when some of the objects may not have a tag defined for the unit I'm referencing.  Is there a way to set a Value object's tag property to null so that it doesn't display anything?

       

      I have a work around where I created a Dummy tag on the PI server and set it to that.  It's a lab tag that I set to read "No Alias Configured" and that workaround works OK, but I'd like a cleaner solution that doesn't rely on a special tag that I have to ensure no one changes, deletes, etc.

       

      -Greg

       

      P.S. I hope I'm not wearing out my welcome on the forum, I appreciate all the feedback from the members...just have a lot of questions as I'm digging deeper into my current project (my first one, as you can probably tell, and I'm the only PI guy at my company!).

        • Re: Any way to set a null tag reference for a PB Value object using the .SetTagName method?

          As far as I know you can't set the Value symbol to have no defined datapoint, it has to have something even if it doesn't resolve to a valid datapoint.  You can either use your dummy tag or set the tag to a made up one, e.g. \\localhost\somemadeuptagname, and what you should see is "No Data".  Or you could just use a PI Calculation dataset (whose scope is the display it is contained within) where the expression reads "Not Defined" or " " (a space in quotes thus nothing is displayed).

           

          However, it may just be a simpler to toggle the Visible property via your VBA.

           

          I wonder, are you replicating functionality of Element Relative Displays?

           

          You are very much welcome on vCampus and the more questions the better!  Your company has over 1,000 PI professionals by proxy

            • Re: Any way to set a null tag reference for a PB Value object using the .SetTagName method?
              andreas

              Rhys @ Wipro

              I wonder, are you replicating functionality of Element Relative Displays?

               

               

              that is exactly what I thought as well when reading the post. Gregory - can you elaborate a bit more on what you are trying to achieve, so that we might come up with a better solution? There are virtually hundreds of PI guys here

                • Re: Any way to set a null tag reference for a PB Value object using the .SetTagName method?
                  gkrueger

                  Gents...thanks for the replies.  After I posted, I discovered the .Visible property as well, and I think that might be the solution I go with.

                   

                  There are a few reasons I'm not using Element relative displays, the main one is that my customer is looking to view 6 units on the same display.  They have ~20 bioreactors in each or their labs, and 3 labs, the display I'm developing will have the capability to set each of 6 reactor placeholders on the display to any of the ~60 reactors at their site just by selecting the lab/reactor from a set of comboboxes.  As far as I understand ERD's, they change context for the whole display, so there is no way to have 1/6th of the objects on a display have one context, the next set have another, etc.   Also, I've tested the ERD, and I don't like the way it takes up a decent chunk of real-estate on the side of the screen to show the tree, and then it exposes the entire site and users would need a little bit of training on how to browse down the tree and find their reactor...I'm old school...I like keeping it simple, just two comboboxes for each placeholder, they select the lab, then select the vessel and the combobox_change event handles the rest.

                   

                  And honestly, even if I am reproducing some pre-built functions...the VB coding is something I enjoy and is a nice challenge to work on!

                   

                  -Greg