[Instruction] Contents

[Instruction] Contents [Instruction] Contents

servotechnica.ru
from servotechnica.ru More from this publisher
13.07.2015 Views

Advanced Function InstructionFUN126 PMBRDMATRIX BIT READFUN126 PMBRDReadout controlPointer incrementENINCLadder symbol126P.MBRDMs :L :Pr :OTBENDOutput bitRead to endMs : Starting register of matrixL : Matrix lengthPr : Pointer registerMs may combine with V, Z, P0~P9 to serveindirect address applicationPointer clearCLRERRPointer errorOperandRangeWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C199R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095Ms ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○L ○ ○* ○ ○Pr ○ ○ ○ ○ ○ ○ ○ ○* ○* ○2∣256V、ZP0~P9• When readout control "EN" = 1 or "EN↑" ( P instruction) has atransition from 0 to 1, the status of the bit Mspr pointed bypointer Pr within matrix Ms will be read out and appear at theoutput bit "OTB". Before the readout, this instruction will firstcheck the input -pointer clear "CLR". If "CLR" is 1, then the Prvalue will be cleared to 0 first before the readout action is carriedout. After the readout is completed, If the Pr value has alreadyreached 16L-1 (the final bit), then the read-to-end flag "END" willbe set to 1. If Pr is less than 16L-1, then the status of pointerincrement "INC" will be checked. If "INC" is 1, then Pr will beincreased by 1. Besides this, pointer clear "CLR" can executeindependently, and is not affected by other input.LMsMsprPrOTB• The effective range of the pointer is 0 to 16L-1. Beyond this range the pointer error flag "ERR" will be set to 1,and this instruction will not be carried out.X0ENINCCLR126P.MBRDMs : R 0L :Pr :5R 20OTBENDERR• In the program at left, INC = 1, so every time there isone readout the pointer will be increased by 1. With thisway each bit in Ms may be read out successively, asshown at left in the diagram below. When X0 goes 3times from 0→1, the results are shown at right in thediagram below .PrMs15Ms0↓Ms↓ R20 77R0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1R1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1OTBR2 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 0R3 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1R4 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0↑ ↑Ms79Ms77↑Ms64Before executionPr OTB END R20 78 1 0Pr OTB END R20 79 0 0Pr OTB END R20 79 1 1Execution result7-109

Advanced Function InstructionFUN127 PMBWRMATRIX BIT WRITEFUN127 PMBWRWrite controlWrite-in bitPointer incrementENINBINCLadder symbol127P.MBWRMd :L :Pr :ENDERRWrite to endPointer errorMd : Starting register of matrixL : Matrix lengthPr : Pointer registerMd may combine with V, Z, P0~P9 to serveindirect address applicationPointer clearCLROperandRangeWY WM WS TMR CTR HR OR SR ROR DR K XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0 R3904 R3968 R5000∣ ∣ ∣ ∣R3839 R3967 R4167 R8071D0∣D4095Md ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○L ○ ○* ○ ○Pr ○ ○ ○ ○ ○ ○ ○ ○* ○* ○2∣256V、ZP0~P9• When write control "EN" = 1 or "EN↑" ( P instruction) has atransition from 0 to 1, the status of the write-in bit "INB" will bewritten into the bit Mdpr pointed by pointer Pr within matrix Md.Before the write-in takes place, the status of pointer clear "CLR"will be checked. If "CLR" is 1, then Pr will be cleared to 0 beforethe write-in action. After the write-in action has been completed,the Pr value will be checked again. If the Pr value has alreadyreached 16L-1 (last bit), then the write-to-end flag will be set to1. If the Pr value is less than 16L-1 and "INC" is 1, then thepointer will increased by 1. Besides this, pointer clear "CLR" canexecute independently, and is not affected by other input.LMsMsprPrOTB• The effective range of Pr is 0 to 16L-1. Beyond this range, the pointer error flag "ERR" will be set to 1, andthis instruction will not be carried out.X0X1ENINBINCCLR127P.MBWRMs : R 0L :Pr :5R 20ENDERR• In the program at left, pointer will be increased each timeexecution (because "INC" is 1). As shown in the diagrambelow, when X0 has a transition from 0→1, the status ofINB (X1) will be written into the Mdpr (Md 78) position, andpointer Pr will increased by 1 (changing to 79). In thiscase, although Pr is pointing to the end, it has not yetbeen written into Md 79, so "END" flag is still 0. Only thenext attempt to write to Md 79 will set “END” to 1.X1 Pr Pr EN1 R20 78 R20 79 0Md15Md0Md15Md0↓Md↓↓ Md↓R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X0= R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R4 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0↑↑↑↑Md79Md64Md79Md64Before executionAfter execution7-110

Advanced Function <strong>Instruction</strong>FUN127 PMBWRMATRIX BIT WRITEFUN127 PMBWRWrite controlWrite-in bitPointer incrementENINBINCLadder symbol127P.MBWRMd :L :Pr :ENDERRWrite to endPointer errorMd : Starting register of matrixL : Matrix lengthPr : Pointer registerMd may combine with V, Z, P0~P9 to serveindirect address applicationPointer clearCLROperandRangeWY WM WS TMR CTR HR OR SR ROR DR K XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0 R3904 R3968 R5000∣ ∣ ∣ ∣R3839 R3967 R4167 R8071D0∣D4095Md ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○L ○ ○* ○ ○Pr ○ ○ ○ ○ ○ ○ ○ ○* ○* ○2∣256V、ZP0~P9• When write control "EN" = 1 or "EN↑" ( P instruction) has atransition from 0 to 1, the status of the write-in bit "INB" will bewritten into the bit Mdpr pointed by pointer Pr within matrix Md.Before the write-in takes place, the status of pointer clear "CLR"will be checked. If "CLR" is 1, then Pr will be cleared to 0 beforethe write-in action. After the write-in action has been completed,the Pr value will be checked again. If the Pr value has alreadyreached 16L-1 (last bit), then the write-to-end flag will be set to1. If the Pr value is less than 16L-1 and "INC" is 1, then thepointer will increased by 1. Besides this, pointer clear "CLR" canexecute independently, and is not affected by other input.LMsMsprPrOTB• The effective range of Pr is 0 to 16L-1. Beyond this range, the pointer error flag "ERR" will be set to 1, andthis instruction will not be carried out.X0X1ENINBINCCLR127P.MBWRMs : R 0L :Pr :5R 20ENDERR• In the program at left, pointer will be increased each timeexecution (because "INC" is 1). As shown in the diagrambelow, when X0 has a transition from 0→1, the status ofINB (X1) will be written into the Mdpr (Md 78) position, andpointer Pr will increased by 1 (changing to 79). In thiscase, although Pr is pointing to the end, it has not yetbeen written into Md 79, so "END" flag is still 0. Only thenext attempt to write to Md 79 will set “END” to 1.X1 Pr Pr EN1 R20 78 R20 79 0Md15Md0Md15Md0↓Md↓↓ Md↓R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X0= R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R4 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0↑↑↑↑Md79Md64Md79Md64Before executionAfter execution7-110

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

Saved successfully!

Ooh no, something went wrong!