how can i animate a symbol from the symbol library in processbook
Depends what you want to do. You can turn it into a multi-state.Just select the symbol, click on the multi-state icon and pick a tag:
Then away you go. Keep in mind if the symbol was scaled (in terms of its original colour, that will be plain now).
Apart from that, you can stick a value symbol over the top and a trend icon and then group them.
Is that what you're after?
What I’m looking for is to display a windmill like the attached GIF for when its running.
But GIF’s aren’t supported by process book.
I’ve tried using the blink function with windmill symbols from the Library but nothing really works well
One shonky way, (for a static image) is to load your image (you might have to convert it to a supported type but there are loads)
Then insert an ordinary square
Now select the square and click the multi-state
Select the first state and pick the colour of the background. Select the second and pick 'None' for fill colour.
Drag the square over your image, (I've left the line and the back-colour for state 1 is not quite the same as the background so you can see)
(Now I see it's an animated gif you're after...hmm. thinking..
ok, I've achieved the animated symbol using the Microsoft Animation activex control and some VBA (tried to avoid it).
See if you have one of these installed.
One trick: stick your VBA project into Design mode and then you can use the built-in dialogs of the active x control.
Here's my code: (it's just thrown together - no error trapping and you will have to look after 'bad data' etc. but you should be able to get the drift)
Const AVIPath As String = "C:\Users\Developers\Documents\Demo\delete.avi"
Private Sub AnimeSetup()
Private Sub Display_DataUpdate() Dim vrDate, vrStatus AnimePlay Value1.GetValue(vrDate, vrStatus) > 50End Sub
Private Sub AnimePlay(Play As Boolean) If Play Then Animation1.Play Else Animation1.Stop End IfEnd Sub
Private Sub Display_Open() AnimeSetupEnd Sub
Looking for my screen video capture software (forget it's name) but here are the still shots
I.e stopped in the middle.
(this was just an AVI that I found on this machine (Server2012)
Have I got the answer this time Aban?
Rob's solution will work. I would like to put in the caveat that we don't usually recommend embedding activeX objects. Recently, Microsoft has stated that they will no longer support and develop activeX due to security vulnerabilities. As a result, OSIsoft highly does not recommend using these objects in any client side applications.
My question for Aban is whether or not we need to use his specific gif? Would any windmill animation work? For example, we can redraw the windmill using the native processbook symbols and use vba to animate those symbols to simulate a windmill rotating
Rob's will work on process book but I should have mentioned that this needs to go onto PI Core site.
When I publish it to PI Core site it will not work. I don't think the VBA will work on coresite
Jesse it doesn't need to be the GIF in question just an animated windmill to show when they are running or stopped.
What version of Coresight are you targeting?
You may have to end up with a normal Coresight page and a custom control.
Indeed the plot thickens.
VBA is a no go for Coresight/Vision. This is simply because the vba can't be converted to be a part of the svg file import.
Currently, the only way to get an animated gif in Coresight/Vision is to use a native display. I tested with Coresight 2016 and Vision 2017 and animated displays do work.
the coresight is 2016 R2
We are developing the screens in processbook first and then publishing them on coresight
Thanks for your help so far guys, but I think this might be a lost cause:(
You got me there Jesse,
Activex is like DCOM, just because you can, doesn't mean you should.
Anyway challenge accepted:
This version I just grabbed 4 (can use as many as you want) images, Graphic1..4
Sit them on top of each other (make them square and align them)
(similar hack code- you get the idea)
Option ExplicitDim CurrentImage As IntegerDim busy As Boolean
Private Sub Display_DataUpdate() Dim vrd, vrs If Value1.GetValue(vrd, vrs) > 50 Then AnimateImageEnd Sub
Private Sub AnimateImage() Dim Loops As Integer Dim Count As Double If busy Then Exit Sub busy = True For Loops = 1 To 30 '(update to align with speed & page display update) Count = Timer While Timer - Count < 0.5 '(speed- seconds per image) DoEvents Wend ChangeImage Next busy = FalseEnd Sub
Private Sub ChangeImage()
CurrentImage = (CurrentImage + 1) Mod 4 Graphic1.Visible = CurrentImage = 0 Graphic2.Visible = CurrentImage = 1 Graphic3.Visible = CurrentImage = 2 Graphic4.Visible = CurrentImage = 3
Change the direction with the CurrentImage + (direction)
change speed on pi value as well if you want
synchronisation Boolean stops re-entrance as data_update continues to fire.
Ok, I think I’ve got something but it’s not perfect, I’ve used an image from the symbol library and rotated one of them.
Using the blink function from the multi-state symbol I was able to alternate the images, when one image was displaying the other was off, as shown in the video
The only problem with this is when the running signal of the windmill is dropped and comes back on again the two images flash at the same time, is there a way to stagger which one blinks first or it there a way of making one of the images visible when a bit is high and the other image when the bit is low and continually toggle the bit when the windmill is running
Retrieving data ...