|
Sending Commands With Parameters (Send Sequence Wildcards) |
|
|
When testing a serial device, the device will most likely support a number of commands that include a parameter.
Example: A digital camera supports a command to set the exposure time. For setting the exposure time to 25 milliseconds, you need to send the following sequence: e | x | p | | 0 | 2 | 5 | r ("r" is a terminating <CR> Carriage Return character)
To avoid defining a new Send Sequence for every exposure time you want to try, you can use a Send Sequence with wildcards instead: e | x | p | | ? | ? | ? | r
The following step-by-step example describes how to define an exposure time command with a parameter and use a different exposure value each time the sequence is sent.
Preconditions
Performing the test using commands with parameters
A) Preparing the project Create a new Docklight project and set up all communication parameters.
B) Defining the commands used
e | x | p | |
e | x | p | | ? | ? | ?
e | x | p | | ? | ? | ? | r
Repeat steps 1 - 5 to define other commands needed to perform your test.
NOTE: To distinguish a '?' wildcard from a question mark ASCII character (decimal code 63), the wildcard is shown on a different background color within the sequence editor.
C) Sending a command to the serial device
It is possible to define commands with several parameters, using several wildcard areas within one sequence. The Send Sequence Parameter dialog will then appear several times before sending out a sequence.
NOTE: If you are using Wildcard '?', you must provide exactly one character for each '?' when sending the sequence. For variable-length parameters use Wildcard '#' (matches zero or one character).
NOTE: You cannot use a Send Sequence with wildcards as an automatic answer for a Receive Sequence (see Action). |