10ć16 – Rockwell Automation 1771-QB Linear Pos. User Manual

Page 160

Advertising
background image

Sample Application Programs

Chapter 10

10Ć16

Program Rungs for Application Program #2

Figure 10.15 and Figure 10.16 show the ladder diagram programming for this
application on a PLC-5/15 system. The rungs perform the following functions:

Rung 2:0

Rung 2:0 reads the module’s status block and, in conjunction with rung 2:5,
performs bidirectional block transfers to and from the module.

Important: Set the SQO length in rung 2:3 to the number of motion blocks to
be loaded, plus 1.

Rung 2:1

Rungs 2:1, 2:3 and 2:4 determine which block (parameter, motion or command)
will be sent to the module via the next block transfer write (BTW). If the axis 1
ready bit is low (the module is in powerup or a reset has just been executed),
rung 2:1 moves the source address of the parameter block into the BTW’s
control block, causing the programmable controller to send the parameter block
when rung 2:5 is executed.

Rung 2:2

When the ready bit first goes high (the module has just received a valid
parameter block), the control files for the sequencer output instructions (SQO)
are reset and a NOT instruction is performed on the status block word
containing the block transfer toggle bit (bit 7). The result is stored in reference
word B3:1 and guarantees that the data transition instruction (DTR) on rung 2:3
will be true, causing the first motion block to be loaded.

Rung 2:3

If the ready bit is high and the sequencer’s done bit is low (the module has
received a parameter block, but has not yet loaded all the motion blocks), the
data transition instruction (DTR) compares the block transfer toggle bit in the
status block with the state of the toggle bit from the previous scan. If they differ,
the next motion block’s address is sequenced into the BTW’s control block
causing the programmable controller to send the next motion block when rung
2:5 is executed.

Advertising