STISIM Drive
(SDL) - DO - Digital Output
This event allows you to
send digital outputs to external equipment during simulation runs. The AO, CAO, DO, and TDO events are the only way you can control external
equipment during a simulation run. This event works slightly different in
STISIM Drive than it did in the DOS version of STISIM. The simulation allows
you to specify the output of up to 12 individual pins on the I/O card. These
outputs are processed through port B (pins 3-10, 8 bits) and through the high
portion of port C (pins 22-25, 4 bits). Review the hardware section for information on the
output boards support and how to configure them. In addition, if you will be
using the DO 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: |
Number that sets the specified pin’s outputs to high (1) or low (0). In the DOS version of STISIM this operation was done with 2 parameters, but now it only requires this single parameter. The I/O card is automatically configured so that there are 12 bits that you can set to either high (1) or low (0). The first 4 bits of the number are the high portion of Port C while the final 8 bits are from Port B. Port C High: Port B: Bits: {12 11 10 9} {8 7 6 5 4 3 2 1} When you decide which pins you will change, simply use the
Windows scientific calculator in binary mode to specify the bits, then
convert it into a decimal number and use this number as the input. Because STISIM Drive is used for a variety of
applications, sometimes we add a custom option that will not be useful for
everyone but is available for everyone to use. The DO event is one of these
options. Several researchers that use STISIM Drive need real-time information
about potential time to collisions (TTCs). In order for them to receive this
data in real-time, STISIM Drive sends a digital signal that is proportional
to the TTC. In order to use this special option you must set this parameter
to a negative value. If this parameter is set to a negative value (we use –1)
then at each simulation frame time, STISIM Drive will send out the smallest
value of TTC that it computes (TTC is computed for each non cross traffic,
CT, vehicle in the display scene). There are a couple of limits to this
approach: 1. Since the TTC is sent continuously during the run, you
can not use the DI and TDO events at all, and you can only use the DO event
for sending TTC. 2. The data that is sent is 12 bits and needs to be divided by 1000 in order to compute the actual TTC value. |
EXAMPLES:
100,DO,32
1000,DO,256
This event was designed to
give the user some control over external hardware without having to change the
STISIM Drive software. For example, you can control an external
computer by sending bits of information from STISIM Drive to
the computer and then having the external computer interpret this data and then
act on it. The first example simply sets bit 6 of Port B (pin 5 on the
CIO-DIO-24 board) to high, and clears all remaining pins (pin 5 set high the
rest set low). If the second example was used in the same scenario as the
first, then at 1000 feet pin 5 would go low (because bit 6 is being set to 0)
while pin 25 would be set high because bit 9 (in the number 256) is set to
high.