YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Make lines (objects) appear at specific intervals on .pdi display. Options · View
opticalwaveguy
#1 Posted : Sunday, October 02, 2011 3:18:12 AM
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?
Sponsor  
 

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.
opticalwaveguy
#2 Posted : Sunday, October 02, 2011 3:32:06 AM
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.
squatty
#3 Posted : Monday, October 03, 2011 9:31:28 AM
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
opticalwaveguy
#4 Posted : Monday, October 03, 2011 9:36:45 AM
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.