MichaelvdV@Atos

Code snippets sharing resource

Discussion created by MichaelvdV@Atos on Jul 12, 2011
Latest reply on Jun 15, 2016 by MaxStrueverWipro

7827.codesnippetsharing.png

Welcome to the code snippet sharing topic. This topic is the place for contributing and getting codesnippets. Are you looking for how to use a specific function in the AF or PISDK? Are you looking for a way to call PI Webservices? This is the place!

 

This topic can only exist if you participate! Do you have an interesting piece of code to share? Did you came across an interesting piece of code on the forums, this is the place to post it! You will help your fellow vCampus members, and you will contribute with creating a PI coding resource.

 

Some guidelines on how you can contribute.

  • Make sure you use the below 'template'. You can just copy/paste it into your new post, and change the placeholders. It is also very important to use tags with your post, so other users can quickly find what they are looking for.
  • Make sure you test/compile your code. It doesn't need to be perfect, but it should do what's described
  • Use code comments if you can
  • Don't worry if you think the code is too simple or doesn't contribute much. Just post it. What you may consider simple, can be challenging for others. You are always helping someone out!
  • Don't worry about your code. If it works for you it may work for others. If you are not sure about it, just ask in the forums.
  • This topic will be moderated.
  • This startpost will be updated with links to the code snippets. This will make it more easy to find and browse for snippets that you need. This will be done by me, you don't have to do anything for that.


Name: {name of your codesnippet}

 

 

 

Author: {the original author. It can be you, or someone who posted this on the forum}

 

Description: {very short description of what the code does}

 

Language: {C#, VB.NET, VBA, etc..}

 

Prerequisites: {What does a user need to run this code. Does it use PISDK, AFSDK, PIOLEDB, etc... }

 

Code snippet: {the actual code snippet. Don't forget to use the 'insert code' widget for better formatting and syntax hightlighting. For larger snippets, please use attachments. }

 


 

Code snippet index

 

PI SDK

 

Copy a PIPoint extension method

 

...

 

...

 

AF SDK

 

...

 

...

 

...

 

ACE

 

...

 

...

 

...

 

PI Webservices

 

...

 

...

 

...

 

 

 

 

 

Disclaimer: The code in this topic is provided 'as is'. It is meant for your education. It is your responsibility to test any code according to your (company) standard. No one can be held liable or accountable for what they post here. No one can be expected to offer support for their code snippets.

 

 

 

Outcomes