13.07.2015 Views

CJ2 CPU Unit Software User's Manual - CIP ETI

CJ2 CPU Unit Software User's Manual - CIP ETI

CJ2 CPU Unit Software User's Manual - CIP ETI

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 Understanding Programming5-8-2 Examples of Address Offset ApplicationIt is possible to dynamically specify the offset by specifying a word address in I/O memory for the offsetin the brackets. The contents of the specified word address will be used as the offset. For example, executioncan be performed by increasing the address by incrementing the value in the brackets and usingonly one instruction. Example of Ladder ProgrammingIn this example, two areas of consecutive data are used: D0 to D99 and D100 to D199. The contentsof corresponding words are added starting from the specified starting point, W0, to the end of theareas and the sums are output to D200 to D299 starting from the specified offset from D200. Forexample, if W0 is 30, the corresponding words from D30 to D99 and D130 to D199 are added, andoutput the sums are output to D230 to D299.The offset, W1, is set to the value of W0 using a MOV instruction.Execution is performed by specifying D0[W1] + D100[W1] = D200[W1]using an ADD instruction.The offset (W1) is incremented.100 repetitions max.Each process is performed with an input comparison instruction (

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!