The BUS_TS function uses semaphores to control access to specific
memory in a module located on the bus.
The BUS_TS function exchanges a Boolean TRUE (1) for the value
currently at the semaphore location. If that value was already a 1,
then the BUSTST function does not acquire the semaphore. If the
existing value was 0, the semaphore is set and the BUS_TS function
has the semaphore and the use of the memory area it controls. The
semaphore can be cleared and ownership relinquished by using the
BUSWRT function to write a 0 to the semaphore location. This
function locks the bus while performing the operation.
When the BUS_TS function receives power flow through its enable
input, the function exchanges a Boolean TRUE (1) with the address
specified by the RACK, SLOT, SUBSLOT, RGN, and OFF parameters.
The function sets the Q output on if the semaphore was available (0)
and was acquired. It passes power flow to the right whenever power
is received and no errors occur during execution.
Operands for BUS Test and Set
BUS_TS can be programmed as BUS_TS_BYTE or BUS_TS_WORD. For BUS_TS_WORD, the absolute
address of the module must be a multiple of 2. The absolute address is equal to the base address
plus the offset value.