Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unexplainable behaviour???

Status
Not open for further replies.

reggler

Programmer
Nov 13, 2008
63
CA
Hi There,

I got something weird going on with below code snippet:
Code:
if {[serial::waitFor "Pass: $BIS_Test::total_iterations" 90] == 2} {;#Failed in BIST testing
        $GUI::twidget insert end "**************FAIL********************" error
        #[Ron]
        for { set i 1 } { $i <= 5 } { incr i } {	           
	        Execute_Command $comId "^X"
	        $GUI::twidget insert end "^X" error
	        finaltest::delay 100
	        Execute_Command $comId "^C"
	        $GUI::twidget insert end "^C" error
	        finaltest::delay 100
        }
        Execute_Command $comId "reset"
        $GUI::twidget insert end "reset" error
        #[/Ron]
        serial::closePort $comId
        GUI::Info_DialogWIN "1.Figure out cause of Failure.\n2.Start up Tera, reset switch.\n2.Press START to run BIST again.  "
        .main6.runBIST configure -state normal
        return 1
What this is doing: itr waits untril serial::waitFor is returning 2 then it prints FAIL and should send ^C & ^X out 5 times before it's sending reset and displaying the error code.
This is what's happening. It seems to work properly as long as i comment out the for loop but when it's inserted (like in above snippet) it doesn't work. I see the FAIL message displayed and then nothing. it just sits there and waits, until in the very end of my proc when this for loop gets executed. Do I manually need to call a function to get the app following up on the queue or how could this be a problem? Anyone?

Thank you!
Ron
 
But where is end of your if ?
I don't see the ending curly bracket
Code:
if {[serial::waitFor "Pass: $BIS_Test::total_iterations" 90] == 2} [COLOR=red]{[/color];#Failed in BIST testing

...

[COLOR=red]}[/color]
 
Well I thought I keep it short, it's there just a little further down:
 
You might try an update command before and after the for loop. Otherwise, I don't see why there should be a problem.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top