12 Replies Latest reply on Jul 12, 2011 1:22 PM by Lonnie Bowling

    PI Codeplex?

    Lonnie Bowling

      So, the other day I was working with a customer and needed to do a very simple operation, just get an average value for a PI tag.  It has been a awhile since I have done this and did not have a working example using the SDK on my computer.  I looked at the SDK document and had the usually experience, hard to find what function I needed to call, and could not follow the example.  I told the customer that I will need some time to look into it and get back to them.  So why am I telling everyone this?

       

      I think this might have been suggested in the past, but I will bring it up again anyway.  It would be so awesome to have a place here on vCampus where users could add/comment/lookup code examples for any operation.  I think it would really help new and old SDK developers to have a searchable library of code.  I would add stuff to one if it existed.   Searching the board is OK, but I spend a lot of time reading threads and then the code is not always posted. If we had a place to put code, we could comment on if it works and the author could make changes if bugs were found.  Anyway, just a suggestion (I'm sure others have suggested this before) and story on a recent experience.  I'm always trying to figure out how vCampus could be even better!  Have a great day and the much thanks to the hard work the vCampus team is doing!

       

       

       

      Lonnie

        • Re: PI Codeplex?
          andreas

          Lonnie, sounds good to me. I had something like a collection of sample code in mind when i started the "A Few PI ProcessBook VBA Tips" whitepaper. Your suggestion goes even further.

           

          We had a (internal) discussion some time ago about a sticky post in every forum with links to usefull threads - how about this aproach: a sticky "source code snippet" thread in each forum, and everybody can add code snippet posts there?

            • Re: PI Codeplex?

              Sounds good to me too.  I wouldn't go for the forum based approach though, it would be better to have an online SDK documentation where you have an interactive object browser and for each method, property, ... you have examples of how to implement and use the resulting object(s).

               

              The AF SDK documentation started to look ideal for this but it lacks the examples, maybe OSIsoft needs some more technical writers - how about some free vCampus technical writers

               

              If you had an online object browser, it would be nice for code snippets (I am sure Michael started some code snippet posts some time ago) to be associated with methods of the SDK, that way you still link in to the discussion hall from the support documentation.

                • Re: PI Codeplex?
                  MichaelvdV@Atos

                  Are you thinking on something along the lines of what the PHP documentation does?

                   

                  For example: www.php.net/.../function.mysql-real-escape-string.php

                   

                  If you scroll to the end of the documentation, you will see that there are all kinds of user samples. Users can freely add comments and code samples to any article.

                   

                  I find this approach interesting and informative. However, I also noticed that because users are pretty free to add their own code samples, you will sometimes find horrible (and false) comments/codesamples. This is something I would really like to prevent. Something like this should be heavily moderated, because people tend to blindly accept it for 'the truth' and c/p it into their own projects.

                   

                  edit: I started a topic about sharing code snippets a while ago, back then it received zero attention: http://vcampus.osisoft.com/discussion_hall/generic_forums/f/7/p/842/5070.aspx

              • Re: PI Codeplex?

                I think a library of code snippets and a project sharing facility like Codeplex are pretty different animals. I know some folks started sharing those but it might be beneficial if those were organized somehow - one of the concerns I have with this is with the trustworthiness and quality of those snippets... whatever disclaimer we put there (provided as is, no warranty, etc.), people expect those to work and be follow best practices. Would you expect the vCampus team and other experts to scrutinize and sanction them? That takes resources... especially if people go crazy on this and start sharing many of these snippets!

                 

                As far as the Codeplex thing, that was pretty much the spirit behind Community Projects... a first step in that direction, anyway   Please take a look at this post by Matt Miller.

                 

                (Note that, before the upgrade of the platform that vCampus runs on, those forums were grouped under a same "Community Projects" category - not sure what's happening with the forums groupings now... I'll check with the developers.)

                 

                I remember we had lots of discussion around this - with customers and partners and, of course, our friends from Legal - and the Community Projects as presented in Matt's post were the result of these discussions. First there were concerns about posting stuff on external sites (e.g. Codeplex) because of some of the terms in the Software License Agreement (SLA) that exists between us and our customers, as well as some of the terms in the OSIsoft Virtual Campus End-User Agreement. I don't remember all the details, but the vCampus team could probably revive these discussions with you and other interested parties. In the end, the only option back then was host that directly on vCampus. And developing a full-blown project sharing website like Codeplex was not something we could undertake ourselves (yes, resources are limited!), which resulted in the Community Projects we announced to the community.

                 

                We referenced those several times in various discussions over time, but it doesn't seem like this community has been adopting them passionately... maybe with the help of a few more contributors, we could inject some life in there - and possibly create a similar "Community Snippets" group?

                  • Re: PI Codeplex?

                    Back to Rhys' and Michael's comments about code examples in documentation... the AF Programming Reference does exactly that - for some significant classes and methods. If you look at the bottom of a given article (see the "PISystem Class" article as an example), you will find code examples at the bottom (and you can swap between programming languages in the top-right corner).

                     

                    Now, maybe you need more of these examples... and that's fine. Typically, enhancement requests (including documentation) should be channeled through our regular Technical Support team. If you wish to contribute to this (suggest an additional example, submit your own snippet, etc.), my suggestion at this time would be to continue going through regular Technical Support - and then maybe the vCampus team will want to initiate discussions with the AF and Documentation teams around formalizing another channel for this, on vCampus?

                     

                    Remember, the AF Programming Reference is part of the AF Developer Tools Kit, available under the PI Asset Framework section of the Download Center.

                      • Re: PI Codeplex?
                        MichaelvdV@Atos

                        I'm a big believer in just getting things going, and get any new technology in place later. Let's first make due with what we have.

                         

                        What do we say that I open a new snippets topic. We can all enter snippets, and I will make sure to edit the start post to provide links to all of them in different categories.

                         

                        If this gets some support, I will be happy to invest time in it.

                          • Re: PI Codeplex?

                            I used the AF SDK documentation as an example of it going in the right direction, but I still believe that all methods should have an example (otherwise why is the method exposed).  Then of course you see that all the other documents for other SDKs need a lot of work to catch up, especially PI SDK - although you could say is it worth updating the PI SDK one seen as though it will end up inside AF SDK.

                             

                            In an ideal world OSIsoft should provide the official examples and then the community provides other real world examples that solved a particular issue.  If this was online like the PHP documentation, then you could have search results from the discussion hall of the method displayed below the official example(s).

                             

                            Pat Kennedy recently said "Buy more PI".

                             

                            The vCampus community says "Buy more technical writers".

                             

                            Lonnie, now see what you have started...

                              • Re: PI Codeplex?
                                Lonnie Bowling

                                Great discussion today, I was out in the field so didn't have a chance to give feedback.  These are my thoughts...

                                 

                                Michael, after looking at the PHP link, I think I want to be a PHP developer starting tomorrow!  That is an awesome site and is what I was thinking of, but way beyond my wildest dreams.  Of course that is an open site free to the public, I think (towards Steve's comment) that our volume would be much less + higher quality.  If it became out of control, I'm sure some simple restrictions could be put in-place.

                                 

                                I totally get that vCampus has very limited resources and doing a big infrastructure change would mean we all have to wait, just like me waiting for the next release of Notifications (which is out btw!).  In that light, I really like the ideas that Adreas and Michael suggested with using what we have, message boards, and some how bending them to meet our needs.  After all, even if it is not ideal, it is a least a start.  If nothing comes from it, then we didn't waste a bunch of time and energy.  But if it takes off, we have a working model that can be improved, I don't see a downside there.

                                 

                                As far as documentation, yes we need more technical writers, and every function should be very well documented as the foundation for us to build on, so I'm behind that.  Even so I still like to see some nice meaty examples, the more the better.

                                 

                                A final observation before I go have fun for the weekend.  After being on vCampus for over a year now, it seems like the vast majority of posts I see are people having problems with how to use the SDK's.  I know where they are coming from, as I'm usually in the same boat.  I think that if folks like me (and others new to the SDK) had a place to look at real code examples after reading the documents, it would help cut down on some of the "how do I/why does this not work" type of posting and actually free up resources for other things.  Kinda like being proactive vs. reactive, you get more done and it is way more fun.

                                 

                                I guess I'm growing up a bit in my vCampus/PI experience, while the message boards are great, I just want a bit more (including be able to contribute in a meaning way)!!

                                 

                                Have a great weekend guys, and if you are reading this Monday, I hope you had an awesome weekend!

                                 

                                Lonnie

                                  • Re: PI Codeplex?
                                    MichaelvdV@Atos

                                    Lonnie Bowling

                                    Michael, after looking at the PHP link, I think I want to be a PHP developer starting tomorrow!

                                     

                                    Are you really sure?

                                     

                                    Imagine that you lived in a beatiful house, with a big indoor swimming pool and AC everywhere. The house is designed very well, and there are bathrooms attached to every room. There are built in closets everywhere, and you have enough space to store your stuff. It's very easy to find everything back. Living in this house is like a dream, and comming home to it feels like a warm blanket.

                                     

                                    Now imagine living in a mobile home, with bad plumbing everywhere. Your mobile home has AC, but everything is wired so bad that it's a real fire hazzard, and it only works from time to time. Your trailer has 1 bathroom, that is really small. It has all kinds of small hidden cabinets where you can store stuff, and you can never find your things. The really bad thing is that normal rules do not apply inside your trailer. All basic rules of nature and logic do not apply here.

                                     

                                    Would you really want to move from your nice dreamhouse to that mobile home? That is what moving from .NET to PHP will feel like to you...

                                     

                                    (sorry, this is meant as a joke, but I really don't like PHP ).

                                     

                                    Lonnie Bowling

                                    That is an awesome site and is what I was thinking of, but way beyond my wildest dreams.

                                     

                                    Agreed that the PHP manual is really great. The issue is, like you said, that sometimes people contribute comments or samples that are incorrect. You see that a lot with the PHP manual. For us, it should be more heavily moderated.

                                     

                                    Lonnie Bowling

                                    I guess I'm growing up a bit in my vCampus/PI experience, while the message boards are great, I just want a bit more (including be able to contribute in a meaning way)!!

                                     

                                    I really like your enthusiasm! I like the proactive vs. reactive thought. I think that we could start of with the technology we have, see if it is successfull, and then go from there. We will certainly discuss this within the team.