I almost always have a Startup Program that I call by adding that program to the startup field on the global page settings.
In the program file, you can do assignments to tags conditionally.
I often have string tags to label things in some widgets I use often. In the water industrty, the operations folks have a wide variety of naming conventions for things like tanks, pumps and especially water towers.
So I will name the tags, tag folders, and pages generically like "Vessel_A", B, C, etc. Then in my startup program I may have something like:
Code:
if (Rawwater.Chem.Pump_1.Title =="") Rawwater.Chem.Pump_1.Title := "PUMP A";
if (Rawwater.Chem.Pump_2.Title =="") Rawwater.Chem.Pump_2.Title := "PUMP B";
if (Rawwater.Chem.Tank_1.Title =="") Rawwater.Chem.Tank_1.Title := "East TANK Caustic";
if (Rawwater.Chem.Tank_2.Title =="") Rawwater.Chem.Tank_2.Title := "Middle TANK JPH100";
if (Rawwater.Chem.Tank_3.Title =="") Rawwater.Chem.Tank_3.Title := "West TANK JPH100";
In that example, the operator with proper security credentials at runtime can edit the titles of the tanks if, for example, they switch chemical names in a vessel. But I want to make sure that if for whatever reason, the retentive value of the string is wiped out, that I stuff a value in there upon start up.
I have only seen retentive data lost one time in ten years working with these things and it was due to a programming bug I caused...
Paul