quick question regarding process book
let's say i have a trend in PB showing TagA. can I, in the vba code, change the tag to TagB? if yes, do you have a little sample code?
Trend1.SetTagName 1, "\\yourPIServer\TagB"
where 1 is replaced with the trace number.
I am using this in a trend on a ProcessBook display and it seems to cause a problem. After this command is run in the code, the ProcessBook "Revert Time Range" button on the Time Range Toolbar will not make the trend revert to the end time of "*" as it should. Any ideas on how to fix this?
CORRECTION: The problem is not with SetTagName. After further investigation the problem is with using SetStartAndEndTime. I would still like advice on using SetStartAndEndTime but still being able to use the Revert button.
SetStartAndEndTime method sets the persisted time range for the trend. It is the same as going into build mode and changing the time range configuration of the trend permanently.
I guess what you want is something like setting the time range on run-time but able to go back to the persisted configuration on revert, like using the "View" -> "Time Range" feature in ProcessBook. For this you can use SetTimeRange method instead of SetStartAndEndTime.
Retrieving data ...