Hi There,
I'm experiencing something weird and i'm not able to resolve it - i don't know if it's again one of these tcl/tk parser issues that you just need to know or if i'm totally off but look at my code:
All we're really interested in is the $passone condition.
Alright, now this seems to work as expected as long as the little for loop is commented out:
as soon as i put this for loop in the whole algorithm, the
doesn't seem to work anymore in other words i don't see
Found 'Pass: 1' appear in .serialMon.cons even tho I clearly see "Pass: 1" showing up properly.
I would not see how the for loop is giving feedback to the string first command
I'm experiencing something weird and i'm not able to resolve it - i don't know if it's again one of these tcl/tk parser issues that you just need to know or if i'm totally off but look at my code:
All we're really interested in is the $passone condition.
Code:
#first we check for Pass: 1 to see if that has passed or failed
set passone [string first "Pass: 1" $serial::rxBuffer]
#if we found PassOne in the console
if {$passone != -1} {
.serialMon.cons insert end "Found 'Pass: 1'" system
#We will loop until we get a status to analyze
set statcond 1
set timeout 0
while {$statcond && ($timeout < 600)} {
set statfail [string first "Status: Failed" $serial::rxBuffer]
set statpass [string first "Status: Passed" $serial::rxBuffer]
if {$statfail != -1} {
.serialMon.cons insert end "Found 'Status: pass or fail'\n" system
.serialMon.cons insert end "Error in first test. Check loopbacks! Aborting test...\n" error
for { set i 1 } { $i <= 10 } { incr i } {
finaltest::delay $i
}
Execute_Command $serial::hndl_com_port "reset"
set choice [tk_messageBox -type ok -default ok -message "First test failed!\nSecure loopback connectors and restart test." -icon warning]
return 1
}
if {$statpass!=-1} {
.serialMon.cons insert end "Successfully passed first test!" system
set statcond 0
}
finaltest::delay 100
set timeout [expr $timeout + 1]
}
if {$timeout >= 600} {
.serialMon.cons insert end "Timeout appeared, unable to test first result!" error
set choice [tk_messageBox -type ok -default ok -message "Timeout appeared, unable to test first result!\nRestart test." -icon warning]
}
}
Code:
# for { set i 1 } { $i <= 10 } { incr i } {
# finaltest::delay $i
# }
Code:
set passone [string first "Pass: 1" $serial::rxBuffer]
Found 'Pass: 1' appear in .serialMon.cons even tho I clearly see "Pass: 1" showing up properly.
I would not see how the for loop is giving feedback to the string first command