10/3/2014 8:45 AM | |
Joined: 9/3/2008 Last visit: 5/13/2024 Posts: 921 Rating: (158) |
Scott, As bosandzerossays, the warning is not about undefined variables; it is about the reading variable values that has not been written to yet. If you look at the statement you posted earlier: Alm := (Value > Setpoint) or (Alm and Value > Setpoint - DB); Here you are writing to "Alm". But in the expression you are first reading "Alm": (Alm and Value > Setpoint - DB) This is where the warning comes from. In my opinion, the lack of the same warning from earlier compilers is the error. |
Michael |
|
10/4/2014 11:45 AM | |
Joined: 9/8/2009 Last visit: 7/17/2023 Posts: 1410 Rating: (150) |
bosandzeros: Yes it's a waste of CPU time. You can use STAT variables if you need default value. huggy_d1: You can combine bits, nibbles, words,... into a variable, so it should be a warning only - a reminder like. |
7/20/2015 1:40 PM | |
Joined: 7/1/2013 Last visit: 4/4/2024 Posts: 85 Rating: (4) |
Here we go again. Timer tCongestionDetection declared in static variables, timer called before "if..end_if" blcok, warning about initialization inside "if..end_if". (attached picture) |
10/18/2018 2:08 PM | |
Joined: 7/1/2013 Last visit: 4/4/2024 Posts: 85 Rating: (4) |
I still don't like this. Tia V15 UPD 3 - Despite the fact that variable is certainly written in "IF...ELSE" section warning about variable initialization appears. Best regards. |
Follow us on