Hey all,
Studio v20.05
Background.
We are piggy backing another system to record attributes for product travelling down the line and several data points recorded. The scale system records weight, along with several other items, then outputs a string that is passed through a socket connection to a 1756-L72.
The string is parsed into most of the time, but occasionally there's a hiccup.
In that string there is a 6 digit sequence and a plant identification number.
I wrote a loop in structured text to read the current sequence, subtract the last recorded sequence, and fill the empty array records with basic data so that it can be picked up by an external application. It worked in emulate, but last night it didn't fix the arrays that were filled with 0 - causing the external application to halt.
If you can offer any insight I would really appreciate it. I'm sure there are things I'm forgetting to mention, so please let me know if you need more details to get a better idea.
Studio v20.05
Background.
We are piggy backing another system to record attributes for product travelling down the line and several data points recorded. The scale system records weight, along with several other items, then outputs a string that is passed through a socket connection to a 1756-L72.
The string is parsed into most of the time, but occasionally there's a hiccup.
In that string there is a 6 digit sequence and a plant identification number.
I wrote a loop in structured text to read the current sequence, subtract the last recorded sequence, and fill the empty array records with basic data so that it can be picked up by an external application. It worked in emulate, but last night it didn't fix the arrays that were filled with 0 - causing the external application to halt.
If you can offer any insight I would really appreciate it. I'm sure there are things I'm forgetting to mention, so please let me know if you need more details to get a better idea.
Code:
IF Sequence >= 1 Then
Sequence := Current_Seq - 1;
Else Sequence := 1;
End_if;
IF Current_Shift = 1 AND Sequence >= 1 AND (Current_Seq - 1stShift_Last_Seq) >= 1 Then
While Carcasses_1stShift[Sequence].Plant_ID <> 4010 Do
1stShift[Sequence].Plant_ID := 4010;
1stShift[Sequence].Carcass_Count := Sequence;
1stShift[Sequence].Shift_Number := 1;
1stShift[Sequence].Species := 1;
1stShift[Sequence].Year := Carcass_Date_Time.Year;
1stShift[Sequence].Month := Carcass_Date_Time.Month;
1stShift[Sequence].Day := Carcass_Date_Time.Day;
1stShift[Sequence].Hour := Carcass_Date_Time.Hour;
1stShift[Sequence].Minute := Carcass_Date_Time.Minute;
1stShift[Sequence].Tattoo := 7779;
IF Sequence = 1 THEN
EXIT;
ELSE
Sequence := Sequence -1;
END_IF;
End_while;
End_if;