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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waiting on data, before the script proceeds

Status
Not open for further replies.

1LastTime

Technical User
Nov 6, 2002
9
US
I have the need my script wait until data is recieved before it proceeds. I have tried this

while 1
while $RXDATA (and !$RXDATA)
comread DataVal
when dataval call EXIT_LOOP
if iEXIT==1
exitwhile
endif
endwhile
set aspect RXDATA OFF
exitwhile
endwhile

but is doesn't seem to act correctly. Any suggestions.

 
may I surgest using the

PAUSE

command then the amount time required in seconds

while 1
while $RXDATA (and !$RXDATA)
comread DataVal
when dataval call EXIT_LOOP
if iEXIT==1
exitwhile
endif
endwhile
PAUSE 30 ;30 seconds or longer
set aspect RXDATA OFF
exitwhile
endwhile
 
What I'm trying to do is this, eliminate all human intervention. I am monitoring the boot process of a machine and timing is critical. The script must wait until data is received so adjustments can be made. If use pause 30,(or really anything)I can miss things like this.

when target 0 "xxxxxxxxxxxxxxxxx" call SET_BAUD

this example tells me I have the wrong baudrate.

when target 8 "[8C" call set_TERM_VT102

this tells me my terminal emulation must be changed

So that my dilemma the script must wait for data. There's no way around it.
 
Found the solution. Thanks to Knob and the files he provides. The file is emulate4.was. I modified it a little
but the idea was there. Also it was another example in the aspect help under comgetc. Thanks.

proc Main
integer Data1

set aspect RXDATA ON
while 1
while $RXDATA
comgetc Data1
if data1==32
exitwhile
endif
termwritec Data1
endwhile
if data1==32
set aspect RXDATA OFF
exitwhile
endif
endwhile

usermsg "the exit"

endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top