# FX2N function instruction is used

• Time:
• Click:32
PLC function instruction is a function actually the PLC subprogram of each different piece. The functional instruction of FX2N series PLC has a program flow, deferent quite, operation of logic of the four fundamental operations of arithmetic, rotate operation of number of processing of processing of shift, data processing, high speed, convenient instruction, peripheral equipment, floating-point, clock, contact is compared etc a certain number of kind. This section introduces the functional directive with FX2N series commonly used PLC only. One, functional statement form 1. The function dictates format 　 function dictates with number FNC00 ～ FNC246 expresses, give out corresponding statement name, every function instruction has an instruction list. For example the instruction that FNC45 is function of average of a data processing, mnemonic is MEAN, use simple and easy process designing implement when input FNC45, and use intelligent process designing implement or when computer process designing MEAN of importable also mnemonic. Graph 1 it is an echelon picture that takes average function instruction. The MEAN in graph of 　 of graph of echelon of give typical examples of graph 1 MEAN is the statement name that the function dictates, also can use FNC45 (but not intuitionistic) ; D0 is a component of source operand; D4Z is the address of the data register that appoints computation to be deposited as a result; K3 is to appoint those who take a cost a number for 3. Apparent the meaning that this function dictates is D4Z = (D0+D1+D2) / 3, be about to (D0+D1+D2) / the operation result assignment of 3 gives D4Z. The instruction that the function dictates paragraph take step of a program normally, 16 operand take 2 steps, 32 operand take 4 steps. 2.

function instruction has functional instruction executive means to be carried out continuously carry out two sort with pulse model. Graph 2 in the MOV of the 1st spur track is to be carried out continuously model instruction, put through when X001 namely when, each operation cycle is carried out, and the MOV of the 2nd spur track (P) it is pulse is carried out model model instruction, (P) when stating by OFF when X000 changeover is ON, implement a directive only. Graph 2 functions instruction carries out means give typical examples 3. Can handle instruction of function of data length 　 to be able to handle 16 digit to occupy, also can handle 32 digit to occupy, see a picture graph of echelon of 3 give typical examples. In the 1st stair, put through when X000, criterion the data that instruction of shift MOV function processes is 16, be about to the content of D10 is deferent to D12; And in the 2nd stair, (D) the data that MOV function instruction processes is 32, d21D20 (the 32 digit that form by D21, D20 are occupied) content conveys D23D22 (the 32 digit that comprise by D23, D22 occupy location) . Graph give typical examples of length of data of processing of 3 functions instruction 2, order flow dictates 1. The condition jumps turn instruction 　 jumps when executive condition turn when instruction CJ dictates, skip the process between CJ instruction and grade of pressing with a finger, see a picture 4. When X30 puts through, jump after turning to P20 place to carry out this to be reached all right program, if X30 does not put through, jump turn to be not carried out, the program is carried out by original order. Effective finger limits is instruction practicable P0~P127. 　 of give typical examples of application of instruction of graph 4 CJ is carried out jump turn after instruction CJ, to the directive that is not implemented, although input spare parts condition to produce a change, the condition that exports component also is maintained changeless. 2. The subprogram calls instruction graph 5 CALL to dictate subprogram of give typical examples calls the operand that CALL dictates to be P0 ～ P127, take up 3 programs situation. Need to return instruction SRET with the subprogram (without operand) cooperate to use, see a picture 5. If X0 puts through, turn to grade P10 place to carry out a subprogram. When carrying out a subprogram to end SRET to dictate, return what dictate to CALL to be carried out next. Use subprogram is called with when returning an instruction, should notice move grade cannot repeat, also cannot with jump turn the grade of the instruction repeats. It is OK that the subprogram is called nest is called, can amount to 5 class nest at most. FEND is instruction of main program end, without operand, take up situation of a program. State the main program ends, when carrying out FEND, PLC undertakes an input / output processing, surveillant timer refresh, initial step is returned after finishing. 3, dictate quite 1. CMP dictates graph 6 CMP dictates give typical examples compares CMP instruction to have 3 operand, it is 2 sources operand photograph is compared among them, will send in target operand as a result quite, see a picture 6 give typical examples. When X0 puts through, compare the size that K100 and C10 are worth currently, divide kind of circumstance to put through respectively an auxiliary relay in M0, M1, M2, additional 2 auxiliary relay do not put through. If X0 does not put through, criterion CMP instruction also is not carried out. 2. ZCP dictates 　 interval compares ZCP to dictate is a source data and 2 in a steady stream data phase is compared, compare a result to will affect the data position of target memory, see a picture 7. When X0 puts through, according to the comparison between C30 and K100, K120 result, undertake assigning to M3, M4, M5 respectively. Give typical examples of instruction of graph 7 ZCP 4, FX2N is suitable accuse to dictate PLC of series of 　 　 FX2N has 900 condition element usable pursue medium at ordinal function, among them S0~S9 is initiative condition implement, the initiative condition data in storing ordinal function pursues, s10~S19 is a 0 condition relay, s20~S899 is common position implement. FX2N series PLC is suitable accuse an instruction to the pace enters instruction of the STL that touch a head and pace return RET instruction. Among them STL instruction is used at the pace to take the drive that hits a head, and RST instruction is used at end of pace process a type of local school in ancient times to return. 1.

