RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
227
10.2 RTC
®
5 Command Set
All commands are arranged in alphabetical order.
Ctrl Command acquire_rtc
Function reserves the desired RTC
®
5 board for an application (user program)
Call
NoOfAcquiredCard = acquire_rtc( CardNo )
Parameter
CardNo
the desired board’s (DLL-internal) number as an unsigned 32-bit value
Result The return value (unsigned 32-bit value) is
CardNo
if the reservation was successful, or 0 if
the board is currently reserved for another application or if version check determines an
error.
Comments • The acquire_rtc command is also useful for single-board systems which need to coor-
dinate the use of a board by multiple applications.
•The acquire_rtc command has no effect if
CardNo
exceeds the number of RTC
®
5 boards
found during initialization (see rtc5_count_cards, page 396) or if
CardNo
= 0 (real
boards begin with 1) (return value 0, get_last_error return code:
RTC5_PARAM_ERROR
).
• Access rights to existing boards are assigned exclusively (always to only one application
at a time). The acquire_rtc command therefore has no effect if the requested board is
already reserved by another application (return value 0, get_last_error return code:
RTC5_ACCESS_DENIED
). Before an already-reserved board can be acquired via
acquire_rtc, the application with current access rights must explicitly release its rights
via release_rtc (page 392) or free_rtc5_dll (page 259).
On the other hand, if the board was already freed prior to initialization of an applica-
tion, then initialization via init_rtc5_dll will result in board management assigning
board access rights for the application. In this case, an explicit acquire_rtc call is not
needed and has no effect. Nevertheless, the return value is the
CardNo
.
• Assorted versions of the driver DLL and the program files
RTC5OUT.out
,
RTC5RBF.rbf
and
RTC5DAT.dat
cannot be arbitrarily combined with another. The command
acquire_rtc performs a version compatibility check. If no program files are loaded, then
a version check can’t be explicitly executed (get_last_error return code:
RTC5_TIMEOUT
), but the check will still be regarded as successful and acquisition will not
be hindered. If program files have been loaded and the version check determines an
error, then access will be denied (return value 0, get_last_error return code:
RTC5_ACCESS_DENIED
|
RTC5_VERSION_MISMATCH
).
• A board successfully requested via acquire_rtc does not automatically become the
active board. Activation is only achieved via select_rtc (page 403) or init_rtc5_dll.
• Running boards are neither halted nor initialized via acquire_rtc.
•The acquire_rtc command is also available without explicit access rights to a particular
RTC
®
5 board.
• acquire_rtc is not available as a multi-board command.
• Also take into account "Board Acquisition by an Application", page 86.
RTC
®
4
RTC
®
5new command
References init_rtc5_dll, select_rtc, free_rtc5_dll, release_rtc, rtc5_count_cards