Execute C# code in PG2 graphics ?
In VBPG graphics it was possible to include VB code to do some things like special animations, connecting to external systems like databases and so on.
In PG2 this is not possible anymore. PG2 is a pure graphic system with limited features. The limits are high, and many things can be done - but not all.
Now i am searching for a way to migrate some weird VBPG stuff to PG2.
I see three options:
- Leave this stuff as VBPG. VBPG will be killed someday, so this is only a solution of time.
- Create ActiveX controls and make them new aspect types. After this i can show this aspects in PG2 graphics by the aspect view wrapper. This works, but i fear stability issues. The possible interactions with the PG2 graphics is also very limited.
- Create graphic primitives assemblies in C#. Graphic primitives assemblies looking like simple dotnet assemblies, and it should be possible to write a new one. BUT - this assemblies are digital signed, and a new assembly would not be loaded if the signature does not match.
Does someone see any other option ?
Does someone know how to write graphic primitives in C# ?
Does someone know how to sign graphic primitives assemblies ?
Voted best answer
I am using vb.net to create a dll file( file explorer for excel daily report printing/tracing) and then use aspect view wrapper to display at PG2 graphic
Create a new project, and choose class library.
You will get a dll and just register it in system and register via below cmd.
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Regasm.exe /codebase "C:\Program Files (x86)\ABB Industrial IT\xxxx folder\XXXX.dll"
pause
but it will be every tough if you want to read 800xa variables
or you may check Aspect Studio
Answers
Vbpg is really not an option!
Talk to your ABB representative about the option to create a "Third Party Extension" Aspect System, there is the possibility to get own created aspect types (in c# or c++, not related to PG2 at all) signed.
Writing code in graphics is a bad idea. Replacing bad VB code with C# will lead to exactly the same problems sooner or later when you need to upgrade again.
What exactly do you need to do?
Jea, i finally got it. I found out how to write graphic primitives.
If someone else want this too, here my short tutorial and example.
Add new comment