13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

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

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

Advanced Function <strong>Instruction</strong>FUN 24 D PSUMSUM(Summation of block data)FUN 24 D PSUMOperation controlENLadder symbol24DP.SUMS :N :S : Starting number of source registerN : Number of registers to be summed(successive N data units starting from S)D : The register which stored the result (summation)D :S, N, D, can associate with V, Z, P0~P9 index register toserve the indirect addressing application.OperandRangeWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○1∣511V、Z• When operation control “EN”=1 or “EN↑” ( P instruction) changes from 0→1, it puts the successive N units of16bit or 32 bit ( D instruction) registers for addition calculation to get the summation, and stores the result intothe register which is designated by D.• When the value of N is 0 or greater than 511, the operation will not be performed.• Communication port1 or port2 can be used to serve as a general purpose ASCII communication interface. Ifthe data error detecting method is Check-Sum, this instruction can be used to generate the sum value forsending data or ot use this instruction to check if the received data is error or not.〈Example 1〉When M1 changes from OFF→ON, following instruction will calculates the summation for 16-bit data.M124P.SUMEN S :N :D :R06R100• The left illustrates that 6 16-bit registers starting from R0is calculated for summation, and the result is stored intothe R100 register.R0=0030HR1=0031HR2=0032HR3=0033HR4=0034HR5=0035HR100=012FH〈Example 2〉When M1 is ON, it calculates the summation for 32-bit data.M1EN24D.SUMS : R0N : 3• The left illustrates that three 32-bit registers startingfrom DR0, is calculated for their summation, and theresult is stored into the DR100 register.D :R100R1,R0=00310030HR3,R2=00330032H R101,R100=00A5009BHR5,R4=00410039H7-3

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

Saved successfully!

Ooh no, something went wrong!