Odd array is suitable accuse instruction application to pursue 8 be carry makings car is suitable dominate functional picture. The cycle of a job of this car is comprised by 5 paces, part corresponding S0, S20~S23, among them pace S0 is initiative pace. Graph 9 it is sheet of carry makings car alignment is suitable dominate echelon picture, become in the 1st spur track of initialization pulse M8002 often leave when touching a head to close, by SET the instruction is buy of initiative pace S0 mobile pace. Head and X3 touch when the STL of SO in the 2nd spur track often leave when touching a head to put through at the same time, by SET the instruction is S20 buy mobile pace. After entering the 3rd spur track, close when Y1, buy Y0 output is ON and maintain, if spacing switch X1 presses, the condition that is changed to pace S21 by pace S20 is contented, by SET the instruction is S21 buy mobile pace. Till the 6th spur track is medium,be by buy when S23 mobile pace, when at the same time journey switch X2 presses, suitable accuse condition to will change S0 from S23, here beard outputs SO position condition with OUT instruction, in order to realized circular operation. Need to dictate with RET end pace is entered after a series of STL dictate suitable accuse to dictate, make its return left bus. Graph 8 odd array are suitable accuse echelon graph to pursue odd array of car of 9 carry makings arranges the statement that accuses echelon of functional graph 　 to pursue corresponding to dictate the program is: 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of S0 of condition of position of activation of SET S0 // of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of LD M8002 　 / / the 　 of 　 of 　 of 　 of mobile process 　 of position condition S0 　 of 　 of 　 of 　 of 　 of 　 of 　 of STL SO 　 of 　 of 　 of

Choice alignment is suitable accuse instruction application 　 to pursue 10 it is a choice alignment is suitable dominate functional picture. This ordinal function graph has order of 3 branch flow, s20 is branch condition, according to different conditional X00, X10, X20 the choice carries out flow of among them a branch. Carry out flow of the first branch when X00 is ON, flow of the 2nd branch is carried out when X10 is ON, flow of the 3rd branch is carried out when X20 is ON. But 2 hold the post of in X00, X10, X20 or 3 cannot be ON at the same time. Graph 10 choices alignment is suitable accuse functional graph to pursue 11 it is this choice alignment is suitable dominate echelon picture. Drive is carried out to handle OUT Y00 to branch condition S20 first in echelon graph, the order that presses S21, S31, S41 again next undertakes transferring handling. And confluent condition is S50, confluent before the output processing of advanced travel Y22, Y32, Y42, part again next the S42 of the S32 of the S22 from the first branch, the 2nd branch, the 3rd branch is transferred to confluent condition S50. Graph 11 choices alignment arranges the statement that accuses correspondence of graph of echelon graph echelon to dictate the program is: SET S21 // of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of LD X00 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of processing of drive of OUT Y00 // of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of STL S20 　 transfers 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of condition of the first branch LD X10

Collateral alignment is suitable accuse instruction application to pursue 12 it is collateral alignment suitable dominate functional picture. Put through when X00 in the graph when, condition S20 is transferred at the same time, make S21, S31, S41 is ON at the same time. In S22, S32, S42 only 3 condition run an end entirely, and X02 puts through, ability makes S50 is ON, make at the same time restoration is S22, S32, S42 OFF. Graph 13 it is collateral alignment is arranged dominate echelon picture. Undertake to branch condition S20 drive is handled first in the graph, namely OUT Y00, undertake by branch order condition is transferred next. If branch condition S20 is ON, and X00 of collateral processing condition also is ON, criterion S21, S31, S41 at the same time movement, 3 branch begin campaign at the same time. Graph 12 collateral alignment are suitable accuse functional graph to pursue 13 collateral alignment are suitable accuse S50 of echelon graph 　 to be confluent condition, confluent before the condition drive processing before advanced travel is confluent, press branch order to undertake outputting handling to S21, S22, S31, S32, S41, S42 namely. 3 branch flow is carried out entirely after finishing, and X02 is ON, carry out from the move of S22, S32, S42 to S50, make S50 is ON. S22, S32, S42 at the same time restoration. The statement that this echelon pursues corresponding dictates the program is: 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of condition of collateral move of LD X00 // of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of OUT Y00 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of STL S20 　 / / 　 　 of 　 of 　 of 　 of 　 of 　 of 　 of 　 of move processing 　Information: Arrange Baconian attend a lecture note 　 is decision-making: Function of PLC of affirmatory FX2N series dictates 　 of form of operation instruction handbook plans: Design manual content and 　 of the measure that make carry out: Function of PLC of compose FX2N series dictates 　 of operation instruction handbook checks: Consult the data checks 　 to evaluate oneself: The group is evaluated CNC Milling