RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
83
innovators for industry
6.6 Using Multiple RTC
®
5 Boards
in One Computer
The RTC
®
5 driver DLL supports simultaneous control
of any number of RTC
®
5 boards in one PC.
The RTC
®
5 boards work completely independently of
each other. Command lists for each board can be
loaded and executed at any time.
There are two different methods for writing
application programs using several RTC
®
5 boards:
• the multi-board programming and
• the sequential programming.
6.6.1 Multi-Board Programming
In this programming method, so-called
multi-board
versions of the RTC
®
5 commands are used. Each of
these multi-board commands allows specifying the
number of the RTC
®
5 board that shall receive the
command. To use a multi-board command, simply
Add the prefix
n_
to the command name, and
include the number of the RTC
®
5 board to
which the command shall be sent as the
first
parameter (unsigned 32-bit value). The remaining
parameters of the command – if any – are the
same as for the normal (single-board) command.
The installed RTC
®
5 boards are numbered in the
order found during initialization (starting with 1). The
multi-board command
n_get_serial_number
(see
) can be used to determine which RTC
®
5
boards have been assigned numbers (see example 3
below). The command
RTC5_count_cards
(see
) can be used to check how many boards are
detected by the driver DLL.
Notes
• If the specified number exceeds the number of
RTC
®
5 boards found during initialization (see
(real boards begin at 1), multi -board commands
are sent to the active board.
All multi-board commands are listed in
. Nearly all single-board commands are also
available in multi-board form. Exceptions are
explicitly noted in the description list (in
).
Examples: (Pascal)
1.
n_jump_abs(1, 500, 500)
writes a jump command to the point (500, 500)
into the current list of RTC
®
5 board #1.
2.
n_execute_list(RTC5_no, list_no)
executes list number
list_no
(1 or 2) on the
RTC
®
5 board with the number specified by the
variable
RTC5_no
.
3.
sn_1 := n_get_serial_number(1)
returns the serial number of board #1.
6.6.2 Sequential Programming
For sequential programming, the command
activates one of the
installed RTC
®
5 boards for the respective application.
In this programming method, the normal (single
board) commands can be used. The multi-board
commands are not affected by the command
(presumed a valid board number is spec-
ified, see above). All commands following the
command are sent to the selected board
until the command
is used again. The
specified RTC
®
5 number must not be larger than the
total number of RTC
®
5 boards. Also see
.
Care must be taken if a process uses multiple boards
via multiple threads, because the command
immediately redirects the output of
all
currently running threads of a process (not of any
other process) to the specified RTC
®
5 board.
In multi-threaded applications, this can result in
programming errors. For such applications, only the
multi-board commands described in
Caution!
• The command
defines the active
RTC
®
5 board for all threads of one application
that are currently running.
In multi-threaded applications, this can result in
programming errors. For such applications, only
multi-board commands should be used.