RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
403
innovators for industry
Ctrl Command select_rtc
Function
defines, in a multi-board system, the active RTC
®
5 board for an application (user
Call
NoOfSelectedCard = select_rtc( CardNo )
Parameter
CardNo
(DLL-internal) number of the RTC
®
5 board as an unsigned 32-bit value
Result
The returned (unsigned 32-bit) value is
•
CardNo
if access rights exist for the specified board or if the specified board is not allo-
cated to another application (in this latter case, access rights are acquired through
select_rtc
, see below)
• the number of the active board if
CardNo
exceeds the number of RTC
®
5 boards found
during initialization or if
CardNo
= 0
• 0 otherwise (particularly when the specified board is reserved by another application or
if a version compatibility error is detected and activation of the board therefore can’t
succeed) (
return code
RTC5_ACCESS_DENIED
and possibly
RTC5_VERSION_MISMATCH
)
Comments
• Activation of a board for an application already occurs when the DLL for this application
is initialized (see
). The
select_rtc
command offers the possi-
bility of changing the active board at any time. All the application’s commands subse-
quent to
select_rtc
(except for multi-board commands) will be forwarded to the
corresponding active board.
• If the specified board is reserved for another application,
select_rtc
will have no effect
(return value 0,
return code
RTC5_ACCESS_DENIED
).
• If no access rights are assigned for the specified board, and it is not in use by another
application, then the board will not only be activated but also – if it passed the version
compatibility check (see below) – automatically reserved for this application (as via
) and therefore unavailable to other applications (return value:
CardNo
). If a
board is acquired (as via
), a version compatibility check will be performed.
If a version error is detected, then access to the board will be denied and
select_rtc
will
have no effect (return code 0,
return code
RTC5_ACCESS_DENIED
|
RTC5_VERSION_MISMATCH
).
• If the specified board is already the active board for this application,
select_rtc
will have
no effect (return value:
CardNo
).
• The
select_rtc
command also has no effect if
CardNo
exceeds the number of RTC
®
5
boards found during initialization (see
CardNo
= 0
(real boards begin at 1). The return value is then the number of the active board (see
above). Therefore, the command
select_rtc( 0 )
can be used to determine the
number of the active board at any time.
•
The select_rtc
command is also available without explicit access rights to a particular
RTC
®
5 board.
•
select_rtc
is not available as a multi-board command.
RTC
®
4
RTC
®
5 With the RTC
®
4, this command only activates the specified board (unconditionally).
With the RTC
®
5, this command additionally returns a value and either assigns access rights
in some circumstances (as via
) for the specified board when none had existed
or it has no effect.