Dear colleagues,
Your forum already got me through a lot of obstacles but now I am stuck.
I am building an application for connecting batch related data (eg. density) to a tag. Batch 1 ends when batch 2 begins and so on.
Batch 1 started t0 ended t1
Batch 2 started t1 ended t2
Batch 3 started t2 ended t3
Batch 4 started t3 ended t4
Now when I add a value to a tag for a batch that value is attached from the provided timestamp (the begin of the batch) till ... forever. So when the lab has figured out the density for batch 4 before the density of batch 3 then the value from batch 4 will be overwritten when the value for batch 3 is entered.
So i want to alter below code as such that the updatevalue works with an interval.
generic something like Set pvValueToAdd.TimeInterval(Begin,End) ??
Current, not satisfying, code
Code:
Global g_oPIServer As PISDK.server
Global ptmTimestamp As New PITimeServer.PITimeFormat
Global pvValueToAdd As PISDK.PIValue
Global ptPIPoint As PISDK.PIPoint
Set g_oPIServer = PISDK.Servers.Item("our server")
g_oPIServer.Open ("our server")
Set pvValueToAdd = New PISDK.PIValue
Set ptPIPoint = g_oPIServer.PIPoints(pitags(K + 1))
ptmTimestamp.InputString = UserForm1_input_Q.Blend_n_0_time 'Blend_n_0_time holds the start time
pvValueToAdd.Value = UserForm1_input_Q.Controls("Txttest" & K + 1).Text 'in this textbox the value is entered
'pvValueToAdd.Value = "No Data"
Set pvValueToAdd.TimeStamp = ptmTimestamp
ptPIPoint.Data.UpdateValue pvValueToAdd, 0
I played with IPIdata2 and InterpolatedValues2, found on this forum, but I am too newbie to get the story together. I am still discovering the wonderfull possibilities PI creates in our business and if anybody can recommand a must do training you'll make me happy.
Please any suggestions to the topic title are welcome if it seems not clear enough.
Kind regards,
Rob