|
SendSequence |
|
|
Sends a Send Sequence or a custom data sequence. Starts the communication, if not already running (see StartCommunication).
Return Value
Void
Syntax 1
DL.SendSequence nameOrIndex [, parameters] [, representation]
Sends out the Send Sequence that matches nameOrIndex. The SendSequence method syntax 1 has these parts:
Remarks (Syntax 1)
If the wrong number of parameters is provided by the parameters argument, or the parameter length does not match the corresponding wildcards region, Docklight will not raise an error, but apply the following rules:
DL.SendSequence "", customSequence [, representation]
Sends out a custom data sequence. The SendSequence method syntax 2 has these parts:
Remarks (Syntax 2)
If you are using "H" (HEX), "D" (Decimal) or "B" (Binary) format, please note that each character / byte must have a fixed-length format as used in the Edit Sequence Dialog and the Communication Window. E.g., a custom sequence in decimal format must always contain 3-digit numbers. Valid decimal sequence: "001 002 003" Invalid decimal sequence: "1 2 3" (The sequence data will be ignored)
Example
' Example SendSequence
' Predefined Send Sequences ' (0) Test: Test ' (1) One: One<#><#><#><CR><LF> ' (2) Two: One<?><?><?>Two<#><#><#>
DL.StartCommunication DL.ClearCommWindows ' Send sequence without parameter DL.SendSequence "Test" ' Send sequence with one parameter DL.SendSequence "One", "100" ' Send sequence with two parameters DL.SendSequence "Two", "100 20" ' Pass two parameters in HEX representation, including spaces and control characters DL.SendSequence "Two", "20 31 20, 30 0D 0A", "H" ' Send custom sequence data, not using a predefined Send Sequence DL.SendSequence "", "Custom Data"
' And now using a loop and the loop variable ' for the Send Sequence parameter values For i = 1 To 10 parString = i & " " & i+1 ' use a space to separate parameters DL.SendSequence "Two", parString Next
DL.StopCommunication
After running the script, the Docklight communication window could look like this:
08/05/2008 13:50:35.622 [TX] - Test 08/05/2008 13:50:35.631 [TX] - One100<CR><LF>
08/05/2008 13:50:35.665 [TX] - One100Two20 08/05/2008 13:50:35.682 [TX] - One 1 Two0<CR><LF>
08/05/2008 13:50:35.699 [TX] - Custom Data 08/05/2008 13:50:35.713 [TX] - One1 Two2 08/05/2008 13:50:35.745 [TX] - One2 Two3 08/05/2008 13:50:35.771 [TX] - One3 Two4 08/05/2008 13:50:35.807 [TX] - One4 Two5 08/05/2008 13:50:35.846 [TX] - One5 Two6 08/05/2008 13:50:35.878 [TX] - One6 Two7 08/05/2008 13:50:35.907 [TX] - One7 Two8 08/05/2008 13:50:35.922 [TX] - One8 Two9 08/05/2008 13:50:35.955 [TX] - One9 Two10 08/05/2008 13:50:35.987 [TX] - One10 Two11
|