I am trying to calculate total flow from several flow meters, located at disparate sites. The problem is that if one of these sites is off-line the calculation for the sum of total flow from the other site’s flowmeter tags returns a value of “n/a” in the watch window or a series of dashes on the HMI. In other words, Crimson won’t perform the calculation if one or more of the plc gpm values are not present. I have tried setting up other tags that are conditionally either 0 if the remote plc is offline or the gpm value of the plc if it is online, e.g, Tag gpm_offline is defined:
if (isdeviceonline == 1)
return GPM;
else return 0;
As long as plc is off-line, Crimson returns “n/a” for this tag and also returns “n/a” for any other tag that uses a value from plc
The tag for total flows is the internal tag Totalflow, defined as:
return plc1.GPM + plc2.GPM + plc3.GPM + plc4.GPM;
If all of the plc’s in Totalflow are on-line the total flow is calculated correctly.
Any suggestions for calculating the total flow for the plc’s that remain online?
if (isdeviceonline == 1)
return GPM;
else return 0;
As long as plc is off-line, Crimson returns “n/a” for this tag and also returns “n/a” for any other tag that uses a value from plc
The tag for total flows is the internal tag Totalflow, defined as:
return plc1.GPM + plc2.GPM + plc3.GPM + plc4.GPM;
If all of the plc’s in Totalflow are on-line the total flow is calculated correctly.
Any suggestions for calculating the total flow for the plc’s that remain online?