Home

StringPlayer User Guide

image

Contents

1. converted to an integer to varname and the result is stored back as a string except for TST which is as per HEXSUB but the variable is not updated An internal ConditionFlag register is updated appropriately so that it can be used with the IF lt cond gt and JUMP lt cond gt commands BREAKOFF lt portnum gt lt timeoutMs gt Release the BREAK on Logical pipe lt portnum gt and wait for timeoutms milliseconds BREAKON lt portnum gt lt timeoutMs gt Send a BREAK out from Logical pipe lt portnum gt for timeoutms milliseconds BTCONSOLE lt portnum gt Open BtConsole exe so that widcomm stack can be manipulated like a streaming port CHECK lt varname gt lt string gt Fails the test if value string does not match content of varname CHECKCTS lt port gt lt ON OFF gt Read the modem CTS status for serial port port The state can be either ON or OFF in caps ZERO flag is set to 1 if the state matches specified value otherwise O CHECKDCD lt port gt lt ON OFF gt Read the modem DCD status for serial port port The state can be either ON or OFF in caps ZERO flag is set to 1 if the state matches specified value otherwise O CHECKDSR lt port gt lt ON OFF gt Read the modem DSR status for serial port port The state can be either ON or OFF in caps ZERO flag is set to 1 if the state matches specified value otherwise O CHECKRI lt port gt lt ON OFF gt Read the mod
2. lt varname2 gt Stores the number of msec elapsed since timer varname1 was started in variable varname2 TIMER EXPIRED lt varname gt lt string_msec gt If the time elapsed since varname timer was started using TIMER START has elapsed by more that string_msec then the zero flag is set so that IFNZJUMPNZ will succeed TITLE lt string gt Defines a label used for marking the start of a test group of actions If an action fails then all actions up to the next TEST label are skipped so that an overnight test which has some failures is not aborted totally As of v1 9 70 if the command line argument MAXTRY NNN was specified when the application was launched then the most recent TITLE statement processed will be the destination of the rewind location TRACEWIN lt true false gt If true then the aggregate log window is updated When false the aggregate window is displayed but not updated TXSTRING lt portnumA gt lt txstr gt Transmit txstr from COM lt portnumA gt Proceed immediately to next action TXSTRINGEX lt portnumA gt lt txstr gt lt repeatCount gt Transmit txstr from COM lt portnumA gt repeatCount times Proceed immediately to next action TXUNICODE lt portnumA gt lt txstr gt Transmit txstr from COM lt portnumA gt as unicode Hence twice number of bytes sent Proceed immediately to next action WAITDATA lt timeoutMs gt lt portnum gt lt channel gt lt string gt Will wait for a max p
3. Associate comport which is in format COMnn with portnum The port is opened If it fails to open then script run is aborted The first lt 0 1 gt in the string is optional and specifies CTS RTS handshaking If it is not specified then CTS RTS is enabled The second lt 0 1 gt in the string is optional and specifies modem status change detection If it is not specified then it is enabled It is advised to set this to O if the device will thrash the PC s CTS input signal and an exception No more trigger slots is displayed If the first is optional 0 1 is missing but the second is present then the separator should be PORT_CLOSE lt portnum gt Close the logical portnum specified PORT_MPOINT lt portnum gt lt comport gt 9600 N 8 1 0 1 0 1 Associate comport which is in format COMn with portnum The port is opened If it fails to open then script run is aborted The communications is assumed to binary so at script level the Rx Tx data is as hex digits and the protocol is assumed to be the BISM multipoint The first lt 0 1 gt in the string is optional and controls CTS RTS handshaking If unspecified CTS RTS is enabled The second lt 0 1 gt in the string is optional and controls modem status change detection If unspecified then it is enabled Laird advises you set this to O if the device will thrash the PC s CTS input signal and an exception No more trigger slots is displayed If the first is opt
4. value Special cases are r carriage return 0x0D a line feed 0x0A b backspace 0x08 String parameters can embed variables using the syntax varname To embed the character enter the three character sequence 5B Pre declared system variables are available GENERAL StringPlayer was formerly known as AtProtoco Test exe It is capable of testing text and binary protocols over multiple COM ports and or pipes For binary protocols the binary data is sent received and displayed as hex strings Americas 1 800 492 2320 Option 2 1 Laird Technologies Europe 44 1628 858 940 Hong Kong 852 2923 0610 www lairdtech com bluetooth STRINGPLAYER User Guide A HTML log file containing everything is created In addition StringPlayer places failures in a separate HTML file and generates a text file which lists the failed tests COMMAND LINE ARGUMENTS The utility takes the following case insensitive command line arguments TRACE Used for debugging AGGLOG Displays the aggregate comms activity screen instead of separate screens for individual logical streaming channels QUIT The application terminates upon completion Multiples of these can be specified XXX is stored in an internal array After each ARG XXX a counter is incremented to allow the next XXX to be stored ARG XXX in the array of strings The text substitution results from the script that runs the variable enclosed in as pe
5. 6 PORT statement failed with X s not a valid name for a serial port 17 PORT statement failed with Logical Port X cannot be specified 23 BTCONSOLE statement failed with BtConcole Host Creation Error 24 BTCONSOLE statement failed with BtConsole failed to open 25 BTCONSOLE statement failed with Logical Port X cannot be specified Embedded Wireless Solutions Support Center 1 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide 33 PIPE statement failed with Host Creation Error 34 PIPE statement failed with Pipe failed to open 37 PIPE statement failed with Logica Port X cannot be specitied 1000 Generic error REVISION HISTORY 1 0 3 Sept 2014 Initial Release Jonathan Kaye Embedded Wireless Solutions Support Center 12 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026
6. Laird gt STRINGPLAYER User Guide v1 0 INTRODUCTION StringPlayer is a Laird developed utility for Windows Platform which is used to expedite regression testing of any UART based module and in future TCP IP based testing will also be possible Note This guide is written for StringPlayer v1 9 7 0 It has a scripting engine that allows scripts written in the language defined in this user manual to be compiled and run In general a script will consist of many tests each beginning with the TITLE statement If a test fails then it will try MAXTRY times specified via command line and if it still fails that many times the scripting engine will automatically progress to the next test which is identified by the next TITLE statement On retry the scripting runtime engine will reset its program counter to the most recent TITLE statement Arithmetic and conditional looping is possible So is the ability to launch other windows applications from within the script and optionally wait for those applications to close User interaction via dialog boxes can be done SCRIPT SYNTAX DESCRIPTION Blank line are ignored Each valid line is a statement or a directive Directive lines start with a character Tokens are case insensitive Statements and Directives cannot span multiple lines Tokens are separated by spaces String parameters can embed nonprintable characters using the escape sequence HH where HH is the ASCII hex
7. em RI status for serial port port The state can be either ON or OFF in caps ZERO flag is set to 1 if the state matches specified value otherwise O CONST lt varname gt lt string gt Declare variable varname and store value string without the quotes in varname string can have embedded cName so that it is a combination of other earlier defined constants For example CONST cNameO hello CONST cNamel cName0Q world CONTAIN lt varname gt lt string gt Fails the test if value string is not present as a substring in the content of varname The system variable SysVarMatchCount is updated Embedded Wireless Solutions Support Center 4 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide DEC2HEX lt varname gt lt decimal_integer_value_string gt Convert the decimal string into an integer string and then store the hexadecimal equivalent in the variable See also counterpart HEX2DEC DECLARE lt varname gt This declares a variable with name varname DEFTIMEOUT lt timeoutMs gt Set default timeout in milliseconds The parameter is in quotes so that variables can be embedded which will be parsed at runtime DELAY lt timeoutMs gt Wait for timeoutms milliseconds before next action The parameter is in quotes so that variables can be
8. embedded which will be parsed at runtime END This defines the end of the script at runtime EXECUTE lt appName gt optional parameters Runs the application with parameters and will NOT block EXECUTEEX lt nFlags gt lt appName gt optional parameters Runs the application with parameters and will NOT block nFlags is a bit mask O Set to hide the executed app 1 Set to minimize the executed app EXECUTEWAIT lt appName gt optional parameters Runs the application with parameters and will block until the application appName exits FAIL message Fails the script so that the program counter skips to the next TITLE action FILECOMPARE lt true false gt lt filenameA gt lt filenameB gt Fails the test if filenameA does not match content of filenameB if true is specified If false is specified then fails the test if files match FILEEXIST lt true false gt lt filename gt Fails the test if filename does not exist and true is specified FILEOPEN lt handle gt lt READ WRITE APPEND gt lt filename gt Open filename for reading or writing or appending FILECLOSE lt handle gt Close file associated with handle FILEREAD lt handle gt lt varData gt lt varLen gt Read varLen bytes of text into varData varLen is updated with actual number of bytes read FILEWRITE lt handle gt lt varData gt Write varData to file associated with handle FOLDEREXIST lt true
9. eriod of time to see if the receive buffer in portnum contains the string data after extraction from appropriate packet Useful for multipoint protocol testing when received data will get fragmented Embedded Wireless Solutions Support Center 10 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide WAITMULTI lt timeoutMs gt lt portnum gt strO str1 str2 Will wait for a max period of time to see if the receive buffer in portnum contains one of the substring strN If a match is found then see statement MULTIINDEX to get the 0 based index number of the matching string Note This command only works if portnum was opened using PORT_MPOINT WAITPACKET lt timeoutMs gt lt portnum gt lt varname gt Will wait for a max period of time to see if the receive buffer in portnum contains at least one packet and if so will extract it from the response buffer and save it in the variable varname1 If packet is written to variable then zero flag is set so that IFNZ JUMPNZ will succeed WAITRESP lt timeoutMs gt lt portnum gt lt respstr gt Will wait for a max period of time to see if the receive buffer in portnum contains the substring respstr WAITRESPEX lt timeoutMs gt lt portnum gt lt respstr gt Will wait for a max period of time to see if the receive buffer in portnu
10. false gt lt foldername gt Fails the test if foldername does not exist and true is specified Embedded Wireless Solutions Support Center 5 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide GETCWD lt varname gt Gets the current working folder That is where the exe was launched from HEX2DEC lt varname gt lt hexadecimal_integer_value_string gt Convert the hex string into an integer string and then store the decimal equivalent in the variable See also counterpart DEC2HEX IF lt cond gt lt cond gt is one of lt Z NZ LT LE GT GE gt and if the appropriate flag in the conditionflag register is true then script actions the next item otherwise skips to the one beyond it Where Z Zero NZ Nonzero LT LessThan LE LessThanOrEqual GT GreaterThan GE GreaterThanOrEqual JUMP lt labelname gt Unconditionally jump to labelname JUMP lt cond gt lt labelname gt lt cond gt is one of lt Z NZ LT LE GT GE gt and if the appropriate flag in the conditionflag register is true then script program counter jumps to labelname Where Z Zero NZ Nonzero LT LessThan LE LessThanOrEqual GT GreaterThan GE GreaterThanOrEqual FLUSHRX lt portnum gt Empty the receive buffer of Logical pipe lt portnum gt FLUSHTX lt portnum gt Empty
11. fset O indexed but can be negative and Length is copied into the varname If Offset is negative then the right most substring is copied For example 4 4 will copy the last 4 characters of the source string MULTIINDEX lt varname gt lt portnum gt Returns the most recent matching index string number after WAITMULTI was processed The return value is a O indexed value NOTCONTAIN lt varname gt lt string gt Fails the test if value string is present as a substring in the content of varname The system variable SysVarMatchCount is updated PKTCOUNTGET lt portnum gt lt varname gt Get the packet count and save in variable PKTCOUNTRESP lt portnum gt lt varname gt Get the packet count in the Rx buffer and save in variable PKTCOUNTSET lt portnum gt lt varname gt Set the packet count to the value specified PRINT lt string gt Display message string string in green color in the output screen Non printable characters are not translated into hh Embedded Wireless Solutions Support Center 7 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide PRINTE lt string gt Display message string string in green color in the output screen Non printable characters are translated into hh PORT lt portnum gt lt comport gt 9600 N 8 1 0 1 0 1
12. ill thrash the PC s CTS input signal and an exception No more trigger slots is displayed If the first is missing but second present then the separator should be SETDTR lt port gt lt ON OFF gt Sets DTR output to ON or OFF for port port SETRTS lt port gt lt ON OFF gt Sets RTS output to ON or OFF for port port Handshaking has to be disabled in PORT and PORT_MPOINT for this to work SETVAR lt varname gt lt string gt Store value string without the quotes in varname SPRINTHEX lt varname gt lt hex_integer_value_string gt On entry varname must contain a format string compatible with the C printf function if it is empty then d is assumed The hexstring is then converted to an integer value using the C scanf function Finally that integer value is fed into a C sprintf function and the output string is stored back in varname For example SET vImp d SPRINTHEX vTmp 102 PRINT vTmp Results in PRINT outputting 258 SPRINTINT lt varname gt lt decimal_integer_value_string gt On entry varname must contain a format string compatible with the C printf function if it is empty then d is assumed The string is then converted to an integer value using the C atoi function Finally that integer value is fed into a C sprintf function and the output string is stored back in varname For example SET vTm
13. ional 0 1 is missing but the second is present then the separator should be PORTINFO lt varname gt lt portnum gt lt nInfold gt Returns port info identified by ninfold in the variable specified where ninfold is ninfold Description 0 Bytes received since last time PORTINFO called with ninfold 0 The count is reset as a result of the read Bytes received since last time PORTINFO called with ninfold 0 The count is not reset 16 Free space in transmit buffer 32 Number of times CTS has toggled 33 Number of times DSR has toggled 34 Number of times DCD has toggled 35 Number of times RI has toggled 1 SAVERESP lt varname gt lt portnum gt Stores the current content of the receive buffer in Logical pipe lt portnum gt to the variable varname The response string is echoed to the screen SAVERESPNE lt varname gt lt portnum gt Stores the current content of the receive buffer in Logical pipe lt portnum gt to the variable varname The response string is not echoed to the screen SEND lt timeoutMs gt lt portnumA gt lt txstr gt lt portnumB gt lt rxstr gt Transmit txstr from COM lt portnumA gt and wait for rxstr to arrive at serial port COM lt portnumB gt The receive string MUST arrive within timeoutMs Set timeoutMs to 1 to use default timeout which is set via command DEFTIMEOUT described above Embedded Wireless Solutions Support Center 8 Laird Techno
14. logies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide SENDCMD lt portnum gt lt txstr gt Transmit txstr from COM lt portnum gt after flushing the receive buffer Proceed immediately to next action SENDMPDATA lt portnum gt lt channel gt lt txstr gt Transmit txstr from COM lt portnum gt in a data packet in logical channel specified Only data is supplied in txstr the packet length and channel numbers are automatically prepended SENDWAIT lt timeoutMs gt lt portnum gt lt txstr gt Transmit txstr from Logical pipe lt portnum gt and wait for timeoutMs SENDWAITOK lt timeoutMs gt lt portnum gt lt txstr gt Transmit txstr from Logical pipe lt portnum gt and wait for an N nOK r n SENDWAITERR lt timeoutMs gt lt portnum gt lt txstr gt Transmit txstr from Logical pipe lt portnum gt and wait for an r nERROR SETCOMMS lt portnum gt 9600 N 8 1 0 1 0 1 Change the serial comport Logical pipe lt portnum gt so that it uses parameters specified The first lt 0 1 gt in the string is optional and specifies CTS RTS handshaking If it is not specified then CTS RTS is enabled The second lt 0 1 gt in the string is optional and specifies modem status change detection If it is not specified then it is enabled It is advised to set this to O if the device w
15. m contains the substring respstr If the substring is found then all data up to and including that substring is deleted from the low level folder WAITTIEVENT lt timeoutMs gt lt portnum gt lt varname gt lt matchstr gt Will wait for a max period of time to see if the receive buffer in portnum contains at least one packet and if so will extract it from the response buffer and save it in the variable varname1 IF and ONLY IF the packet contains the matchstr specified If packet is written to variable then zero flag is set so that IFNZJUMPNZ will succeed APPLICATION EXIT CODE WHEN QUIT Is SPECIFIED IN COMMAND LINE 0 PASS gt 0 FAIL and the value specifies the number of failures 1 A smartBASIC application failed to compile 2 Comport could not be opened 3 PORT statement failed with Host Creation Error 4 PORT statement failed with Seria Port X failed to open 5 PORT statement failed with Comms Parameter X is invalid 6 PORT statement failed with X s not a valid name for a serial port 7 PORT statement failed with Logical Port X cannot be specified 8 PORTCLOSE statement failed with Logical Port Host Type unexpected 9 PORTCLOSE statement failed with Logical Port X invalid 13 PORT statement failed with Host Creation Error 14 PORT statement failed with Serial Port X failed to open 15 PORT statement failed with Comms Parameter X is invalid 1
16. ndow displays EXECUTEWAIT appName optional parameters default_folder_for_child_app Runs the application aooName at compile time and waits until it exits The child process window displays EXECUTEHIDE appName optional parameters default_folder_for_child_app Runs the application appName at compile time and immediately proceeds to the next statement The child process window is hidden EXECUTEWAITHIDE appName optional parameters default_folder_for_child_app Runs the application appName at compile time and waits until it exits The child process window is hidden Embedded Wireless Solutions Support Center 3 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide STATEMENTS The following are arithmetic commands lt ADD MUL DIV SUB TSTIMOD AND OR XOR ROR ROL ABS gt lt varname gt lt value gt Performs the arithmetic using value converted to an integer to varname and result is stored back as a string except for TST which is as per SUB but the variable is not updated An internal ConditionFlag register is updated so that it can be used with the IF lt cond gt and JUMP lt cond gt commands lt HEXADD HEXMUL HEXDIV HEXSUB HEXTST HEXMOD gt lt varname gt lt value gt lt HEXAND HEXOR HEXXOR HEXROR HEXROL gt lt varname gt lt value gt Performs the hex arithmetic using value
17. p 0x 04X SPRINTINT vTmp 258 PRINT vTmp Results in PRINT outputting 0x0102 Embedded Wireless Solutions Support Center 9 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide STRCAT lt varname1 gt lt string gt Concatenate string to variable varname1 STRCMP lt varname1 gt lt varname2 gt Compares the two strings and the condition flag Z is updated Z will be set if the two compare STRCMPI lt varname1 gt lt varname2 gt Compares the two strings ignoring case and the condition flag Z is updated Z will be set if the two compare STRLEN lt varname1 gt lt varname2 gt Stores the length of the string in varname as a value string in varnamez2 To be precise varname2 will contain the length STRSTR lt varname1 gt lt varname2 gt Check if varnamez2 string is contained inside varname1 string and the compare is case sensitive and the condition flag Z is updated Z will be set if the varnamez2 is present in varname1 STRSTRI lt varname1 gt lt varname2 gt Check if varnamez2 string is contained inside varname1 string and the compare is case insensitive and the condition flag Z is updated Z will be set if the varnamez2 is present in varname1 TIMER START lt varname gt Start timer msec resolution TIMER ELAPSE lt varname1 gt
18. r SysVarArgX See SysVarArgO The specified script is processed If a script is not specified then on startup an open file dialog box allows you to pick a script for processing SCRIPT SomeFileName When the application starts Somefo derName is set as the current working CWD SomeFolderName dicti ictionary The decimal number NNN is clipped between 1 and 100 This indicates the MAXTRY NNN number of times it tries a test which began from the most recent TITLE statement LOGPATH SomeFolderName Indicates the absolute or relative path for the folder where the logfile is saved PREDEFINED SYSTEM VARIABLES SysVarAppVersion Contains the test application version string as shown in the title bar Contains the value of ARG something command line arguments when the SYSVA ve SYSVATANgTS application is invoked The first ARG XX goes into SysVarArgO and so on SysVarMaxPorts Contains the maximum number of serial ports that can be managed When the statement CONTAINS is processed this variable is updated with the sysVarMatchCount number of times the match was encountered If this string has a non zero integer value then when a variable is encountered Sve areolar hissing and it is missing the script fails SysVarMagicCmd Contains the magic command for invoking factory default mode on power up Contains a null string by default This indicates that the default message is SysVarOnFailMe
19. ssage printed when a test fails Otherwise the content of this message is printed When the blocking statement MESSAGEBOX returns because the user selected a button this variable contains a decimal string with value in the range 1 to 7 This VarMsgBoxBtnVal so ugh pysvaiisgBOxEEiva signifies the button that was clicked as follows 1 OK Embedded Wireless Solutions Support Center 2 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide CANCEL ABORT RETRY IGNORE YES NO NO UB WN When the blocking statement MESSAGEBOX returns because the user selected a button this variable contains a descriptive string which signifies that the button was Clicked as follows ok cancel abort retry ignore yes no unknown contact Laird if this occurs SysVarMsgBoxBtnName DIRECTIVES INCLUDE filename Include and compile the script defined in filename INCLUDEFOLDERn fo dername foldername is used to look for include files if the file is not found in the script folder Up to version 1 6 x n was in the range 0 to 3 inclusive As of version 1 7 0 nis in the range O to 9 inclusive EXECUTE appName optional parameters default_folder_for_child_app Runs the application appName at compile time and immediately proceeds to the next statement The child process wi
20. the transmit buffer of Logical pipe lt portnum gt LABEL lt labelname gt Marks the action as a label labelname only has a script file scope MATCHCOUNT lt varname gt lt string gt Counts the number of times string appears in varname The system variable SysVarMatchCount is updated which can then be used with the arithmetic functions Embedded Wireless Solutions Support Center 6 Laird Technologies http ews support lairdtech com Americas 1 800 492 2320 Europe 44 1628 858 940 www lairdtech com wireless Hong Kong 852 2268 6567 x026 STRINGPLAYER User Guide MESSAGEBOX lt messagetext gt lt dialogcaption gt lt buttons gt This is a blocking statement which is used to display a modal dialog box with text messagetext and a dialog box title dialogcaption with 1 or more buttons The buttons displayed are dependent on the value of the integer value buttons as follows Yes No 1 Yes No Cancel 2 Ok 3 Ok Cancel 4 Retry Cancel 5 Abort Retry Ignore Other Abort Retry Ignore When the user selects a button the system variable SysVarMsgBoxBtnVal will contain a decimal value string in the range 1 to 7 inclusive as follows OK CANCEL ABORT RETRY IGNORE YES NO NOW BWN If you prefer a descriptive text describing the button that was pressed then use the system variable SysVarMsgBoxBtnName MID varname string Offset Length The substring of string starting at Of

Download Pdf Manuals

image

Related Search

Related Contents

IAN 113043 - Lidl Service Website  Manual de usuario - Electrónica Embajadores  

Copyright © All rights reserved.
Failed to retrieve file