Crimson 3.0 calculations when values are missing

msi124

Member
Join Date
Mar 2014
Location
Touchet
Posts
5
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(n) == 1)
return GPM;
else return 0;


As long as plc(n) 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(n)

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?
 
You could create a loop and check the devices states and sum the values based on if they are online or not.
Something like...


Total_GPM := 0;
num_report := 0;
for( i:=1; i < 4; i++)
{
if(isdeviceonline(i) == 1)
{
switch (i)
{
case 1:
Total_GPM := Total_GPM + plc1.GPM;
num_report++;
break;
case 2:
Total_GPM := Total_GPM + plc2.GPM;
num_report++;
break;
case 3:
Total_GPM := Total_GPM + plc3.GPM;
num_report++;
break;
case 4:
Total_GPM := Total_GPM + plc4.GPM;
num_report++;
break;
}
}
}
 

Similar Topics

Hey guys, hoping someone here could give me a little advice. I'm working with a CR1000-04000 in Crimson 3.1 and I was interested in adding the...
Replies
4
Views
114
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
4
Views
187
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
106
Has anyone found a way to convert/replace/update the firmware on old Parker TS80xx series HMIs (i.e. TS8010, TS8006, etc) to accept Crimson...
Replies
0
Views
90
Has anyone setup communications with Red Lion 3.0 MODBUS to Baker Hughes Centrilift GCS VFD? Thanks
Replies
0
Views
89
Back
Top Bottom