Sending messages with conditional delimiters
When WSim processes a conditional delimiter after a message was generated or an AID byte was set, it interrupts message generation and sends the message in the buffer. When all conditions for message generation were satisfied, the device reenters message generation, and WSim continues processing the message generation deck. In contrast to unconditional delimiters, conditional delimiters act as delimiters only when a message exists in the buffer.
| TEXT | Interrupts message generation and sends the message in the buffer to the system under test. When the device reenters message generation,WSim places a new message into the buffer. |
| CMND | Interrupts message generation and sends the message in the buffer to the system under test. When the device reenters message generation,WSim places an SNA command into the buffer. The CMND statement is valid during SNA simulations only. |
| ENDTXT | Interrupts message generation, sends the message in the buffer to the system under test, and ends message generation for a particular device. |
DECK1 MSGTXT
* Beginning of DECK1.
MSG1 TEXT ($DATE$) Places the current date into the buffer.
ENDTXT End of DECK1.
To send the message
from the buffer to the system under test, you must code a delimiter.
However, as discussed in How delimiters are classified, the
preceding example already contains a conditional delimiter, the ENDTXT
statement. When WSim processes
MSG1, it places the current date into the buffer. Then WSim processes
the ENDTXT statement, which indicates that WSim has reached
the end of DECK1. Message generation is stopped at the ENDTXT statement,
and MSG1 is sent to the system under test.When you create message generation decks that are more complex than DECK1, do not use the ENDTXT statement as the only delimiter in the deck. If you code a deck with the ENDTXT statement as the only delimiter,WSim can enter an infinite processing loop within the message generation deck. Instead, you can use a second TEXT statement to send the message generated by the first TEXT statement. As a conditional delimiter, the second TEXT statement sends the message generated by the preceding TEXT statement.
DECK1 MSGTXT
* Beginning of DECK1.
MSG1 TEXT ($DATE$) Places the current date into the buffer.
MSG2 TEXT (PW3) Sends the current date to the system under test and
* ends this pass though message generation. When
* WSim reenters message generation, it places PW3
* into the buffer.
MSG3 TEXT (USER3) Sends PW3 to the system under test and ends this
* pass through message generation. When WSim
* reenters message generation, it places USER3
* into the buffer.
ENDTXT Sends USER3 to the system under test and specifies
* the end of DECK1.
- In the preceding example, WSim places MSG1 into the buffer and continues to process the message generation deck. When WSim processes MSG2, however, MSG2 acts as a delimiter and interrupts message generation. This pass through message generation ends, and WSim sends MSG1 to the system under test.
- When all conditions for message generation were met, the device reenters message generation.WSim then places MSG2 into the buffer. For a list of conditions required for message generation, see How delimiters affect the message generation process.
- In turn, MSG3 interrupts message generation until all required conditions were met. This pass through message generation ends, and WSim sends MSG2 to the system under test. When the device enters message generation again, WSim places MSG3 into the buffer.
- Because MSG3 is in the buffer when WSim processes the ENDTXT statement, the ENDTXT statement serves as a delimiter.WSim stops message generation for DECK1 and sends MSG3 to the system under test.