RTC
®
4 PC Interface Board
Rev. 1.3 e
5 Advanced Programming
43
innovators for industry
5.4 Using Multiple RTC
®
4 Boards
In One Computer
The RTC
®
4 driver DLL supports simultaneous control
of up to eight RTC
®
4 boards in one PC.
The RTC
®
4 boards work completely independently of
each other. Command lists for each board can be
loaded and executed at any time.
Command Set
There are two different methods for writing
application programs using several RTC
®
4 boards:
(A) Multi-Board Programming
In this programming method, so-called
multi-board
versions of the RTC
®
4 commands are used. Each of
these multi-board commands allows specifying the
number of the RTC
®
4 board that shall receive the
command.
The installed RTC
®
4 boards are numbered in the
order given by the PCI bus (from 1 to a maximum of
8). The command
n_get_serial_number
(see
) can be used to determine which RTC
®
4
boards have been assigned numbers 1 to 8 (see
example 3 below). The command
rtc4_count_cards
(see
) can be used to check how many
boards are detected by the driver DLL.
All multi-board commands are listed 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
®
4 board #1.
2.
n_execute_list(RTC4_no, list_no)
executes list number
list_no
(1 or 2) on the
RTC
®
4 board with the number specified by the
variable
RTC4_no
.
3.
sn_1 := n_get_serial_number(1)
returns the serial number of board #1.
(B) Sequential Programming
For sequential programming, the command
activates one of the
installed RTC
®
4 boards. In this programming
method, the normal (single board) commands can be
used. The multi-board commands are not affected by
the command
select_rtc
. All commands following
the
select_rtc
command are sent to the selected
board until the command
select_rtc
is used again.
The specified RTC
®
4 number must not be larger than
the total number of RTC
®
4 boards. Also see
.
Care must be taken if several programs or processes
are running on one system simultaneously, because
the command
select_rtc
immediately redirects the
output of
all
currently running processes to the
specified RTC
®
4 board.
In multi-tasking or multi-threaded applications, this
can result in programming errors. For such applica-
tions, only the multi-board commands described in
section
(A)
should be used.
To use a multi-board command, simply
add the prefix
n_
to the command name, and
include the number of the RTC
®
4 board to
which the command shall be sent as the
first
parameter (unsigned 16-bit value). The remain-
ing parameters of the command – if any – are
the same as for the normal (single board)
command.
Caution!
• The command
select_rtc
defines the active
RTC
®
4 board for all programs (threads) that are
currently running.
In multi-tasking or multi-threaded applications,
this can result in programming errors. For such
applications, only multi-board commands
should be used.