STISIM Drive (SDL) - DI - Digital Input

This event allows you to read digital inputs from an external piece of equipment during a simulation run. This event works slightly different in STISIM Drive than it did in the DOS version of STISIM. The simulation accepts digital inputs on 12 separate pins. The signal bits are input through port A (pins 30-37, 8 bits) and through the low portion of port C (pins 26-29, 4 bits). Once the event has been activated, the system will continually poll the interface card until it detects an input on one of the available pins. At this time the system will record the response time, the correctness of the response and then turn the event off. Only 1 DI event can be active at a time. The next DI event in the events file will cancel any current DI event that may be active. The final results of the DI event are compiled in their own section of the STISIM Drive data file. Review the hardware configuration section for information about the boards supported and configuring them. In addition, if you will be using the DI event you must make sure that the digital I/O option has been enabled in STISIM Drive's configuration. To enable the digital I/O, simply check the box on the I/O controls tab found in the configuration option.

EVENT PARAMETERS:

PARAMETER 1:

A number that corresponds to the expected correct response for the DI event. Each DI event requires that you specify what the correct response will be during the event. This is required because the software checks the driver’s response with the expected response to determine if the driver responded correctly. When a driver responds, signals come across various pins on the digital I/O card, and the DI event records which of the pins on the I/O card are currently set.

If a bit is set to 1 on any of the port's pins, the program will check to see if that bit matches to the setting of the corresponding bit specified as the correct response. The number that is specified is the decimal equivalent of a 12 bit binary number, where the first 4 bits of the number are the 4 bits of Port C on the I/O card and the last 8 bits are Port A. If you know which pins the desired response will be coming across on, simply use the Windows scientific calculator in binary mode to specify the bits, then convert it into a decimal number. The 12 bit number is as follows:

         Port C Low:  Port A:

Bits:  {12 11 10 9}  {8 7 6 5 4 3 2 1}

Note: When creating the hardware that is required to input the signals from external devices, you may require push up or pull down resistors in order for the hardware to operate correctly. Refer to the documentation that comes with your digital interface card.

EXAMPLES:

100,DI,64
100,DI,2048

The DI event is strictly used for processing data from an external piece of hardware. For example, you can use an external computer to display information to the driver and have the driver respond to this information. When the driver responds, the external machine will set a bit on the desired pin of the interface card and the STISIM Drive software will interpret this input based on the expected correct response given on the DI event line. In the examples shown, when the driver has traveled 100 feet down the road the software will begin polling the interface board for external inputs. When the interface board receives an external input, the software will compare the pins that are set on the board to the response given. In the first example if pin that is set on the board is pin 31 (the 7th bit on Port A), then the driver has responded correctly, otherwise an incorrect response is recorded. In the second example, if the input came across on pin 26 (the 4th bit on Port C), then a correct response would be recorded.