Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C
February 2018
149
BUS Test and Set
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.
Other
mnemonic:
BUS_TS_WORD
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.
Parameter Description
Allowed Operands
Optional
R
Rack number. UINT constant or variable.
All except %S
—
%SC
No
S
Slot number. UINT constant or variable.
All except %S
—
%SC
No
SS
Subslot number (defaults to 0). UINT constant or
variable.
All except %S
—
%SC
Yes
RGN
Region (defaults to 1). WORD constant or
variable.
All except %S
—
%SC
Yes
OFF
The offset in bytes. DWORD constant or variable. All except %S
—
%SC
No
ST
The status of the bus test and set operation.
WORD variable.
All except variables located in %S
—
%SC, and constant
Yes
Q
Output set on if the semaphore was available (0).
Otherwise, Q is set off.
Power flow
Yes
Summary of Contents for PACSystems RX7i
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...