odaen Posted December 9, 2005 Report Share Posted December 9, 2005 good day. I'm trying to use macroexpress to pass simple text commands to some hardware and monitor responses via hyperterminal. for example I enter "ver<enter>" and receive "Base Station Rev 1.01b" How do I monitor the response in hyperterminal and compare vs a known expected response? edited for minor typo Quote Link to comment Share on other sites More sharing options...
kevin Posted December 9, 2005 Report Share Posted December 9, 2005 Can you copy the Hyperterminal screen to the clipboard and then look at the result? Quote Link to comment Share on other sites More sharing options...
odaen Posted December 9, 2005 Author Report Share Posted December 9, 2005 I'd have to close/reopen hyperterminal for each command then, correct? I will be repeating several of the commands, looking for the same response. Quote Link to comment Share on other sites More sharing options...
odaen Posted December 10, 2005 Author Report Share Posted December 10, 2005 ok, I found a way around this, but don't know how to parse text from a text file to compare with "known good" I can capture text to file from hyperterminal and have notepad open up the file indicating the command and the response. how do I parse the file for the response and compare against a "known good" string? Then, I'll <CTRL>A and delete and then save the file. Enter new command in hyperterminal, and repeat, parsing the text file, deleting the text, saving text file, etc. Quote Link to comment Share on other sites More sharing options...
randallc Posted December 10, 2005 Report Share Posted December 10, 2005 hi, In brief, use "Text File Process" to string, say "T1"/ endprocess loop; in the loop ; compare T1; Variable Set String %T2% "Not Found"// Put in your file path and name here Text File Begin Process: "Answer.txt" If Variable %T1% contains "Known Good" Variable Set String %T2% "Found" // Exit here if you only need to find one instance Repeat Exit End If Text File End Process Text Box Display: After <TVAR2:02:01:Not Found><REM2:Put in your file path and name here><BTFBEG:001:000001:000000:C:\Program Files\Macro Express3\Answer.txt><IFVAR2:1:01:7:Known Good><TVAR2:02:01:Found><REM2:Exit here if you only need to find one instance><EXITREP><ENDIF><BTFEND><TBOX4:T:1:CenterCenter000278000200:000:AfterT1=%T1%T2=%T2%> Randall Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.