Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ public static object StringValueToObject(string Value, S7DataRowType DataType)
else if (DataType == S7DataRowType.DINT)
return Int32.Parse(Value.Replace("L#", ""));
else if (DataType == S7DataRowType.REAL)
return float.Parse(Value.Replace('.',','));
// Handle Max/Min REAL values accordingly (e.g., "-3.402823e+038" or "3.402823e+038")
return float.TryParse(Value.Replace(".", ","), out float result)
? result
: Value.StartsWith("-") ? float.MinValue : float.MaxValue;
else if (DataType == S7DataRowType.S5TIME)
return Helper.GetTimespanFromS5TimeorTime(Value);
else if (DataType == S7DataRowType.TIME)
Expand Down
Loading