|
|
Rank: Newbie Groups: Member
Joined: 10/2/2011 Posts: 3 Location: Portland, OR
|
Using the standard controls in process book I am trying to make simple objects such as lines, rectangles, or circles appear and disappear at specific time intervals. The resulting graphic would be grouped and placed on the .pdi to draw attention to an operator.
I have some limited experience with C++ and C# but am new to process book and the VBA is a bit of a stretch for me. I think I could figure out some more basic VBA code.
I tried multistates but they are cumbersome and I had trouble with assigning states based on a timestamp or clock (and the resulting graphic was ugly). Any suggestions?
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Newbie Groups: Member
Joined: 10/2/2011 Posts: 3 Location: Portland, OR
|
Perhaps by creating an ActiveX control for the graphic, I could place that onto the .pdi as a control? That's my best guess after three days of trying.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
You can try this and work your way from here.
Create a display with a line, make sure that you enable scripting on this object and rename it to Line1. Go back into run mode, open VBA editor and paste this into your code. Like I said, it very simple but I'm sure you can work your way from here.
Dim MY_TIME As Date
Sub change() MY_TIME = Now() Debug.Print MY_TIME Debug.Print Minute(MY_TIME) If Minute(MY_TIME) < 25 Then Line1.Visible = False Else Line1.Visible = True End If
End Sub
Private Sub Display_DataUpdate() Call change End Sub
|
|
|
Rank: Newbie Groups: Member
Joined: 10/2/2011 Posts: 3 Location: Portland, OR
|
Thank you. I think I understand that I would set the rate at which the graphic changes by modifying the 'If Minute(MY_TIME) < 25 Then' line? I will try this and see how it turns out.
|
|
|
|
Guest
|