•You need the specification of the behavior of the serial device you want to simulate, e.g. what kind of information is sent back after receiving a certain command.
•A second device is connected to a PC COM port, which will communicate with your simulator.
A) Creating a new project
Create a new Docklight project by selecting the menu File > New Project
B) Setting the Communication Options
|1.||Choose the menu Tools > Project Settings...|
|2.||Choose communication mode Send/Receive|
|3.||At Send/Receive on comm. channel, set the COM Port where your serial device is connected.|
|4.||Set the baud rate and all other COM Port Settings required.|
|5.||Confirm the settings and close the dialog by clicking the OK button.|
C) Defining the Send Sequences used
Define all the responses of your simulator. Think of responses when the simulated device is in normal conditions, as well as responses when in fault condition. In the UPS example mentioned above, a battery failure would be such a problem case that is hard to reproduce with the original equipment. To test how other equipment reacts to a battery failure, define the appropriate response sequence your UPS would send in this case.
NOTE: See Testing a serial device... to learn how to define Send Sequences.
D) Defining the Receive Sequences used
In most cases, your simulated device will not send unrequested data, but will be polled from the other device. The other device will use a set of predefined command sequences to request different types of information. Define the command sequences that must be interpreted by your simulator here.
For every command sequence defined, specify Answer as an action. Choose one of the sequences defined in C). If you want to use two or more alternative response sequences, make several copies of the same Receive Sequence, give them a different name (e.g. "status cmd - answer ok", "status cmd - answer battery failure", "status cmd - answer mains failure") and assign different Send Sequences as an action. In the example, you would have three elements in the Receive Sequences list that would respond to the same command with three different answers. During the test you may decide which answer should be sent by checking or unchecking the list elements using the Active column.
E) Storing the project
Before running the actual test, it is recommended that the communication settings and sequences defined be stored. This is done using the menu File > Save Project.
F) Running the test
Start Docklight by choosing Run > Start Communication.
Docklight will now respond to all commands received from the connected serial device.
The on-screen data transfer display allows you to monitor the communications flow. All protocol information can be logged to a text file for further analysis. See section Logging and analyzing a test.
TIP: Using the Documentation Area, you can easily take additional notes, or copy & paste parts of the communication log for further documentation.