Yaskawa NS300 User Manual

Page 8

Advertising
background image

Subject: Technical Note

Product: NS300/NS500

Doc#: EM.MCD.05.106

Title: NS300/500 Master Ladder Example


Doc#: Copyright Yaskawa Electric America

©2004

May 9, 2007

Page 8

of 16

This technique is easily visible in the last section of code. Starting in line 49, the long accumulator is loaded with

zero. The starting value of the accumulator is recommended to either be the current value of the selected register

(load the accumulator with the register value), or the desired register value if no data manipulation occurs. Lines

50 thru 56 perform the manipulation by loading the accumulator based on the selected command, as well as

range check and limit functions for certain command types. Lastly, the actual output register to the NS300/500 is

then loaded in line 51.

Another added feature of using the waterfall technique is that important registers are updated each scan. In this

example, the output register is loaded with zero on the first scan after the user sets the command to no operation.

This is very useful as it eliminates any residual data that may otherwise cause command errors if the residual

data is out-of-range or improperly formatted for the ensuing command.

The second recommended best practice is to avoid using set/reset coils. Set/reset coils are never recommended;

these coils are extremely difficult to troubleshoot since identifying the condition that caused a set or reset may not

be visible. For this reason, latch circuits are always recommended. Latch circuits are recommended as they can

be used to easily identify the cause of the current state of the coil. An example of a latch circuit is the command

bit circuit shown on line 33 of the example master ladder.

Fig 3. Command Bit Sequencing Circuit

The coil is set on the rising edge of the PLC_COMMAND_START bit as long as the COMMAND_OVERRIDE and

READY contacts are satisfied. COMMAND_BIT latches itself in the middle and last rungs. In the middle rung,

the circuit will stay latched until the PRGS_FALL or SET_READ_COMMAND contacts open. In the last rung, the

circuit will stay latched as long as the PLC_COMMAND_START and SET_READ_COMMAND contacts remain

closed. If the command bit is set unexpectedly, monitoring this circuit will indicate exactly what is causing the coil

to remain on as the coil status is updated every scan.

Advertising
This manual is related to the following products: