{"id":3434,"date":"2026-11-17T21:35:34","date_gmt":"2026-11-17T13:35:34","guid":{"rendered":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/17\/fbs-ins-en-007\/"},"modified":"2026-11-18T11:38:41","modified_gmt":"2026-11-18T03:38:41","slug":"fbs-ins-en-007","status":"publish","type":"post","link":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/17\/fbs-ins-en-007\/","title":{"rendered":"Chapter 7 Advanced Function Instructions"},"content":{"rendered":"<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\u25cf<\/td>\n<td>Flow Control Instructions I<\/td>\n<td>(FUN22) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-1<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Arithmetical Operation Instructions<\/td>\n<td>(FUN23\uff5e33) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-2 ~ 7-18<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Multiple Linear Conversion<\/td>\n<td>(FUN34) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 7-19 ~ 7-24<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Logical Operation Instructions<\/td>\n<td>(FUN35\uff5e36) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-25 ~ 7-26<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Comparison Instructions<\/td>\n<td>(FUN37) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 7-27<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Data Movement Instructions I<\/td>\n<td>(FUN40\uff5e50) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-28 ~ 7-38<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Shifting\uff0fRotating Instructions<\/td>\n<td>(FUN51\uff5e54) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-39 ~ 7-42<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Code Conversion Instructions<\/td>\n<td>(FUN55\uff5e64) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-43 ~ 7-59<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Flow Control Instructions II<\/td>\n<td>(FUN65\uff5e71) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-60 ~ 7-67<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>I\uff0fO Instructions I<\/td>\n<td>(FUN74\uff5e86) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-68 ~ 7-84<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Cumulative Timer Instructions<\/td>\n<td>(FUN87\uff5e89) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-85 ~ 7-86<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Watchdog Timer Instructions<\/td>\n<td>(FUN90\uff5e91) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-87 ~ 7-88<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>High Speed Counting\uff0fTiming<\/td>\n<td>(FUN92\uff5e93) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-89 ~ 7-90<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Report Printing Instructions<\/td>\n<td>(FUN94) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-91 ~ 7-92<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Slow Up\uff0fSlow Down Instructions<\/td>\n<td>(FUN95\uff5e98) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-93 ~ 7-98<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Table Instructions<\/td>\n<td>(FUN100\uff5e114) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7-99 ~ 7-117<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Matrix Instructions<\/td>\n<td>(FUN120\uff5e130) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 7-118 ~ 7-129<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>I\uff0fO Instructions II<\/td>\n<td>(FUN139) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-130 ~ 7-131<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>NC Positioning Instructions I<\/td>\n<td>(FUN140\uff5e143)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-132 ~ 7-135<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Enable\uff0fDisable Instructions<\/td>\n<td>(FUN145\uff5e146)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-136 ~ 7-137<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>NC Positioning Instructions II<\/td>\n<td>(FUN147\uff5e148)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-138 ~ 7-139<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Communication Instructions<\/td>\n<td>(FUN150\uff5e151)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-140 ~ 7-141<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Date Movement Instructions II<\/td>\n<td>(FUN160\uff5e162) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7-142 ~ 7-147<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>In Line Comparison Instructions<\/td>\n<td>(FUN170\uff5e175)\u2026\u2026&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-148 ~ 7-153<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Other Instructions<\/td>\n<td>(FUN190)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..7-154 ~ 7-155<\/td>\n<\/tr>\n<tr>\n<td>\u25cf<\/td>\n<td>Floating Point Instructions<\/td>\n<td>(FUN200\uff5e220) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; ..7-156 ~ 7-177<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p002-1.png\" alt=\"FUN22 P BREAK\" width=\"81\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BREAK FROM FOR AND NEXT LOOP<\/p>\n<h4>FUN22 P BREAK \uff08BREAK\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p002-2.png\" alt=\"\" width=\"655\" height=\"100\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control\u301dEN\u301e=1 or changes from 0\u21921\uff08 P instruction\uff09\uff0cit will terminate the FOR and NEXT program loop\u3002<\/p>\n<p>\u25cf The program within the FOR and NEXT loop will be executed N times (N is assigned by FOR instruction) successively\uff0cbut if it is necessary to terminate the execution loop less than N times\uff0cthe BREAK instruction is necessary to apply\u3002<\/p>\n<p>\u25cf The BREAK instruction must be located within the FOR and NEXT program loop\u3002<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p002-3.png\" alt=\"EN RST V 70 FOR D10 M200 17.CMP EN Sa : D100 a=b R0V a&gt;b Sb : a&lt;b M200 EN BREAK 15 (+1) V OVF EN 71 NEXT 08.MOV EN S : V D : D1000\" width=\"287\" height=\"334\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aThe loop count used to execute the FOR and NEXT program loop is assigned by register D10\uff1bthe program within the FOR and NEXT loop is designed to search the same data storing in D100 from the register table starting at R0\u3002If it finds\uff0cthe searching loop will be terminated and then it goes to execute the program after the NEXT instruction\uff1bIf it doesn&#8217;t find\uff0cthe searching loop will be executed N times (N is the content of D10) and then it goes to execute the program after the NEXT instruction\u3002<\/p>\n<p>M200 tells the status and D100 is the pointer of searching\u3002<\/p>\n<h4>FUN23 P DIV48 48-BIT DIVISION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p003-2.png\" alt=\"Sa\uff1aStarting register of dividend Sb\uff1aStarting register of divisor D : Starting register for storing the division result (quotient) Sa\uff0cSb\uff0ccan combine V, Z, P0~P9 for index addressing. Range HR OR SR ROR DR XR R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 rand R3839 R3967 R4167 R8071 D4095 P0~P9 Sa \u25cb \u25cb \u25cb \" width=\"623\" height=\"248\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control \u201cEN\u201d=1 or changes from 0\u21921 ( P instruction), will perform the 48 bits division operation. Dividend and divisor are each formed by three consecutive registers starting by Sa and Sb respectively. If the result is zero, \u2018D=0\u2019 output will be set to 1. If divisor is zero then the \u2018ERR\u2019 will be set to 1 and the resultant register will keep unchanged.<\/p>\n<p>\u25cf All operands involved in this function are all 48 bits, so Sa, Sb and D are all comprised by 3 consecutive registers.<\/p>\n<p>Example: 48-bit division<\/p>\n<p>In this example dividend formed by register R2, R1, R0 will be divided by divisor formed by register R5, R4, R3. The quotient will store in R8, R7, and R6.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p003-3.png\" alt=\"\" width=\"217\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p003-4.png\" alt=\"R2 R1 R0 Sa 2147483647 R5 R4 R3 \u00f7 Sb 1234567 R8 R7 R6 1739 Quotient\" width=\"460\" height=\"171\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p004-1.png\" alt=\"FUN 24 D P SUM\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SUM<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p004-2.png\" alt=\"FUN 24 D P SUM\" width=\"83\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(Summation of block data)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p004-3.png\" alt=\"S : Starting number of source register N : Number of registers to be summed (successive N data units starting from S) D : The register which stored the result (summation) S, N, D, can associate with V, Z, P0~P9 index register to serve the indirect addressing application. WX WY WM WS TMR CTR HR IR OR\" width=\"612\" height=\"248\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control \u201cEN\u201d=1 or changes from 0\u21921 ( P instruction), it puts the successive N units of 16bit or 32 bit ( D instruction) registers for addition calculation to get the summation, and stores the result into the register which is designated by D.<\/p>\n<p>\u25cf When the value of N is 0 or greater than 511, the operation will not be performed.<\/p>\n<p>\u25cf Communication port1~4 can be used to serve as a general purpose ASCII communication interface. If the data error detecting method is Checksum, this instruction can be used to generate the sum value for sending data or ot use this instruction to check if the received data is error or not.<\/p>\n<p>\u3008Example 1\u3009When M1 changes from OFF\u2192ON, following instruction will calculates the summation for 16-bit data.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p004-4.png\" alt=\"24P.SUM M1 \u25cf The left illustrates that 6 16-bit registers starting from R0 R0 EN S : is calculated for summation, and the result is stored into the R100 register. N : 6 R100 D : R0=0030H R1=0031H R2=0032H \u25cf R100=012FH R3=0033H R4=0034H R5=0035H \u3008Example 2\u3009When M1 is ON, it calculates the summation f\" width=\"618\" height=\"410\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p005-1.png\" alt=\"FUN 25 D P MEAN\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p005-2.png\" alt=\"FUN 25 D P MEAN\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>MEAN<\/p>\n<p>(Average of the block data)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p005-3.png\" alt=\"S : Source register number N : Number of registers to be averaged (N units of successive registers starting from S\uff09 D : Register number for storing result (mean value) The S, N, D may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0\" width=\"635\" height=\"254\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), add the N successive 16-bit or 32-bit ( D instruction) numerical values starting from S, and then divided by N. Store this mean value (rounding off numbers after the decimal point) in the register specified by D.<\/p>\n<p>\u25cf While the N value is derived from the content of the register, if the N value is not between 2 and 256, then the N range error &#8220;ERR&#8221; will be set to 1, and do not execute the operation.<\/p>\n<p>\u25cf At left, the example program gets the mean value of the<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p005-4.png\" alt=\"25P.MEAN X0 ERR S : R 0 EN N : 3 D : R 10\" width=\"198\" height=\"82\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>3 successive 16-bit registers starting from R0, and stores the results into the 16-bit register R10<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p005-5.png\" alt=\"R0 123 S R1 9 (N\uff1d3) R2 123\uff0b9\uff0b788 788 3 \u25cfX0\uff1d\u21b1 \uff1d306 \uff08Rouding off the remainder\uff09 R10 D 306\" width=\"502\" height=\"136\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-1.png\" alt=\"FUN 26 D P SQRT\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-2.png\" alt=\"FUN 26 D P SQRT\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SQUARE ROOT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-3.png\" alt=\"S : Source register to be taken square root D : Register for storing result (square root value) S, D may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z 16\/32-bit Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223\" width=\"627\" height=\"223\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), take the square root (rounding off numbers after the decimal point) of the data specified by the S field, and store the result into the register specified by D.<\/p>\n<p>\u25cf While the S value is derived from the content of the register, if the value is negative, then the S value error flag &#8220;ERR&#8221; will be set to 1, and do not execute the operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-4.png\" alt=\"26DP.SQRT X0 ERR S : EN 2147483647 R 0 D :\" width=\"211\" height=\"86\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left calculates the square root of the constant 2147483647, and stores the result in R0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-5.png\" alt=\"S K 2147483647\" width=\"267\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p006-6.png\" alt=\"D R1 R0 46340 R1 R0\" width=\"267\" height=\"44\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>2147483647 = 46340.95<\/p>\n<p>\u2191<\/p>\n<p>rounding off<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-1.png\" alt=\"FUN 27 D P NEG\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>NEGATION<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-2.png\" alt=\"FUN 27 D P NEG\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(Take the negative value)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-3.png\" alt=\"D : Register to be negated D may combine with V, Z, P0~P9 to serve indirect address application WY WM WS TMR CTR HR OR SR ROR DR XR Range WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 P0~P9 D \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb*\" width=\"612\" height=\"171\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), negate (ie. calculate 2&#8217;s complement) the value of the content of the register specified by D, and store it back in the original D register.<\/p>\n<p>\u25cf If the value of the content of D is negative, then the negation operation will make it positive.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-4.png\" alt=\"X0 27P NEG R 0 EN\" width=\"178\" height=\"47\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left negates the value of the R0 register, and stores it back to R0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-5.png\" alt=\"\u25cf3039H D R0 12345\" width=\"326\" height=\"27\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p007-6.png\" alt=\"\u25cfX0\uff1d\u21b1 \u25cfCFC7H \u221212345 D R0\" width=\"331\" height=\"59\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-1.png\" alt=\"FUN 28 D P ABS\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>ABSOLUTE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-2.png\" alt=\"FUN 28 D P ABS\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(Take the absolute value)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-3.png\" alt=\"D : Register to be taken absolute value D may combine with V, Z, P0~P9 to serve indirect address application WY WM WS TMR CTR HR OR SR ROR DR XR Range WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 P0~P9 rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 D \u25cb \u25cb \u25cb \" width=\"604\" height=\"181\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the absolute value of the content of the register specified by D, and write it back into the original D register.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-4.png\" alt=\"X0 28DP ABS R 0 EN\" width=\"175\" height=\"45\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left calculates the absolute value of the R0 register, and stores it back in R0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-5.png\" alt=\"\u25cfCFC7H \u221212345 D R1 R0\" width=\"312\" height=\"26\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p008-6.png\" alt=\"\u25cfX0\uff1d\u21b1 \u25cf3039H D R1 R0 12345\" width=\"307\" height=\"57\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-1.png\" alt=\"FUN 29 D P EXT\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-2.png\" alt=\"FUN 29 D P EXT\" width=\"81\" height=\"40\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SIGN EXTENSION<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-3.png\" alt=\"D : Register to be taken sign extension D may combine with V, Z, P0~P9 to serve indirect address application WY WM WS TMR CTR HR OR SR ROR DR XR Range WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 P0~P9 D \u25cb \u25cb \u25cb \" width=\"602\" height=\"169\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), this instruction will sign extent the 16 bit numerical value specified by D to 32-bit value and store it into the 32-bit register comprised by the two successive words, D + 1 and D. (Both values are the same, only it was originally formated as a 16 bit numerical value, and was then extended to be formated as a 32 bit numerical value.)<\/p>\n<p>\u25cf This instruction extent the numerical value of a 16-bit register into an equivalent numerical value in a 32-bit register (for example 33FFH converts to 000033FFH), Its main function is for numerical operations (+,-,*,\/,CMP&#8230;&#8230;) which can take the 16 bit or 32 bit numerical values as operand. Before operation all the operand should be adjusted to the same length for proper operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-4.png\" alt=\"X0 29P EN EXT R 0\" width=\"178\" height=\"47\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left takes a 16 bit numerical value R0, and extends it to an equivalent value in 32 bits, then stores it into a 32 bit register (DR0=R1R0) comprised R0 and R1<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-5.png\" alt=\"R1 B15 R0 B0 Ignore the value of R1 before \uff0d12345 D R1 R0 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 extension\" width=\"593\" height=\"57\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p009-6.png\" alt=\"B31 R1 B16 B15 R 0 B0 \uff0d12345 D R1 R0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 Fill B15 value into B31-B16,(if B15 is 0, then B31-B16 are all 0) Before extension\uff0816 bits\uff09 R0= CFC7H=\u221212345 The two numerical values are actually the same After extension\uff0832 bits\uff09R1R0=FFFFCFC7H=\u2212123\" width=\"593\" height=\"136\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN30 PID GENERAL PURPOSE PID OPERATION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p010-1.png\" alt=\"Range HR ROR DR K R0 R5000 D0 \u2223 \u2223 \u2223 Ope- R3839 R8071 D4095 rand Ts \u25cb \u25cb \u25cb 1\uff5e3000 SR \u25cb \u25cb* \u25cb OR \u25cb \u25cb* \u25cb PR \u25cb \u25cb* \u25cb WR \u25cb \u25cb* \u25cb\" width=\"301\" height=\"339\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Ts : PID Operation time interval<\/p>\n<p>SR : Starting register of process control parameter table comprised by 8 consecutive registers.<\/p>\n<p>OR : PID output register<\/p>\n<p>PR : Starting register of the process parameter table comprised by 7 consecutive registers.<\/p>\n<p>WR : Starting register of working variable for PID internal operation. It requires 7 registers and can\u2019t be re-used in other part of the ladder program.<\/p>\n<p>\u25cf PID function (FUN 30) according to the current value of process variable (PV) derived from the external analog signal and the Set Point (SP) of process performs the calculation, which base on the PID formula. The result of calculation is the control output for the controlled process, which can feed directly to the AO module or other output interface or leaved for further process. The usage of PID control for process if properly can achieve a fast and smooth result of PV tracking toward SP change or immune to the disturbance of process.<\/p>\n<p>\u25cf The PID formula in digital form:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p010-2.png\" alt=\"n [(D4005\/Pb)\u00d7En]+ \u2211 [(D4005\/Pb)\u00d7Ti\u00d7Ts\u00d7En] \u2212 [(D4005\/Pb)\u00d7Td\u00d7(PVn\u2212PVn-1)\/Ts] + Bias Mn = 0\" width=\"555\" height=\"45\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Mn : Control output at time \u201dn\u201d<\/p>\n<p>D4005 : The gain constant, the default is 1000, which can be set between 1~5000.<\/p>\n<p>Pb : Proportional band ( range : 2~5000, unit 0.1%. Kc (gain) =1000\/ Pb )<\/p>\n<p>Ti : Intergal time constant ( range : 0~9999 corresponds to 0.00~99.99 Repeats\/Minute )<\/p>\n<p>Td : Differential time constant ( range : 0~9999 corresponds to 0.00~99.99 Minutes )<\/p>\n<p>PVn : Process value at time \u201dn\u201d<\/p>\n<p>PV n-1 : Process value at time \u201dn\u201d<\/p>\n<p>:Error at time \u201dn\u201d =set value ( SP) \u2212 process value at time \u201dn\u201d (PVn)<\/p>\n<p>En<\/p>\n<p>Ts : Interval time of PID calculation ( range: 1~3000, unit : 0.01 S )<\/p>\n<p>Bias : Control output offset ( range: 0~16380 )<\/p>\n<h4>FUN31 P CRC16 CRC16 CALCULATION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p011-1.png\" alt=\"MD \uff1a0, Lower byte of registers to be calculated the CRC16 \uff1a1, Reserved S\uff1aStarting address of CRC16 calculation N\uff1aLength of CRC16 calculation (In Byte) D\uff1aThe destination register to store the calculation of HR ROR DR K CRC16, Range Register D stores the Upper Byte of CRC16 R0 R5000 D0 Ope- \u2223 \u2223 \u2223 Regi\" width=\"655\" height=\"262\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221;=1 or changes from 0\u21921\uff08P instruction, it will start the CRC16 calculation from the lower byte of S and by the length of N, the result of calculation will be stored into register D and D+1.<\/p>\n<p>\u25cf The output indication &#8220;D=0&#8221; will be ON if the value of calculation is 0.<\/p>\n<p>\u25cf It will not execute the calculation and the output indication &#8220;ERR&#8221; will be ON if the length is invalid.<\/p>\n<p>\u25cf When communicating with the intelligent peripheral in binary data format, the CRC16 error detection is used very often; the well known Modbus RTU communication protocol uses this method for error detection of message frame.<\/p>\n<p>\u25cf CRC16 is the check value of a Cyclical Redundancy Check calculation performed on the message contents.<\/p>\n<p>\u25cf Perform the CRC16 calculation on the received message data and error check value, the result of the calculation value must be 0, it means no error within this message frame.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p011-2.png\" alt=\"08P.MOV Description\uff1aWhen M0 changes from 0\u21921, it will execute the M0 S : D0 EN CRC16 calculation starting from lower byte of R0, the length is D : V assigned by D0, and then stores the CRC value into register 31P.CRC16 R0+V and R0+V+1. EN MD: 0 D=0 It is supposed D0=10, the registers R10 and R11 wil\" width=\"631\" height=\"155\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p011-3.png\" alt=\"S High Byte Low Byte R0 Don\u2019t care Byte-0 R1 Don\u2019t care Byte-1 R2 Don\u2019t care Byte-2 R3 Don\u2019t care Byte-3 R4 Don\u2019t care Byte-4 R5 Don\u2019t care Byte-5 R6 Don\u2019t care Byte-6 R7 Don\u2019t care Byte-7 R8 Don\u2019t care Byte-8 R9 Don\u2019t care Byte-9\" width=\"187\" height=\"208\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p011-4.png\" alt=\"D High Byte Low Byte R10 00 CRC-Hi R11 00 CRC-Lo\" width=\"194\" height=\"75\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN32<\/p>\n<p>CONVERTING THE RAW VALUE OF 4\uff5e20MA ANALOG INPUT<\/p>\n<h4>FUN32 ADCNV \uff08ADCNV\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p012-1.png\" alt=\"Pl\uff1a0, the polarity setting of analog input module is at unipolar position \uff1a1, the polarity setting of analog input module is at bipolar position S\uff1aStarting address of source registers N\uff1aQuantity of conversion (In Word) D\uff1aStarting address of destination registers S, N, D may associate with V\u3001Z\u3001P0~P9 \" width=\"655\" height=\"272\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When the analog input is one of 2\uff5e10mA\/ 4\uff5e20mA\/1\uff5e5V\/2\uff5e10V, the analog input module is the solution to get the value of this kind of signal, but the input span of the analog input module is 0\uff5e10mA\/0\uff5e5V (Setting at 5V\u3001Unipolar) or 0\uff5e20mA\/0\uff5e10V(Setting at 10V\u3001Unipolar), however there will exist the offset of the raw reading value; this instruction is applied to eliminate the offset and convert the raw reading value into the range of 0\uff5e4095(12-bit) or 0\uff5e16383(14-bit), it is more convenient for following operation.<\/p>\n<p>\u25cf When execution control &#8220;EN&#8221;=1, it will execute the conversion starting from S, length by N, and then store the results into the D registers.<\/p>\n<p>\u25cf When the input\u301dF\/T\u301e=0, it assigns the 12-bit analog input module; while\u301dF\/T\u301e=1, it assigns the 14-bit operation.<\/p>\n<p>\u25cf This instruction will not act if invalid length of N.<\/p>\n<p>\u25cf The reading value of the analog input must be in -2048~2047 or -8192~8191 format that the conversion will have the correct correspondence. Otherwise, if the reading value is in 0~4095 or 0~16383 format that the conversion will have the wrong correspondence.<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<p>FUN32<\/p>\n<p>CONVERTING THE RAW VALUE OF 4\uff5e20MA ANALOG INPUT<\/p>\n<h4>FUN32 ADCNV \uff08ADCNV\uff09<\/h4>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>Example\uff1a<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p013-1.png\" alt=\"32.ADCNV M0 0 EN P1 : S : R3840 M1 N : 6 F\/T R500 D :\" width=\"154\" height=\"79\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M0 is ON and M1 is OFF, it will perform 6 points of conversion starting from R3840, where the offset of 4\uff5e20mA raw reading value will be eliminated, and the corresponding value 0\uff5e4095 will be stored into R500\uff5eR505.<\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p013-2.png\" alt=\"R3840 \uff0d1229 R500 0 R3841 409 R501 2047 R3842 2047 \u25cf R503 R502 4095 R3843 \uff0d2048 0 R3844 \uff0d2048 R504 0 R3845 \uff0d2048 R505 0\" width=\"335\" height=\"116\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(4 mA)<\/p>\n<p>(12 mA)<\/p>\n<p>(20 mA)<\/p>\n<p>(0 mA)<\/p>\n<p>(0 mA)<\/p>\n<p>(0 mA)<\/p>\n<p>When M0 is ON and M1 is ON, it will perform 6 points of conversion starting from R3840, where the offset of 4~20mA raw reading value will be eliminated, and the corresponding value 0~16383 will be stored into R500~R505.<\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p013-3.png\" alt=\"R3840 \uff0d4916 R3841 1637 R3842 8191 \u25cf R3843 \uff0d8192 R3844 \uff0d8192 R3845 \uff0d8192\" width=\"175\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p013-4.png\" alt=\"R500 0 (4 mA) R501 8191 (12 mA) R502 16383 (20 mA) R503 0 (0 mA) R504 0 (0 mA) R505 0 (0 mA)\" width=\"196\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p014-1.png\" alt=\"FUN33 P LCNV\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Linear Conversion<\/p>\n<h4>FUN33 P LCNV \uff08LCNV\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p014-2.png\" alt=\"Ladder symbol Md\uff1aOperation mode\uff0c0\uff5e3 33P.LCNV S \uff1aStarting address of the source data Operation control EN Md : Ts\uff1aStarting address of the parameter table for conversion S : D \uff1aStarting address to store the result Ts : L \uff1aQuantity of conversion entry\uff0c1\uff5e64 D : L : HR IR ROR DR K Range Operand R0 R3840 \" width=\"607\" height=\"300\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When the analog input module being used for the analog measurement, the raw reading value of the analog input can be converted into the engineering range through this instruction for display or for proceeding control operation.<\/p>\n<p>\u25cf For process measurement calibration, making the linear conversion for the engineering process variable, which the measurement value from the PLC&#8217;s can be corrected by the value from the standard meter&#8217;s through this instruction.<\/p>\n<p>\u25cf When execution control &#8220;EN&#8221;=1or from 0\u21921( P instruction), this instruction will perform the linear conversion operation according to the mode selection, where S is the starting address of the source data, Ts is the starting address of the conversion parameter table, D is the starting address to store the converted result, and L is the quantity of conversion entry.<\/p>\n<p>\u25cf There are two expressions to meet the suitable application:<\/p>\n<p>Expression 1 : Two points calibration method<\/p>\n<p>Fill the conversion parameter table with the low value of measurement(VML), high value of measurement(VMH), and the corresponding low value of standard (VSL), high value of standard(VSH); the converted result(Dn) will be generated from the source data(Sn) through the formula shown below:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p014-3.png\" alt=\"\" width=\"305\" height=\"214\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>A = (VSL\uff0dVSH\uff0fVML\uff0dVMH)\u00d710000<\/p>\n<p>B = VSL\uff0d(VML\u00d7A\uff0f10000)<\/p>\n<p>Dn = (Sn\u00d7A\uff0f10000)\uff0bB<\/p>\n<p>\u2027The range of operands VSL,VSH,<\/p>\n<p>VML,VMH,Sn and Dn are between<\/p>\n<p>-32768 ~ 32767<\/p>\n<p>\u2027For analog input scaling, where<\/p>\n<p>VML=Minmum of analog input<\/p>\n<p>VMH=Maximum of analog input<\/p>\n<p>VSL=Minmum of engineering range<\/p>\n<p>VSH=Maximum of engineering range<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p015-1.png\" alt=\"FUN33 P Linear Conversion FUN33 P LCNV \uff08LCNV\uff09 LCNV\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Expression 2 : Multiplicator\uff0bOffset method<\/p>\n<p>Fill the conversion parameter table with the values of multiplier(A), divisor(B) and offset(C); The converted result(Dn) will be generated from the source data(Sn) through the formula shown below:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p015-2.png\" alt=\"A B\" width=\"306\" height=\"202\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Dn =[(Sn\u00d7A)\uff0fB]\uff0bC<\/p>\n<p>The range of each operand as below:<\/p>\n<p>A = 1 \uff5e 65535<\/p>\n<p>B = 1 \uff5e 65535<\/p>\n<p>C = -32768 \uff5e 32767<\/p>\n<p>Sn = 0 \uff5e 65535<\/p>\n<p>Dn = -32768 \uff5e 32767<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p015-3.png\" alt=\"Description of operation mode :\" width=\"201\" height=\"24\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>1. When Md = 0, the linear conversion works by expression 1, and all source data share the same parameters VML\u3001VMH\u3001VSL and VSH for conversion.<\/p>\n<p>2. When Md = 1, the linear conversion works by expression 1, and each source data has the independent corresponding parameters VML\u3001VMH\u3001VSL\u3001VSH for conversion; if there are N entries of source data, the conversion parameter table should have N groups of VML\u3001VMH\u3001VSL\u3001VSH for working, there are N\u00d74 registers in the conversion parameter table.<\/p>\n<p>3. When Md = 2, the linear conversion works by expression 2, and all source data share the same parameters A\u3001B and C for conversion.<\/p>\n<p>4. When Md = 3, the linear conversion works by expression 2, and each source data has the independent corresponding parameters A\u3001B\u3001C for conversion; if there are N entries of source data, the conversion parameter table should have N groups of A\u3001B\u3001C for working, there are N\u00d73 registers in the conversion parameter table.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p016-1.png\" alt=\"FUN33 P Linear Conversion FUN33 P LCNV \uff08LCNV\uff09 LCNV\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example program 1 : Mode 0 of linear conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p016-2.png\" alt=\"\" width=\"562\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description : When M0 = 1, it will perform the mode 0 operation of linear conversion, where R100 is the starting address of the source data, R1000 is the starting address of the table of the conversion parameters VML\u3001VMH\u3001VSL\u3001VSH, the quantity is 6, and R2000\uff5eR2005 will store the converted results.<\/p>\n<p>Ts<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p016-3.png\" alt=\"VML 282 R1000 VMH R1001 3530 R1002 260 VSL R1003 3650 VSH\" width=\"191\" height=\"94\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p016-4.png\" alt=\"R100 282 R2000 260 R101 3530 R2001 3650 R102 1906 \u25cf R2002 1955 R103 0 R2003 -34 R104 5000 R2004 5184 R105 -115 R2005 -154\" width=\"295\" height=\"127\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p017-1.png\" alt=\"FUN33 P Linear Conversion FUN33 P LCNV \uff08LCNV\uff09 LCNV\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example program 2 : Mode 1 of linear conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p017-2.png\" alt=\"\" width=\"562\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description : When M0 = 1, it will perform the mode 1 operation of linear conversion, where R100 is the starting address of the source data, R1000 is the starting address of the table of the conversion parameters VML\u3001VMH\u3001VSL\u3001VSH, the quantity is 3, and R2000\uff5eR2002 will store the converted results.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p017-3.png\" alt=\"Ts R1000 282 VML_0 R1001 3530 VMH_0 R1002 260 VSL_0 R1003 3650 VSH_0 R1004 -52 VML_1 R1005 1208 VMH_1 R1006 -38 VSL_1 R1007 1101 VSH_1 R1008 235 VML_2 4563 VMH_2 R1009 264 VSL_2 R1010 VSH_2 R1011 4588\" width=\"211\" height=\"281\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p017-4.png\" alt=\"R100 282 R2000 260 \u25cf R2001 1101 R101 1208 R102 2399 R2002 2426\" width=\"295\" height=\"67\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p018-1.png\" alt=\"FUN33 P Linear Conversion FUN33 P LCNV \uff08LCNV\uff09 LCNV\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example program 3 : Mode 2 of linear conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p018-2.png\" alt=\"\" width=\"562\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description : When M0 = 1, it will perform the mode 2 operation of linear conversion, where R100 is the starting address of the source data, R1000 is the starting address of the table of the conversion parameters A\u3001B\u3001C, the quantity is 6, and R2000\uff5eR2005 will store the converted results.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p018-3.png\" alt=\"Ts A R1000 985 R1001 1000 B R1002 20 C\" width=\"191\" height=\"91\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p018-4.png\" alt=\"R100 1000 R2000 1005 R101 2345 R2001 2330 R102 3560 \u25cf R2002 3527 R103 401 R2003 415 R104 568 R2004 579 R105 2680 R2005 2660\" width=\"295\" height=\"127\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p019-1.png\" alt=\"FUN33 P Linear Conversion FUN33 P LCNV \uff08LCNV\uff09 LCNV\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example program 4 : Mode 3 of linear conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p019-2.png\" alt=\"\" width=\"562\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description : When M0 = 1, it will perform the mode 3 operation of linear conversion, where R100 is the starting address of the source data, R1000 is the starting address of the table of the conversion parameters A\u3001B\u3001C, the quantity is 4, and R2000\uff5eR2003 will store the converted results.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p019-3.png\" alt=\"Ts R1000 5000 R1001 16380 R1002 0 R1003 10000 16383 R1004 0 R1005 2200 R1006 16380 R1007 -200 R1008 1600 R1009 16383 R1010 -100 R1011\" width=\"161\" height=\"282\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S D<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p019-4.png\" alt=\"R100 8192 R2000 2501 R101 16383 \u25cf R2001 10000 R102 8190 R2002 900 R103 0 R2003 -100\" width=\"300\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p020-1.png\" alt=\"FUN34 P MLC\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Multiple Linear Conversion<\/p>\n<h4>FUN34 P MLC (MLC)<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p020-2.png\" alt=\"34P. MLC Rs\uff1aStarting address of the source data Execution EN Rs : OVR Sl \uff1aQuantity of source data, 1~64 Control Sl : Tx \uff1aStarting address of X table Ty \uff1aStarting address of Y table Selection X\/Y Tx : Tl \uff1aQuantity of table, 2~255 Ty : D \uff1aStarting address to store the result Tl : D :\" width=\"563\" height=\"193\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p020-3.png\" alt=\"HR IR ROR DR K Range R0 R3840 R5000 D0 Operand \u2223 \u2223 \u2223 \u2223 R3839 R3903 R8071 D3999 Rs \u25cb \u25cb \u25cb \u25cb Sl \u25cb \u25cb \u25cb 1~64 Tx \u25cb \u25cb \u25cb Ty \u25cb \u25cb* \u25cb Tl \u25cb \u25cb \u25cb 2\uff5e255 D \u25cb \u25cb \u25cb\" width=\"206\" height=\"160\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When the analog input module being used for the analog measurement, the raw reading value of the analog input can be converted into the engineering range through this instruction for display or for proceeding control operation.<\/p>\n<p>\u25cf For process measurement calibration, making the linear conversion for the engineering process variable, which the measurement value from the PLC&#8217;s can be corrected by the value from the standard meter&#8217;s through this instruction.<\/p>\n<p>\u25cf When execution control &#8220;EN&#8221;=1or from 0\u21921( P instruction), this instruction will perform the multiple linear conversion operation according to the selection of X\/Y input; where Rs is the starting address of the source data, Sl is the quantity of source data for conversion, Tx is the starting address of X conversion parameter table, Ty is the starting address of Y conversion parameter table, Tl is the quantity of X\/Y table, D is the starting address to store the converted result.<\/p>\n<p>\u25cf When executing and selection X\/Y=0, it will compare the source data with the entities of Tx table to find the corresponding location in Tx table (The entities in Tx table must be in ascending sequence), and then calculate the linear conversion according to the located section of Tx and Ty table;<\/p>\n<p>When executing and selection X\/Y=1, it will compare the source data with the entities of Ty table to find the corresponding location in Ty table (The entities in Ty table can either be in ascending or descending sequence), and then calculate the linear conversion according to the located section of Ty and Tx table.<\/p>\n<p>\u25cf When the source data is out of all entities of table, OVR=1.<\/p>\n<p>\u25cf It wouldn\u2019t execute this instruction if illegal SI or Tl.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p021-1.png\" alt=\"FUN34 P Multiple Linear Conversion FUN34 P MLC (MLC) MLC Expression:\" width=\"655\" height=\"87\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\ufe52The entities of Tx conversion parameter table must be in ascending sequence to have correct linear conversion; the entities of Ty conversion parameter table can either be in ascending or descending sequence. When executing this instruction, it will search the located section by comparing entities of the table with source data, and then calculate the linear conversion according to the following expression:<\/p>\n<p>Vy = (Vx\uff0dTx_n) \u00d7 (Ty_n+1\uff0dTy_n\uff0fTx_n+1\uff0dTx_n) \uff0b Ty_n if X\/Y=0<\/p>\n<p>Vx = (Vy\uff0dTy_n) \u00d7 (Tx_n+1\uff0dTx_n\uff0fTy_n+1\uff0dTy_n) \uff0b Tx_n if X\/Y=1<\/p>\n<p>.Value of Vy\u3001Vx\u3001Tx_n\u3001Tx_n+1\u3001Ty_n\u3001Ty_n+1 must be -32768\uff5e32767<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p021-2.png\" alt=\"Figure of multiple linear conversion:\" width=\"228\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(Tx-n,Ty-n)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p021-3.png\" alt=\"(Tx-3,Ty-3) (Tx-2,Ty-2) (Tx-1,Ty-1) (Tx-0,Ty-0)\" width=\"522\" height=\"294\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p022-1.png\" alt=\"FUN34 P Multiple Linear Conversion FUN34 P MLC (MLC) MLC Example 1\uff1a\" width=\"655\" height=\"291\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M10=1\u3001M11=0, R0 is the starting address of source data\u3001R99 is the quantity of source data, R1000 is the starting address of Tx conversion parameter table, R2000 is the starting address of Ty conversion parameter table\u3001R199 is the quantity of table; the source data R0~R5 will be calculated the linear conversion according to Tx and Ty table between four sections, then store the results into D0\uff5eD5.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p022-2.png\" alt=\"Y 6000,760 970 760 2000,280 530 8000,970 280 4000,530 0,0 X 8000 6000 2000 4000\" width=\"609\" height=\"524\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p023-1.png\" alt=\"FUN34 P Multiple Linear Conversion FUN34 P MLC (MLC) MLC Example 2\uff1a\" width=\"655\" height=\"293\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M10=1\u3001M11=0, R0 is the starting address of source data\u3001R99 is the quantity of source data, R1000 is the starting address of Tx conversion parameter table, R2000 is the starting address of Ty conversion parameter table\u3001R199 is the quantity of table; the source data R0~R5 will be calculated the linear conversion according to Tx and Ty table between five sections, then store the results into D0\uff5eD5.The result value is 280 if source data \u2266<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p023-2.png\" alt=\"2000; the result value is 970 if source data \u2267 8000. Y 6000,760 970 760 2000,280 530 8000,970 280 4000,530 0,0 X 6000 8000 2000 4000\" width=\"623\" height=\"529\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p024-1.png\" alt=\"FUN34 P Multiple Linear Conversion FUN34 P MLC (MLC) MLC Example 3\uff1a\" width=\"655\" height=\"497\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M10=1\u3001M11=0, R0 is the starting address of source data\u3001R99 is the quantity of source data, R1000 is the starting address of Tx conversion parameter table, R2000 is the starting address of Ty conversion parameter table\u3001R199 is the quantity of table; the source data R0~R5 will be calculated the linear conversion according to Tx and Ty table between three sections, then store the results into D0\uff5eD5.The result value is -100 if source data \u2266<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p024-2.png\" alt=\"-8000; the result value is 2000 if source data \u2267 8000. Y 8000,2000 2000 0,950 -8000 8000 X -100 -8000,-100\" width=\"565\" height=\"320\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p025-1.png\" alt=\"FUN34 P Multiple Linear Conversion FUN34 P MLC (MLC) MLC Example 4\uff1a\" width=\"655\" height=\"487\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M10=1\u3001M11=0, R0 is the starting address of source data\u3001R99 is the quantity of source data, R1000 is the starting address of Tx conversion parameter table, R2000 is the starting address of Ty conversion parameter table\u3001R199 is the quantity of table; the source data R0~R5 will be calculated the linear conversion according to Tx and Ty table between three sections, then store the results into D0\uff5eD5.The result value is 0 if source data \u2266 3276; the result value is 5000 if source data \u2267 16000.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p025-2.png\" alt=\"Y 16000,5000 5000 0,0 16000 X 3276,0\" width=\"565\" height=\"277\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p026-1.png\" alt=\"FUN 35 D P XOR\" width=\"89\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p026-2.png\" alt=\"FUN 35 D P XOR\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>EXCLUSIVE OR<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p026-3.png\" alt=\"Sa : Source data a for exclusive or operation Sb : Source data b for exclusive or operation D : Register storing XOR results Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000\" width=\"622\" height=\"264\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), will perform the logical XOR (exclusive or) operation of data Sa and Sb. The operation of this function is to compare the corresponding bits of Sa and Sb (B0~B15 or B0~B31), and if bits at the same position have different status, then set the corresponding bit within D as 1, otherwise as 0.<\/p>\n<p>\u25cf After the operation, if all the bits in D are all 0, then set the 0 flag &#8220;D = 0&#8221; to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p026-4.png\" alt=\"35P.XOR X0 D=0 EN Sa : R 0 Sb : R 1 R 2 D :\" width=\"209\" height=\"86\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left makes a logical XOR operation using the R0 and R1 registers, and stores the result in R2.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p026-5.png\" alt=\"Sa R0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 Sb R1 1 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0\" width=\"341\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>D R2 0 1 0 1 0 1 0 1 1 1 0 0 1 0 1 1<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p027-1.png\" alt=\"FUN 36 D P XNR\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p027-2.png\" alt=\"FUN 36 D P XNR\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>EXCLUSIVE NOR<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p027-3.png\" alt=\"Sa : Data a for XNR operation Sb : Data b for XNR operation D : Register storing XNR results Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z 16\/32-bit Ope- \u2223 \u2223 \u2223 \u2223 \u2223\" width=\"627\" height=\"267\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), will perform the logical XNR (inclusive or) operation of data Sa and Sb. The operation of this function is to compare the corresponding bits of Sa and Sb (B0~B15 or B1~B31), and if the bit has the same value, then set the corresponding bit within D as 1. If not then set it to 0.<\/p>\n<p>\u25cf After the operation, if the bits in D are all 0, then set the 0 flag &#8220;D=0&#8221; to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p027-4.png\" alt=\"36P.XNR X0 D=0 Sa : R 0 EN Sb : R 1 R 2 D :\" width=\"209\" height=\"86\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left makes a logical XNR operation of the R0 and R1 registers, and the results are stored in the R2 register.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p027-5.png\" alt=\"Sa R0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 Sb R1 1 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0\" width=\"342\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>D R2 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 0<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-1.png\" alt=\"FUN 37 D P ZNCMP\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-2.png\" alt=\"FUN 37 D P ZNCMP\" width=\"83\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>ZONE COMPARE<\/p>\n<p>S : Register for zone comparison<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-3.png\" alt=\"\" width=\"367\" height=\"161\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SU : The upper limit value<\/p>\n<p>SL : The lower limit value<\/p>\n<p>S, SU, SL may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-4.png\" alt=\"WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range 16\/32-bit V\u3001Z WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 Ope- +\/- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0~P9 number S \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb SU \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb SL \" width=\"566\" height=\"123\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), compares S with upper limit SU and lower limit SL. If S is between the upper limit and the lower limit (SL\u2266S\u2266SU), then set the inside zone flag &#8220;INZ&#8221; to 1. If the value of S is greater than the upper limit SU, then set the higher than upper limit flag &#8220;S&gt;U&#8221; to 1. If the value of S is smaller then the lower limit SL, then set the lower than lower limit flag &#8220;S&lt;L&#8221; as 1.<\/p>\n<p>\u25cf The upper limit SU should be greater than the lower limit SL. If SU&lt;SL, then the limit value error flag &#8220;ERR&#8221; will set to 1, and this instruction will not carry out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-5.png\" alt=\"37P.ZNCMP Y0 X0 S : R 0 INZ EN SU : R 1 S&gt;U SL : R 2 S&lt;L ERR\" width=\"236\" height=\"137\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left compares the value of R0 with the upper and lower limit zones formed by R1 and R2. If the values of R0~R2 are as shown in the diagram at bottom left, then the result can then be obtained as at the right of this diagram.<\/p>\n<p>\u25cf If want to get the status of out side the zone, then OUT NOT Y0 may be used, or an OR operation between the two outputs S&gt;U and S&lt;L may be carried out, and move the result to Y0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p028-6.png\" alt=\"S R0 200 Y0 SU R1 300 \uff08Upper limit value\uff09 X0\uff1d\u21b1 1 SL R2 100 \uff08Lower limit value\uff09 \u25cf Results of execution Before-execution\" width=\"546\" height=\"116\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p029-1.png\" alt=\"FUN 40 D P BITRD\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p029-2.png\" alt=\"FUN 40 D P BITRD\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BIT READ<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p029-3.png\" alt=\"Ladder symbol S : Source data to be read 40DP.BITRD N : The bit number of the S data to be read out. S : Operation control EN OBT Output bit S, N may combine with V, Z, P0~P9 to serve N : indirect address application ERR N value error Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0\" width=\"620\" height=\"230\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When read control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), take the Nth bit of the S data out , and put it to the output bit &#8220;OTB&#8221;.<\/p>\n<p>\u25cf When read control &#8220;EN&#8221; = 0, the output \u201cOTB\u201d can be selected to keep at the last state ( if M1919=0 ) or set to zero ( if M1919=1 ).<\/p>\n<p>\u25cf When the operand is 16 bit, the effective range for N is 0~15. For 32 bit operand ( D instruction) it is 0~31.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p029-4.png\" alt=\"N beyond this range will set the N value error flag &quot;ERR&quot; to 1, and do not carry out this instruction. \u25cf The instruction at left reads the 7th bit (X7) status from 40P.BITRD X0 Y0 WX0 (X0~X15) and output to Y0. The results are as S : WX 0 OTB EN follows: N : 7 ERR X15 X7 X0 S WX0 1 1 0 0 1 1 1 0 1 0\" width=\"604\" height=\"459\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p030-1.png\" alt=\"FUN 41 D P BITWR\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p030-2.png\" alt=\"FUN 41 D P BITWR\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BIT WRITE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p030-3.png\" alt=\"D : Register for bit write N : The bit number of the D register to be written. D, N may combine with V, Z , P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 0 0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 or \u2223 ra\" width=\"594\" height=\"237\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When write control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), will write the write bit (INB) into the Nth bit of register D.<\/p>\n<p>\u25cf When the operand is 16 bit, the effective range of N is 0~15. For 32 bit ( D instruction) operand it is 0~31. N beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p030-4.png\" alt=\"41P.BITWR X0 \u25cf The instruction at left writes the status of the write bit EN D : R 0 ERR INB into B3 of R0. Assuming X1 N : 3 INB X1 = 1, the result will be as follows: X1 1 \u25cfX0\uff1d\u21b1 N\uff1d3\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 D R0 1 B15 B3 B0 Bits other than B3 remain unchanged\" width=\"606\" height=\"490\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p031-1.png\" alt=\"FUN 42 D P BITMV\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p031-2.png\" alt=\"FUN 42 D P BITMV\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BIT MOVE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p031-3.png\" alt=\"S : Source data to be moved Ns : Assign Ns bit within S as source bit D : Destination register to be moved Nd : Assign Nd bit within D as target bit S, Ns, D, Nd may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0\" width=\"604\" height=\"313\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), will move the bit status specified by Ns within S into the bit specified by Nd within D.<\/p>\n<p>\u25cf When the operand is 16 bit, the effective range of N is 0~15. For 32 bit ( D instruction) operand the effective range is 0~31. N beyond this range will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p031-4.png\" alt=\"42P.BITMV X0 \u25cf The instruction at left moves the status of B11 (X11) EN S : WX 0 ERR within S into the B7 position within D. Except bit B7, Ns : 11 other bits within D does not change. D : R 0 Nd : 7 X15 X11 X0 S WX0 1 Ns\uff1d11\u2500\u2500\u2500\u2500\u2500 \u25cfX0\uff1d\u21b1 Nd\uff1d7 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 D R0 1 B15 B7 B0\" width=\"616\" height=\"423\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p032-1.png\" alt=\"FUN 43 D P NBMV\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p032-2.png\" alt=\"FUN 43 D P NBMV\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>NIBBLE MOVE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p032-3.png\" alt=\"S : Source data to be moved Ns: Assign Ns nibble within S as source nibble D : Destination register to be moved Nd: Assign Nd nibble within D as target nibble S, Ns, D, Nd may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0\" width=\"602\" height=\"275\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will move the Ns\u2019th nibble from within S to the nibble specified by Nd within D. (A nibble is comprised by 4 bits. Starting from the lowest bit of the register, B0, each successive 4 bits form a nibble, so B0~B3 form nibble 0, B4~B7 form nibble 1, etc&#8230;)<\/p>\n<p>\u25cf When the operand is 16 bit, the effective range of Ns or Nd is 0~3. For 32 bit ( D instruction) operand the range is 0~7. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1 , and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p032-4.png\" alt=\"43P.NBMV X0 \u25cf The instruction at left moves the third nibble NB2 R 0 ERR EN S : (B8~B11) within S to the first nibble NB1 (B4~B7) within D. Other nibbles within D remain unchanged. Ns : 2 D : R 1 Nd : 1 B15 B0 S R0 1 1 0 1 NB3 NB2 NB1 NB0 Ns\uff1d2 \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u25cfX0\uff1d\u21b1 Nd\uff1d1 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 NB3 NB2 NB1 NB0 D R1 1 1 0 \" width=\"610\" height=\"458\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p033-1.png\" alt=\"FUN 44 D P BYMV\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p033-2.png\" alt=\"FUN 44 D P BYMV\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BYTE MOVE<\/p>\n<p>S : Source data to be moved<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p033-3.png\" alt=\"Ladder symbol 44DP.BYMV S : Move control EN ERR N value error Ns : D : Nd :\" width=\"304\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Ns : Assign Ns byte within S as source byte<\/p>\n<p>D : Destination register to be moved<\/p>\n<p>Nd : Assign Nd byte within D as target byte<\/p>\n<p>S, Ns, D, Nd may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p033-4.png\" alt=\"Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z 16\/32-bit Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0~P9 S \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Ns \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb 0\uff5e3 \u25cb\" width=\"580\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), move Nsth byte within S to Ndth byte position within D. (A byte is comprised of 8 bits. Starting from the lowest bit of the register, B0, each successive eight bits form a byte, so B0~B7 form byte 0, B8~B15 form byte 1, etc&#8230;)<\/p>\n<p>\u25cf When the operand is 16 bit, the effective range of Ns or Nd is 0~1. For 32 bit ( D instruction) operand, the range is 0~3. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p033-5.png\" alt=\"44DP.BYMV X0 \u25cf The instruction at left moves the third byte (B16~B23) S : R 0 ERR within S (32 bit register composed of R1R0), to the first EN byte within D (32 bit register composed of R3R2). Other Ns : 2 bytes within D remain unchanged. D : R 2 Nd : 1 B15 B0 S R1 R0 1 0 1 1 1 0 1 1 Byte3 Byte2 Byt\" width=\"601\" height=\"443\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-1.png\" alt=\"FUN 45 D P XCHG\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-2.png\" alt=\"FUN 45 D P XCHG\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>EXCHANGE<\/p>\n<p>Da : Register a to be exchanged<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-3.png\" alt=\"\" width=\"237\" height=\"129\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Db : Register b to be exchanged<\/p>\n<p>Da, Db may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-4.png\" alt=\"Range WY WM WS TMR CTR HR OR SR ROR DR XR WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 P0~P9 Da \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb* \u25cb \u25cb Db \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb* \u25cb \u25cb\" width=\"438\" height=\"100\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When exchange control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will exchanges the contents of register Da and register Db in 16 bits or 32 bits ( D instruction) format.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-5.png\" alt=\"45P.XCHG X0 EN Da : R 0 Db : R 1\" width=\"189\" height=\"73\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left exchanges the contents of the 16-bit R0 and R1 registers.<\/p>\n<p>B15<\/p>\n<p>B0<\/p>\n<p>Da R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<\/p>\n<p>Db R1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1<\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p034-6.png\" alt=\"B15 B0 Da R0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Db R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\" width=\"327\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN46 P SWAP BYTE SWAP<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p035-2.png\" alt=\"D : Register for byte data swap D may combine with V, Z, P0~P9 to serve indirect address application Range WY WM WS TMR CTR HR OR SR ROR DR XR WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 P0~P9 D \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \" width=\"588\" height=\"185\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When swap control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), swap the data of the low byte, Byte 0 (B0~B7), and the high byte, Byte 1 (B8~B15), in the 16 bit register specified by D.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p035-3.png\" alt=\"B15 B8 B7 B0 Byte 1\uff08high\uff09 Byte 0\uff08low\uff09\" width=\"205\" height=\"64\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p035-4.png\" alt=\"X0 46P EN SWAP R 0\" width=\"169\" height=\"45\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left swaps the data of the low byte (B0~B7) and the high byte (B8~B15) in R0. The results are as follows:<\/p>\n<p>Byte1<\/p>\n<p>Byte0<\/p>\n<p>D R0 0 0 1 1 0 0 1 1 1 1 1 1 0 0 0 0<\/p>\n<p>B15<\/p>\n<p>B8 B7<\/p>\n<p>B0<\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>B15<\/p>\n<p>B0<\/p>\n<p>D R0 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1<\/p>\n<h4>FUN47 P UNIT NIBBLE UNITE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p036-2.png\" alt=\"S : Starting source register to be united N : Number of nibbles to be united D : Registers storing united data S, N, D may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 V\u3001Z Ope- \u2223\" width=\"612\" height=\"255\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When unite control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), take out the lowest nibbles NB0, of N successive registers starting from S, and fill them into NB0, NB1, &#8230;..NBn-1 of D in ascending order. Nibbles not yet filled in D (when N is odd) are filled with 0. (A nibble is comprised by 4 bits. Starting from the lowest bit in the register, B0, each successive four bits form a nibble, so B0~B3 form nibble 0, B4~B7 form nibble 1, etc&#8230;).<\/p>\n<p>\u25cf This instruction only provides WORD (16 bit) operand. Because of this, there are usually only 4 nibbles can be involved. Therefore the effective range of N is 1~4. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p036-3.png\" alt=\"X0 47P.UNIT ERR EN S : R 0 N : 3 D : WY 0\" width=\"206\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left takes out NB0 from 3 registers, R0, R1 and R2, and fills them into NB0~NB2 within WY0 register.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p036-4.png\" alt=\"N\uff1d3 NB3 NB2 NB1 NB0 D W Y 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 Y15 Y0 Set the not united NB as 0 B15 B12 B11 B8 B7 B4 B3 B0 S R0 0001 N\uff1d3 S\uff0b1 R1 0010 S\uff0b2 R2 0100 \u25cf NB3 NB2 NB1 NB0 X0\uff1d\u21b1\" width=\"635\" height=\"200\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN48 P DIST NIBBLE DISTRIBUTE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p037-2.png\" alt=\"S : Source data to be distributed N : Number of nibbles to be distributed D : Starting register storing distribution data S, N, D may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range 16-bit V\u3001Z WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968\" width=\"626\" height=\"256\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When distribution control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), will take N successive nibbles starting from the lowest nibble NB0 within S, and distribute them in ascending order into the 0 nibbles of N registers starting from D. The nibbles other than NB0 in each of the registers within D are all set to zero. (A nibble is comprised by 4 bits. Starting from the lowest bit in a register, B0, each successive 4 bits form a nibble, so B0~B3 form nibble 0, B4~B7 form nibble 1, etc&#8230;)<\/p>\n<p>\u25cf This instruction only provides WORD (16 bit) operand. Therefore there are usually only 4 nibbles can be involved, so the effective value of N is 1~4. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p037-3.png\" alt=\"X0 48P.DIST ERR EN S : WY 0 N : 3 D : R 0\" width=\"206\" height=\"87\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left writes NB0~NB2 from the WX0 register into the NB0 of the 3 consecutive registers R0~R2.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p037-4.png\" alt=\"N=3 NB3 NB2 NB1 NB0 X15 X11 X0 B15 B0 S WX0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 D R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 NB3 NB2 NB1 NB0 D+1 R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 D+2 R2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 \u25cf NB1\uff5eNB3 are all set a &quot;0 &quot; X0\uff1d\u21b1\" width=\"564\" height=\"136\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN49 P BUNIT BYTE UNITE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p038-2.png\" alt=\"S \uff1aStarting address of source register to be united N \uff1aNumber of bytes to be united D \uff1aRegisters to store the united data S, N, D may associate with V\u3001Z\u3001P0~P9 index register to serve the indirect addressing application HR ROR DR K Range R0 R5000 D0 Ope- \u2223 \u2223 \u2223 rand R3839 R8071 D4095 S \u25cb \u25cb \u25cb N \u25cb \u25cb \u25cb 1\" width=\"623\" height=\"255\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221;=1 or changes from 0\u21921 P instruction, it will perform the byte combination starting from S, length by N, and then store the results into D registers.<\/p>\n<p>\u25cf This instruction will not act if invalid range of length.<\/p>\n<p>\u25cf When communicating with intelligent peripheral in binary data format, this instruction may be applied to do byte combination for following word data processing.<\/p>\n<p>Example\uff1a<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p038-3.png\" alt=\"M2 49P.BUNIT S : R 1500 EN N : R 999 D : R 2500\" width=\"183\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M2 changes from 0\u21921, it will perform the byte combination starting from R1500, the length is assigned by R999, and then store the results into registers starting from R2500.<\/p>\n<p>It is supposed R999=10, the results of combination will store into R2500\uff5eR2504.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td><\/td>\n<td><\/td>\n<td colspan=\"2\">S<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td colspan=\"2\">D<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>High Byte<\/td>\n<td><\/td>\n<td><\/td>\n<td>Low Byte<\/td>\n<td><\/td>\n<td>High Byte<\/td>\n<td><\/td>\n<td>Low Byte<\/td>\n<\/tr>\n<tr>\n<td>R1500<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-0<\/td>\n<td>R2500<\/td>\n<td>Byte-0<\/td>\n<td><\/td>\n<td>Byte-1<\/td>\n<\/tr>\n<tr>\n<td>R1501<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-1<\/td>\n<td>R2501<\/td>\n<td>Byte-2<\/td>\n<td><\/td>\n<td>Byte-3<\/td>\n<\/tr>\n<tr>\n<td>R1502<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-2<\/td>\n<td>R2502<\/td>\n<td>Byte-4<\/td>\n<td><\/td>\n<td>Byte-5<\/td>\n<\/tr>\n<tr>\n<td>R1503<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-3<\/td>\n<td>R2503<\/td>\n<td>Byte-6<\/td>\n<td><\/td>\n<td>Byte-7<\/td>\n<\/tr>\n<tr>\n<td>R1504<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-4<\/td>\n<td>R2504<\/td>\n<td>Byte-8<\/td>\n<td><\/td>\n<td>Byte-9<\/td>\n<\/tr>\n<tr>\n<td>R1505<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-5<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>R1506<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-6<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>R1507<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-7<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>R1508<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-8<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>R1509<\/td>\n<td>Don\u2019t care<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-9<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p038-4.png\" alt=\"R2500 Byte-0 Byte-1 R2501 Byte-2 Byte-3 R2502 Byte-4 Byte-5 R2503 Byte-6 Byte-7 R2504 Byte-8 Byte-9\" width=\"168\" height=\"96\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN50 P BDIST BYTE DISTRIBUTE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p039-1.png\" alt=\"S \uff1aStarting address of source register to be distributed N \uff1aNumber of bytes to be distributed D \uff1aRegisters to store the distributed data S, N, D may associate with V\u3001Z\u3001P0~P9 index register to serve the indirect addressing application. HR ROR DR K Range R0 R5000 D0 Ope- \u2223 \u2223 \u2223 rand R3839 R8071 D4095 S\" width=\"630\" height=\"249\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; =1 or changes from 0\u21921\uff08 P instruction\uff09, it will perform the byte distribution starting from S, length by N, and then store the results into D registers.<\/p>\n<p>\u25cf This instruction will not act if invalid range of length.<\/p>\n<p>\u25cf When communicating with intelligent peripheral in binary data format, this instruction may be applied to do byte distribution for data transmission\u3002<\/p>\n<p>Example\uff1a<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p039-2.png\" alt=\"M2 50P.BDIST EN S : R 1000 N : R 999 D : R 1500\" width=\"183\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description\uff1aWhen M2 changes from 0\u21921, it will perform the byte distribution starting from R1000, the length is assigned by R999, and then store the results into registers starting from R1500.<\/p>\n<p>It is supposed R999=9, the results of distribution will store into R1500\uff5eR1508.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td><\/td>\n<td>High Byte<\/td>\n<td colspan=\"2\">S<\/td>\n<td>Low Byte<\/td>\n<td><\/td>\n<td>High Byte<\/td>\n<td colspan=\"2\">D<\/td>\n<td>Low Byte<\/td>\n<\/tr>\n<tr>\n<td>R1000<\/td>\n<td>Byte-0<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-1<\/td>\n<td>R1500<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-0<\/td>\n<\/tr>\n<tr>\n<td>R1001<\/td>\n<td>Byte-2<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-3<\/td>\n<td>R1501<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-1<\/td>\n<\/tr>\n<tr>\n<td>R1002<\/td>\n<td>Byte-4<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-5<\/td>\n<td>R1502<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-2<\/td>\n<\/tr>\n<tr>\n<td>R1003<\/td>\n<td>Byte-6<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-7<\/td>\n<td>R1503<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-3<\/td>\n<\/tr>\n<tr>\n<td>R1004<\/td>\n<td>Byte-8<\/td>\n<td><\/td>\n<td><\/td>\n<td>Don\u2019t care<\/td>\n<td>R1504<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-4<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>R1505<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-5<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>R1506<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-6<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>R1507<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-7<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>R1508<\/td>\n<td>00<\/td>\n<td><\/td>\n<td><\/td>\n<td>Byte-8<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p039-3.png\" alt=\"R1500 00 Byte-0 R1501 00 Byte-1 R1502 00 Byte-2 R1503 00 Byte-3 R1504 00 Byte-4 R1505 00 Byte-5 R1506 00 Byte-6 R1507 00 Byte-7 R1508 00 Byte-8\" width=\"164\" height=\"165\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p040-1.png\" alt=\"FUN 51 D P SHFL\" width=\"94\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p040-2.png\" alt=\"FUN 51 D P SHFL\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SHIFT LEFT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p040-3.png\" alt=\"D : Register to be shifted N : Number of bits to be shifted N, D may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 1 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 or \u2223 rand WX240 WY240 WM189\" width=\"595\" height=\"246\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When shift control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), will shift the data of the D register towards the left by N successive bits (in ascending order). After the lowest bit B0 has been shifted left, its position will be replaced by shift-in bit INB, while the status of shift-out bits B15 or B31 ( D instruction) will appear at shift-out bit &#8220;OTB&#8221;.<\/p>\n<p>\u25cf If the operand is 16 bit, the effective range of N is 1~16. For 32 bits ( D instruction) operand, it is 1~32. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p040-4.png\" alt=\"51P.SHFL \u25cf The instruction at left shifts the data in register R0 Y0 X0 towards the left by 4 successive bits. The results are EN D : R 0 OTB shown below. N : 4 ERR INB\" width=\"589\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Y0 B15<\/p>\n<p>R0<\/p>\n<p>B0 INB<\/p>\n<p>\u2190 0 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 1<\/p>\n<p>\u2190<\/p>\n<p>*<\/p>\n<p>\u25b3<\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>Y0 B15<\/p>\n<p>R0<\/p>\n<p>B0 INB<\/p>\n<p>1 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 1<\/p>\n<p>*<\/p>\n<p>\u25b3<\/p>\n<p>\u25b3\u25b3\u25b3\u25b3<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p041-1.png\" alt=\"FUN 52 D P SHFR\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p041-2.png\" alt=\"FUN 52 D P SHFR\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SHIFT RIGHT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p041-3.png\" alt=\"D : Register to be shifted N : Number of bits to be shifted D, N may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 1 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 or \u2223 rand WX240 WY240 WM189\" width=\"598\" height=\"243\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When shift control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will shift the data of D register towards the right by N successive bits (in descending order). After the highest bits, B15 or B31 ( D instruction) have been shifted right, their positions will be replaced by the shift-in bit INB, while shift-out bit B0 will appear at shift-out bit &#8220;OTB&#8221;.<\/p>\n<p>\u25cf If the operand is 16 bit, the effective range of N is 1~16. For 32 bits ( D instruction) operand, it is 1~32. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p041-4.png\" alt=\"52P.SHFR Y0 X0 OTB EN D : R 0 N : 15 INB ERR\" width=\"258\" height=\"128\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left shifts the data in R0 register towards the right by 15 successive bits. The results are shown below.<\/p>\n<p>INB B15<\/p>\n<p>R0<\/p>\n<p>B0 Y0<\/p>\n<p>0 \u2192 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \u2192<\/p>\n<p>\u25b3<\/p>\n<p>*<\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>INB B15<\/p>\n<p>R0<\/p>\n<p>B0 Y0<\/p>\n<p>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1<\/p>\n<p>0<\/p>\n<p>\u25b3 \u25b3 \u25b3 \u25b3 \u25b3 \u25b3\u25b3\u25b3\u25b3\u25b3\u25b3\u25b3\u25b3\u25b3\u25b3\u25b3<\/p>\n<p>*<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p042-1.png\" alt=\"FUN 53 D P ROTL\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p042-2.png\" alt=\"FUN 53 D P ROTL\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>ROTATE LEFT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p042-3.png\" alt=\"D : Register to be rotated N : Number of bits to be rotated D, N may combine with V, Z , P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 1 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 or \u2223 rand WX240 WY240 WM18\" width=\"611\" height=\"243\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When rotate control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will rotate the data of D register towards the left by N successive bits (in ascending order, ie. in a 16-bit instruction, B0\u2192B1, B1\u2192B2, &#8230;. , B14\u2192B15, B15\u2192B0. In a 32-bit instruction, B0\u2192B1, B1\u2192B2, &#8230;. , B30\u2192B31, B31\u2192B0). At the same time, the status of the rotated out bits B15 or B31 ( D instruction) will appear at rotate-out bit &#8220;OTB&#8221;.<\/p>\n<p>\u25cf If the operand is 16 bit, the effective range of N is 1~16. For 32 bits ( D instruction) operand, it is 1~32. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p042-4.png\" alt=\"\u25cf The instruction at left rotates data from the R0 register towards the left 9 successive bits. The 53P.ROTL Y0 X0 results are shown below. EN D : R 0 OTB N : 9 ERR R0 B0 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 * Y0 \u25cfX0\uff1d\u21b1\" width=\"594\" height=\"237\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p042-5.png\" alt=\"B15 R0 B0 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 1 * 1 Y0 *\" width=\"281\" height=\"91\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p043-1.png\" alt=\"FUN 54 D P ROTR\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p043-2.png\" alt=\"FUN 54 D P ROTR\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>ROTATE RIGHT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p043-3.png\" alt=\"D : Register to be rotated N : Number of bits to be rotated D, N may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 1 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 or \u2223 rand WX240 WY240 WM189\" width=\"599\" height=\"239\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When rotate control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), will rotate the bit data of D register towards the right by N successive bits (in descending order, ie. in a 16-bit instruction, B15\u2192B14, B14\u2192B13, &#8230;. , B1\u2192B0, B0\u2192B15. In a 32-bit instruction, B31\u2192B30, B30\u2192B29, &#8230;. , B1\u2192B0, B0\u2192B31). At the same time, the status of the rotated out B0 bits will appear at the rotate-out bit &#8220;OTB&#8221;.<\/p>\n<p>\u25cf If the operand is 16 bit, the effective range of N is 1~16. For 32 bits ( D instruction) operand, it is 1~32. Beyond this range, will set the N value error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p043-4.png\" alt=\"\u25cf The instruction at left rotates data from R0 register 54P.ROTR Y0 towards the right 8 successive bits. The results are X0 D : R 0 OTB EN shown below. N : 8 ERR B15 R0 B0 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 * Y0 \u25cfX0\uff1d\u21b1\" width=\"571\" height=\"224\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p043-5.png\" alt=\"B15 R0 B0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 * Y0 1 *\" width=\"281\" height=\"83\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-1.png\" alt=\"FUN55 D P B\u2192G\" width=\"93\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-2.png\" alt=\"FUN55 D P B\u2192G\" width=\"81\" height=\"40\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BINARY-CODE TO GRAY-CODE CONVERSION<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-3.png\" alt=\"\" width=\"240\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S \uff1aStarting of source<\/p>\n<p>D \uff1aStarting address of destination<\/p>\n<p>S\uff0cD operand can combine V\u3001Z\u3001P0~P9 for index addressing<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-4.png\" alt=\"Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z 16\/32-bit Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0~P9 S \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb* \u25cb \u25cb \u25cb\" width=\"596\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221;=1 or changes from 0\u21921( P instruction), it will perform the code conversion; where S is the source (Binary code), and D is the destination (Gray code) for storing the result.<\/p>\n<p>\u25cf The conversion method shown as below<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-5.png\" alt=\"\" width=\"563\" height=\"116\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example 1: When M0 changes from 0\u21921, it will perform the 16-bit code conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p044-6.png\" alt=\"55P.B G M0 EN S : R0 D : R100\" width=\"177\" height=\"74\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Converting the 16-bit Binary-code in R0 into Gray-code, and then storing the result into R100.<\/p>\n<p>R0\uff1d1001010101010011B \u25cf R100\uff1d1101111111111010B<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p045-1.png\" alt=\"FUN55 D P FUN55 D P BINARY-CODE TO GRAY-CODE CONVERSION B\u2192G B\u2192G\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example 2: When M0 =1, it will perform the 32-bit code conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p045-2.png\" alt=\"55DP.B G M0 S : R0 EN D : R100\" width=\"178\" height=\"74\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Converting the 32-bit Binary-code in DR0 into Gray-code, and then storing the result into DR100.<\/p>\n<p>DR0\uff1d00110111001001000010111100010100B \u25cf DR100\uff1d00101100101101100011100010011110B<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-1.png\" alt=\"FUN56 D P G\u2192B\" width=\"89\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-2.png\" alt=\"FUN56 D P G\u2192B\" width=\"81\" height=\"40\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>GRAY-CODE TO BINARY-CODE CONVERSION<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-3.png\" alt=\"Ladder symbol 56DP.G B S : Operation control EN D :\" width=\"238\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S \uff1aStarting of source<\/p>\n<p>D \uff1aStarting address of destination<\/p>\n<p>S \uff0cD operand can combine V \u3001Z \u3001P0~P9 for index addressing<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-4.png\" alt=\"Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z 16\/32-bit Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0~P9 S \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb* \u25cb \u25cb \u25cb\" width=\"596\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221;=1 or changes from 0\u21921 ( P instruction), it will perform the code conversion; where S is the source (Gray code), and D is the destination (Binary code) for storing the result.<\/p>\n<p>\u25cf The conversion method shown as below :<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-5.png\" alt=\"1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 1 XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR XOR 1 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1\" width=\"566\" height=\"94\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example 1: When M0 changes from 0\u21921, it will perform the 16-bit code conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p046-6.png\" alt=\"56P.G B M0 EN S : D0 D : D100\" width=\"186\" height=\"94\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u02d9Converting the 16-bit Gray-code in D0 into Binary-code, and then storing the result into D100.<\/p>\n<p>D0\uff1d1001010101010011B \u25cf D100\uff1d1110011001100010B<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p047-1.png\" alt=\"FUN56 D P FUN56 D P GRAY-CODE TO BINARY-CODE CONVERSION G\u2192B G\u2192B\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Example 2: When M0 =1, it will perform the 32-bit code conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p047-2.png\" alt=\"56DP.G B M0 EN S : D0 D : D100\" width=\"180\" height=\"75\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u02d9Converting the 32-bit Gray-code in DD0 into Binary-code, and then storing the result into DD100.<\/p>\n<p>DD0\uff1d00110111001001000010111100010100B \u25cf DD100\uff1d00100101110001111100101000011000B<\/p>\n<h4>FUN57 P DECOD DECODE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p048-2.png\" alt=\"S : Source data register to be decoded (16 bits) NS : Starting bits to be decoded within S NL : Length of decoded value (1~8 bits) D : Starting register storing decoded results (2~256 points = 1~16 words) S, NS, NL, D may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM \" width=\"603\" height=\"280\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction, will set a single bit among the total of 2NL discrete points (D) to 1 and the others bit are set to<\/p>\n<p>0. The bit number to be set to 1 is specified by the value comprised by BNS\uff5eBNS+NL\u22121 of S\uff08which is called the decode value, BNS is the starting bit of the decode value, and BNS+NL\u22121 is the end value\uff09.<\/p>\n<p>\u25cf When decode control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will take out the value BNS\uff5eBNS+NL\u22121 from S. And with this value to locate the bit position and set D accordingly, and set all the other bit to zero<\/p>\n<p>\u25cf This instruction only provides 16 bit operand, which means S only has B0~B15. Therefore the effective range of Ns is 0~15, and the NL length of the decode value is limited to 1~8 bits. Therefore the width of the decoded result D is 21\uff5e8 points = 2~256 points = 1~16 words (if 16 points are not sufficient, 1 word is still occupied). If the value of NS or NL is beyond the above range, will set the range-error flag &#8220;ERR&#8221; to 1, and do not carry out this instruction.<\/p>\n<p>\u25cf If the end bit value exceeds the B15 of S, then will extend toward B0 of S + 1. However if this occurs then S+1 can\u2019t exceed the range of specific type of operand (ie. If S is of D type register then S+1 can\u2019t be D3072). If violate this, then this instruction only takes out the bits from starting bit BNs to its highest limit as the decode<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p048-3.png\" alt=\"value. X0 57P.DECOD S : WX 0 ERR EN Ns : 3 NL : 5 D : R 2\" width=\"217\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left takes out the data of five successive bits from X3 to X7 within the WX0 register and decodes it. The results are then stored in the 32-bit register starting at R2.<\/p>\n<p>X15<\/p>\n<p>X7<\/p>\n<p>X3 X0<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<p>S 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 0<\/p>\n<p>Length of decode value NL=5,so bit value is formed by X7~X3 (equal 9)<\/p>\n<p>\u25cfX0\uff1d\u21b1<\/p>\n<p>R3<\/p>\n<p>R2<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>D 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0<\/p>\n<p>B31<\/p>\n<p>B9<\/p>\n<p>B0<\/p>\n<p>Because NL=5,the width of D is 25= 32 point = 2 word. That is, D is formed by R3R2, and the decoded value is 01001=9, therefore B9 (the 10th point) within D is set to 1, and all other points are 0.<\/p>\n<h4>FUN58 P ENCOD ENCODE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p049-2.png\" alt=\"S : Starting register to be encoded NS : Bit position within S as the encoding start point NL : Number of encoding discrete points (2~256) D : Number of register storing encoding results (1 word) S, NS, NL, D may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CT\" width=\"613\" height=\"276\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When encode control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will starting from the points specified by Ns within S, take out towards the left (high position direction) NL number of successive bits BNS\uff5eBNS+NL\u22121 (BNS is called the encoding start point, and its relative bit number is b0;BNS+NL\u22121 is called the encoding end point, and its relative bit number is BNL-1). From left to right do higher priority (when H\/L=1) encoding or from right to left do lower priority (when H\/L=0) encoding (i.e. seek the first bit with the value of 1, and the relative bit number of this point will be stored into the low byte (B0~B7) of encoded resultant register D, and the high byte of D will be filled with 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p049-3.png\" alt=\"\uff08bNL\u22121\uff09 \uff08bH\uff09 \uff08bL\uff09 \uff08b0\uff09\u2190 Relative bit number BNS\uff0bNL\u22121 BNS \u2193 B15 \u2193 B1 B0 \u2190 \u2026Direction of extension\u2026 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 S High Total NL discrete points Low \u25cf High priority search direction Low priority search direction D 0 0 0 0 0 0 0 0 H or L\" width=\"557\" height=\"161\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf As shown in the diagram above, for high priority encoding, the bit first to find is bH (with a value of 12), and for low priority encoding, the bit first to find bL (with a value of 4). Among the NL discrete points there must be at least one bit with value of 1. If all bits are 0, will not to carry out this instruction, and the all zero flag &#8220;D=0&#8221; will set to 1.<\/p>\n<p>\u25cf Because S is a 16-bit register, Ns can be 0~15, and is used to assign a point of B0~B15 within S as the encoding start point (b0). The value of NL can be 2~256, and it is used to identify the encoding end point, i.e. it assigns NL successive single points starting from the start point (b0) towards the left (high position direction) as the encoding zone (i.e. b0\uff5ebNL\u22121). If the value of Ns or NL exceeds the above value, then do not carry out this instruction, and set the range-error flag &#8220;ERR&#8221; as 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p050-1.png\" alt=\"FUN 58 P FUN 58 P ENCODE ENCOD ENCOD\" width=\"654\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf If the encoding end point (bNL\u22121) beyond the B15 of S, then continue extending towards S+1, S+2, but it must not exceed the range of specific type of operand. If it goes beyond this, then this instruction can only take the discrete points between b0 and the highest limit into account for encoding.<\/p>\n<p>\u25cf The instruction at left is a high priority encode example.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p050-2.png\" alt=\"X0 58P.ENCOD D=0 S : R 0 EN 9 Ns : H\/L NL : 36 ERR D : WY 0\" width=\"204\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>When X0 goes from 0 to 1, will take out toward left 36 successive bits starting from B9 (b0) specified by Ns within S, and perform high priority encoding (because H\/L = 1). That is, starting from b35 (encoding end point), move right to find the first bit with the value of 1. The resultant value of this example is b26, so the value of D is 001AH=26, as shown in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p050-3.png\" alt=\"S D (b0) B15 B9 B0 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Y15 Y0 X0\uff1d\u21b1 R1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \u25cf WY0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 R2 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 B47 B44 \u2191 B32 High byte always \uff1d26 \uff08b35\uff09 \uff08b26\uff09 \uff08encode value\uff09 fill with &quot;0&quot; The first bit with the value of 1 for high priorit\" width=\"615\" height=\"187\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN59 P 7-SEGMENT CONVERSION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p051-2.png\" alt=\"\" width=\"332\" height=\"149\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S : Source data to be converted<\/p>\n<p>N : The nibble number within S for conversion<\/p>\n<p>D : Register storing 7-segment result<\/p>\n<p>S, N, D may combine with V, Z,P0~P9 to serve indirect address application<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td rowspan=\"2\">Range<\/td>\n<td>WX<\/td>\n<td>WY<\/td>\n<td>WM<\/td>\n<td>WS<\/td>\n<td>TMR<\/td>\n<td>CTR<\/td>\n<td>HR<\/td>\n<td>IR<\/td>\n<td>OR<\/td>\n<td>SR<\/td>\n<td>ROR<\/td>\n<td>DR<\/td>\n<td>K<\/td>\n<td>XR<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">WX0<br \/>\u2223<br \/>WX240<\/td>\n<td rowspan=\"3\">WY0<br \/>\u2223<br \/>WY240<\/td>\n<td rowspan=\"3\">WM0<br \/>\u2223<br \/>WM1896<\/td>\n<td rowspan=\"3\">WS0<br \/>\u2223<br \/>WS984<\/td>\n<td rowspan=\"3\">T0<br \/>\u2223<br \/>T255<\/td>\n<td rowspan=\"3\">C0<br \/>\u2223<br \/>C255<\/td>\n<td rowspan=\"3\">R0<br \/>\u2223<br \/>R3839<\/td>\n<td rowspan=\"3\">R3840<br \/>\u2223<br \/>R3903<\/td>\n<td rowspan=\"3\">R3904<br \/>\u2223<br \/>R3967<\/td>\n<td rowspan=\"3\">R3968<br \/>\u2223<br \/>R4167<\/td>\n<td rowspan=\"3\">R5000<br \/>\u2223<br \/>R8071<\/td>\n<td rowspan=\"3\">D0<br \/>\u2223<br \/>D4095<\/td>\n<td rowspan=\"3\">16-bit<br \/>+\/-<br \/>number<\/td>\n<td rowspan=\"3\">V\u3001Z<br \/>P0~P9<\/td>\n<\/tr>\n<tr>\n<td>Ope-<\/td>\n<\/tr>\n<tr>\n<td>rand<\/td>\n<\/tr>\n<tr>\n<td>S<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>N<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>0\uff5e3<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb*<\/td>\n<td>\u25cb*<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert N+1 number of nibbles (A nibble is comprised by 4 successive bits, so B0~B3 of S form nibble 0, B4~B7 form nibble 1, etc&#8230;)within S to 7-segment code, and store the code into a low byte of D (High bytes does not change). The 7 segment within D are put in sequence, with &#8220;a&#8221; segment placed at B6, &#8220;b&#8221; segment at B5, &#8230;. ,&#8221;g&#8221; segment at B0. B7 is not used and is fixed as 0. For details please refer the &#8220;7-segment code and display pattern table&#8221;.<\/p>\n<p>\u25cf Because this instruction is limited to 16 bits, and S only has 4 nibbles (NB0~NB3), the effective range of N is 0~3. Beyond this range, will set the N value flag error &#8220;ERR&#8221; to 1, and does not carry out this instruction.<\/p>\n<p>\u25cf Care should be taken on total nibbles to be converted is N+1. N=0 means one digit to convert, N=1 means two digits to convert etc\u2026<\/p>\n<p>\u25cf When using the FATEK 7-segment expansion module(FBs-7SGxx) and the FUN84 (7SEG) handy instruction for mixing decoding and non-decoding application, FUN59 and FUN84 can be combined to simplify the program design.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p052-1.png\" alt=\"FUN 59 P FUN 59 P 7-SEGMENT CONVERSION \u21927SG \u21927SG\" width=\"654\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p052-2.png\" alt=\"\u3008Example 1\u3009When M1 OFF\u2192ON, convert hexadecimal to 7-Segment \u2024Figure left shown the conversion of first digit(nibble) of M1 59P. 7SG S : R0 ERR R0 to 7-segment and store in low byte of R100, the EN N : 0 high byte of R100 remain unchanged. D : R100 Original R100\uff1d0000H R0\uff1d0001H \u25cf R100\uff1d0030H\uff081\uff09\" width=\"610\" height=\"164\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p052-3.png\" alt=\"\u3008Example 2\u3009When M1 ON, convert the hexadecimal to 7-Segment \u2024Instruction at left will convert the first and the second M1 59. 7SG ERR digit of R0 to 7-segment and store in R100. EN S : R0 \u2024The low byte of R100 stores first digit. N : 1 \u2024The high byte of R100 stores second digit. D : R100 R0\uff1d0056H \u25cf \" width=\"609\" height=\"155\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 3\u3009When M1 ON, converting hexadecimal to 7-Segment<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p052-4.png\" alt=\"\u2024Instruction at left will convert the first, second and third digit of R0 to 7-segment and store in R100 and R101. M1 59. 7SG \u2024The low byte of R100 stores first digit. ERR EN S : R0 \u2024The high byte of R100 stores second digit. N : 2 \u2024The low byte of R101 stores third digit. D : R100 \u2024The high byte of\" width=\"578\" height=\"201\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 4\u3009When M1 ON, convert hexadecimal to 7-Segment<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p052-5.png\" alt=\"M1 59. 7SG ERR S : R0 EN N : 3 D : R100\" width=\"215\" height=\"112\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Instruction at left will convert 1~4 digit of R0 to 7-segment and store in R100 and R101. \u2024The low byte of R100 stores first digit. \u2024The high byte of R100 stores second digit. \u2024The low byte of R101 stores third digit. \u2024The high byte of R10 stores 4th digit.<\/p>\n<p>R0=2790H<\/p>\n<p>\u25cf R100=7B7EH\uff0890\uff09<\/p>\n<p>R101=6D72H\uff0827\uff09<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p053-1.png\" alt=\"FUN 59 P FUN 59 P 7-SEGMENT CONVERSION \u21927SG \u21927SG\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p053-2.png\" alt=\"Nibble data of S Low byte of D 7-segment Display display format B7 B6 B5 B4 B3 B2 B1 B0 pattern Hexadecimal Binary number number \u25cf a b c d e f g 0 0000 0 1 1 1 1 1 1 0 1 0001 0 0 1 1 0 0 0 0 2 0010 0 1 1 0 1 1 0 1 3 0011 0 1 1 1 1 0 0 1 B6 4 0100 0 0 1 1 0 0 1 1 a B1 f b B5 5 0101 B0 0 1 0 1 1 0 1 1\" width=\"640\" height=\"834\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN60 P ASCII CONVERSION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p054-2.png\" alt=\"S : Alphanumerics to be converted into ASCII code D : Starting register storing ASCII results Range WY WM WS TMR CTR HR OR SR ROR DR Alphanumeric WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 1\uff5e12 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 alphanumeric rand WY240 WM1896 WS984 T255 C255 R3839 R3967 R4167 R8071 D4095 S \u25cb D\" width=\"581\" height=\"244\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert alphabets and numbers stored in S (S has a maximum of 12 alphanumeric character) into ASCII and store it into registers starting from D. Each 2 alphanumeric characters occupy one 16-bit register.<\/p>\n<p>\u25cf The application of this instruction, most often, stores alphanumeric information within a program, and waits until certain conditions occur, then converts this alphanumeric information into ASCII and conveys it to external display devices which can accept ASCII code.<\/p>\n<p>\u25cf The instruction at left converts the 6 alphabets<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p054-3.png\" alt=\"X0 60P. ASC S : ABCDEF ERR EN D : R0\" width=\"203\" height=\"75\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>-ABCDEF into ASCII then stores it into 3 successive registers starting from R0.<\/p>\n<p>S<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p054-4.png\" alt=\"D High Byte Low Byte R0 42\uff08B\uff09 41\uff08A\uff09 X0\uff1d\u21b1 R1 44\uff08D\uff09 43\uff08C\uff09 \u25cf R2 46\uff08F\uff09 45\uff08E\uff09\" width=\"230\" height=\"110\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Alphabet<\/p>\n<p>ABCDEF<\/p>\n<h4>FUN61 P HOUR:MINUTE:SECOND TO SECONDS CONVERSION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p055-2.png\" alt=\"S : Starting calendar data register to be converted D : Starting register storing results WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 \uff0d117968399 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071\" width=\"590\" height=\"231\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert the hour: minute: second data of S~S+2 into an equivalent value in seconds and store it into the 32-bit register formed by combining D and D+1. If the result = 0, then set the &#8220;D = 0&#8221; flag as 1.<\/p>\n<p>\u25cf Among the FBs-PLC instructions, the hour: minute: second time related instructions (FUN61 and 62) use 3 words of register to store the time data, as shown in the diagram below. The first word is the second register, the second word is the minute register, and finally the third word is the hour register, and in the 16 bits of each register, only B14~B0 are used to represent the time value. While bit B15 is used to express whether the time values are positive or negative. When B15 is 0, it represents a positive time value, and when B15 is 1 it represents a negative time value. The B14~B0 time value is represented in binary, and when the time value is negative, B14~B0 is represented with the 2&#8217;s complement. The number of seconds that results from this operation is the result of summation of seconds from the three registers representing hours: minutes:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p055-3.png\" alt=\"seconds. B15 B14 B0 B15 B0 \uff0d32768 sec\uff5e32767 sec S (sec) D the sec. value. \u25cf D\uff0b1 S\uff0b1 (min) \uff0d32768 min\uff5e32767 min S\uff0b2 (hr) \uff0d32768 hr\uff5e32767 hr B31 B30 B16 \u2191 \u2191 B31 is used to represent the positive or The B15 of each registers is used to represent the sign of each time value \u2514 negative nature of the sec.\" width=\"595\" height=\"116\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Besides FUN61 or 62 instruction which treat hour: minute: second registers as an integral data, other instructions treat it as individual registers.<\/p>\n<p>\u25cf The example program at below converts the hour: minute: second data formed by R20~R22 into their equivalent value in seconds then stored in the 32-bit register formed by R50~R51. The results are shown below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p055-4.png\" alt=\"\uff1d3601 sec R20 0E11H FD2FH \uff1d\u2212721 min S R21 \uff1d1011 hr R22 03F3H \u25cfX0\uff1d\u21b1 EE45H R50 \uff1d3599941 sec D R51 0036H\" width=\"275\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p055-5.png\" alt=\"X0 61P. SEC S : R 20 D=0 EN D : R 50\" width=\"202\" height=\"75\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN62 P SECOND\u2192HOUR\uff1aMINUTE\uff1aSECOND<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p056-2.png\" alt=\"S :Starting register of second to be converted D :Starting register storing result of conversion (hour : minute : second) Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 \uff0d117968399 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WX240 WY240 WM1896 WS984 T255 C2\" width=\"620\" height=\"230\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert the second data from the S~S+1 32-bit register into the equivalent hour : minute : second time value and store it in the three successive registers D~D+2. All the data in this instruction is represented in binary (if there is a negative value it is represented using the 2&#8217;s complement.)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p056-3.png\" alt=\"B15 B0 B15 B0 \uff0d59 sec\uff5e59 sec S D (sec) \u25cf D\uff0b1 (min) Second S\uff0b1 \uff0d59 min\uff5e59 min D\uff0b2 (hr) \uff0d32768 hr\uff5e32767 hr B31 B16 \u2191 \u2191 The bit B31 of the second The bits B15 of each register are used as register is used as the sign the sign bit of the hour : minute : second bit of the second value. value.\" width=\"499\" height=\"142\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf As shown in the diagram above, after convert to hour : minute : second value, the minute : second value can only be in the range of -59 to 59, and the hour number can be in the range of -32768 to 32767 hours. Because of this, the maximum limit of D is -32768 hours, -59 minutes, -59 seconds to 32767 hours, 59 minutes, 59 seconds, the corresponding second value of S which is in the range of -117968399 to 117964799 seconds. If the S value exceeds this range, this instruction cannot be carried out, and will set the over range flag &#8220;OVR&#8221; to 1. If S = 0 then result is 0 flag &#8220;D = 0&#8221; will be set to 1.<\/p>\n<p>\u25cf The program in the diagram below is an example of this instruction. Please note that the content of the registers are denoted by hexadecimal, and on the right is its equivalent value in decimal notation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p056-4.png\" alt=\"R0 5D17H 6315287 sec R1 0060H \u25cfX0\uff1d\u21b1 R10 002FH 47 sec R11 000EH 14 min R12 06DAH 1754 hr\" width=\"225\" height=\"127\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p056-5.png\" alt=\"X0 62P. HMS S : R 0 D=0 EN D : R 10 OVR\" width=\"203\" height=\"76\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p057-1.png\" alt=\"FUN 63 P \u2192HEX\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN 63 P<\/p>\n<p>CONVERSION OF ASCII CODE TO HEXADECIMAL VALUE<\/p>\n<p>\u2192HEX<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p057-2.png\" alt=\"S : Starting source register. N : Number of ASCII codes to be converted to hexadecimal values. D : The starting register that stores the result (hexadecimal value). S, N, D, can associate with V, Z, P0~P9 to do the indirect addressing application. WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX\" width=\"601\" height=\"266\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When conversion control \u201cEN\u201d =1 or changes from 0\u21921( P instruction), it will convert the N successive hexadecimal ASCII character(\u20180\u2019~\u20199\u2019,\u2019A\u2019~\u2019F\u2019) convey by 16 bit registers (Low Byte is effective) into hexadecimal value, and store the result into the register starting with D. Every 4 ASCII code is stored in one register. The nibbles of register, which does not involve in the conversion of ASCII code will remain unchanged.<\/p>\n<p>\u25cf The conversion will not be performed when N is 0 or greater than 511.<\/p>\n<p>\u25cf When there is ASCII error (neither 30H\uff5e39H nor 41H\uff5e46H), the output \u201cERR\u201d is ON.<\/p>\n<p>\u25cf The main purpose of this instruction is to convert the hexadecimal ASCII character (\u20180\u2019~\u20199\u2019,\u2019A\u2019~\u2019F\u2019), which is received by communication port1 or communication port2 from the external ASCII peripherals, to the hexadecimal values that the CPU can process directly.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p058-1.png\" alt=\"FUN 63 P FUN 63 P CONVERSION OF ASCII CODE TO HEXADECIMAL VALUE \u2192HEX \u2192HEX\" width=\"654\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 1\u3009When M1 from OFF\u2192ON, ASCII code converted to hexadecimal value.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p058-2.png\" alt=\"M1 63P. HEX EN S : R0 N : 1 D : R100\" width=\"197\" height=\"106\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Converts the ASCII code of R0 into hexadecimal value and store to nibble0 (nibble1~nibble3 remain unchanged) of R100<\/p>\n<p>Originally R100\uff1d0000H<\/p>\n<p>R0\uff1d0039H\uff089\uff09\u25cf<\/p>\n<p>R100\uff1d0009H<\/p>\n<p>\u3008Example 2\u3009When M1 is ON, ASCII code converted to hexadecimal value.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p058-3.png\" alt=\"M1 63. HEX \u2024 Converts the ASCII code of R0 and R1 into EN S : R0 hexadecimal value and store to low byte (high byte N : 2 remain unchanged) of R100 D : R100 R0\uff1d0039H\uff089\uff09 Originally R100\uff1d0000H R1\uff1d0041H\uff08A\uff09\u25cf R100\uff1d009AH\" width=\"579\" height=\"158\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 3\u3009When M1 is ON, ASCII code converted to hexadecimal value.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p058-4.png\" alt=\"M1 63. HEX \u2024 Converts the ASCII code of R0 and R1 into S : R0 EN hexadecimal value and store result into R100 (nibble 3 N : 3 remain unchanged) D : R100 R0\uff1d0039H \uff089\uff09 Originally R100\uff1d0000H R1\uff1d0041H \uff08A\uff09 R2\uff1d0045H \uff08E\uff09\u25cf R100\uff1d09AEH\" width=\"578\" height=\"176\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 4\u3009When M1 is ON, ASCII code converted to hexadecimal value.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p058-5.png\" alt=\"M1 63. HEX EN S : R0 6 N : D : R100\" width=\"197\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Converts the ASCII code of R0~R5 into hexadecimal value and store it to R100~R101<\/p>\n<p>R0\uff1d0031H\uff081\uff09 Originally R100\uff1d0000H<\/p>\n<p>R1\uff1d0032H\uff082\uff09<\/p>\n<p>R101\uff1d0000H<\/p>\n<p>R2\uff1d0033H\uff083\uff09<\/p>\n<p>R3\uff1d0034H\uff084\uff09<\/p>\n<p>R4\uff1d0035H\uff085\uff09\u25cf<\/p>\n<p>R100\uff1d3456H<\/p>\n<p>R5\uff1d0036H\uff086\uff09<\/p>\n<p>R101\uff1d0012H<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p059-1.png\" alt=\"FUN 64 P \u2192ASCII\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN 64 P<\/p>\n<p>CONVERSION OF HEXADECIMAL VALUE TO ASCII CODE<\/p>\n<p>\u2192ASCII<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p059-2.png\" alt=\"S : Starting source register N : Number of hexadecimal digit to be converted to ASCII code. D : The starting register storing result. S, N, D, can associate with V, Z, P0~P9 to do the indirect addressing application. Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3\" width=\"603\" height=\"268\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When conversion control \u201cEN\u201d =1 or changes from 0\u21921( P instruction), will convert the N successive nibbles of hexadecimal value in registers start from S into ASCII code, and store the result to low byte (high byte remain unchanged) of the registers which start from D.<\/p>\n<p>\u25cf The conversion will not be performed when the value of N is 0 or greater than 511.<\/p>\n<p>\u25cf The main purpose of this instruction is to convert the numerical value data, which PLC has processed, to ASCII code and transmit to ASCII peripherals by communication port1 or communication port 4.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p060-1.png\" alt=\"FUN 64 P FUN 64 P CONVERSION OF HEXADECIMAL VALUE TO ASCII CODE \u2192ASCII \u2192ASCII\" width=\"654\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 1\u3009When M1 changes from OFF\u2192ON, it converts hexadecimal value to ASCII code.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p060-2.png\" alt=\"M1 64P. ASCII \u2024Converts the Nibble 0 of R0 to ASCII code and stores EN S : R0 it into R100 (High byte does not change). N : 1 D : R100 R0\uff1d0009H \u25cf R100\uff1d0039H\uff089\uff09\" width=\"579\" height=\"134\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 2\u3009When M1 is ON, it converts hexadecimal value to ASCII code.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p060-3.png\" alt=\"64. SCII M1 EN S : R0 N : 2 D : R100\" width=\"197\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Converts the NB0\uff5eNB1 of R0 to ASCII code and stores it into R100 \uff5eR101 (high bytes remain unchanged).<\/p>\n<p>R0\uff1d009AH<\/p>\n<p>\u25cf R100\uff1d0039H\uff089\uff09<\/p>\n<p>R101\uff1d0041H\uff08A\uff09<\/p>\n<p>\u3008Example 3\u3009When M1 is ON, it converts hexadecimal value to ASCII code.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p060-4.png\" alt=\"M1 64. SCII \u2024Converts the NB0\uff5eNB2 of R0 to ASCII code and S : R0 EN stores it into R100\uff5eR102 3 N : D : R100 R0\uff1d0123H \u25cf R100\uff1d0031H\uff081\uff09 R101\uff1d0032H\uff082\uff09 R102\uff1d0033H\uff083\uff09\" width=\"579\" height=\"176\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u3008Example 4\u3009When M1 is ON, it converts hexadecimal value to ASCII code.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p060-5.png\" alt=\"M1 64. SCII \u2024Converts the NB0\uff5eNB5 of R0\uff5eR1 to ASCII code S : R0 EN and stores it into R100\uff5eR105 6 N : D : R100 R0\uff1d3456H \u25cf R100\uff1d0031H\uff081\uff09 R1\uff1d0012H R101\uff1d0032H\uff082\uff09 R102\uff1d0033H\uff083\uff09 R103\uff1d0034H\uff084\uff09 R104\uff1d0035H\uff085\uff09 R105\uff1d0036H\uff086\uff09\" width=\"579\" height=\"234\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>END<\/p>\n<p>PROGRAM END<\/p>\n<p>END<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p061-1.png\" alt=\"No operand\" width=\"655\" height=\"98\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When end control &#8220;EN&#8221; = 1, this instruction is activated. Upon executing the END instruction and &#8220;EN&#8221; = 1, the program flow will immediately returns to the starting point (0000M) to restart the next scan \u2013 i.e. all the programs after the END instruction will not be executed. When &#8220;EN&#8221; = 0, this instruction is ignored, and programs after the END instruction will continue to be executed as the END instruction is not exist.<\/p>\n<p>\u25cf This instruction may be placed more than one point within a program, and its input (end control &#8220;EN&#8221;) controls the end point of program execution. It is especially useful for debugging and for testing.<\/p>\n<p>\u25cf It\u2019s not necessary to put any END instructions in the main program, CPU will automatic restart to start point when reach the end of main program.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p061-2.png\" alt=\"0000M Program 1 Program 1 Program execution X0 X0=1 ORG X0 EN END END Program 2 Program 2 X0=0 X1=1 X1 ORG X1 EN END END Program 3 Program 3 X0=X1=0\" width=\"537\" height=\"369\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN65 LBL LABEL<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p062-1.png\" alt=\"S : Alphanumeric, 1~6 characters \u25cf This instruction is used to make a tag on certain address within a program, to provide a target address for\" width=\"655\" height=\"117\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>execution of JUMP, CALL instruction and interrupt service. It also can be used for document purpose to improve the readability and interpretability of the program.<\/p>\n<p>\u25cf This instruction serves only as the program address marking to provide the control of procedure flow or for remark. The instruction itself will not perform any actions; whether the program contains this instruction or not, the result of program execution will not be influenced by this instruction.<\/p>\n<p>\u25cf The label name can be formed by any 1\uff5e6 alphanumeric characters and can\u2019t be duplicate in the same program. The following label names are reserved for interrupt function usage. These \u201creserved words\u201d, can\u2019t be used for normal program labels.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>Reserved words<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>X0+I\uff5eX15+I\uff08INT0\uff5eINT15\uff09<br \/>X0\u2212I\uff5eX15\u2212I\uff08INT0\u2212\uff5eINT15\u2212\uff09<\/td>\n<td>labels for external input (X0\uff5eX15) interrupt<br \/>service routine.<\/td>\n<\/tr>\n<tr>\n<td>HSC0I\uff5eHSC7I<\/td>\n<td>labels for high speed counter HSC0\uff5eHSC7<br \/>interrupt service routine.<\/td>\n<\/tr>\n<tr>\n<td>1MSI\uff081MS\uff09\u30012MSI\uff082MS\uff09\uff0c3MSI\uff083MS\uff09\uff0c<br \/>4MSI\uff084MS\uff09\uff0c5MSI\uff085MS\uff09\uff0c10MSI\uff0810MS\uff09\uff0c<br \/>50MSI\uff0850MS\uff09\uff0c100MSI\uff08100MS\uff09<\/td>\n<td>Labels for 8 kinds of internal timer interrupt<br \/>service routine.<\/td>\n<\/tr>\n<tr>\n<td>HSTAI\uff08ATMRI\uff09\uff0cHST0I~HST3I<\/td>\n<td>Label for High speed fixed timer interrupt<br \/>service routine.<\/td>\n<\/tr>\n<tr>\n<td>PSO0I\uff5ePSO3I<\/td>\n<td>Labels for the pulse output command<br \/>finished interrupt service routine.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>Only the interrupt service routine can use the label names listed on above table, if mistaken on using the reserved label on the normal subroutine can cause the CPU fail or unpredictable operation.<\/p>\n<p>The label of following diagram illustration served only as program remarks (it is not treated as a label for call or jump target). For the application of labeling in jump control, please refer to JMP instruction for explanation. As to the labeling serves as subroutine names, please refer to CALL instruction for details.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p062-2.png\" alt=\"65 LBL PGM1 Program 1 65 LBL PGM2 Program 2\" width=\"206\" height=\"164\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN66 P JMP Ladder symbol<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p063-2.png\" alt=\"66P. LBL : The program label to be jumped JMP LBL Jump control EN\" width=\"655\" height=\"69\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When jump control \u201cEN\u201d=1 or changes from 0\u21921 ( P instruction), PLC will jump to the location behind the marked label and continuous to execute the program.<\/p>\n<p>\u25cf This instruction is especially suit for the applications where some part of the program will be executed only under certain condition. This can shorter the scan time while not executes the whole program.<\/p>\n<p>\u25cf This instruction allows jump backward (i.e. the address of LBL is comes before the address of JMP instruction). However, care should be taken if the jump action cause the scan time exceed the limit set by the watchdog timer, the WDT interrupt will be occurred and stop executing.<\/p>\n<p>\u25cf The jump instruction allows only for jumping among main program or jumping among subroutine area, it can\u2019t jump across main\/subroutine area.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p063-3.png\" alt=\"X0 66 EN JMP PATHB Program A 65 LBL PATHB Program B\" width=\"206\" height=\"155\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024In the left diagram, when X0=1, the program will jump directly to the LBL position named PATHB and continuing to execute program B. Therefore it will skip the program A and none of the instructions of program A will be executed. The status of registers and the coils associated with program A will keep unchanged (as if there is no program section A).<\/p>\n<h4>FUN67 P CALL CALL<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p064-2.png\" alt=\"LBL : The subroutine label name to be called.\" width=\"655\" height=\"98\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When call control \u201cEN\u201d=1 or changes from 0\u21921 ( P instruction), PLC will call (perform) the subroutine bear the same label name as the one being called. When execute the subroutine, the program will execute continuous as normal program does but when the program encounter the RTS instruction then the flow of the program will return back to the address immediately after the CALL instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p064-3.png\" alt=\"\u25cf All the subroutines must end with one \u201creturn from 65 LBL SUB1 subroutine instruction RTS\u201d instruction; otherwise it will cause executing error or CPU shut down. Program 1 Nevertheless, an RTS instruction can be shared by subroutines (so called as multiple entering 66 SUB1 + JMP SUB3 subroutines; \" width=\"651\" height=\"470\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Interrupt service programs \uff08HSC0I\uff5eHSC7I\u3001PSO0I\uff5ePSO3I\u3001X0+I\uff5eX15+I\uff0fINT0\uff5eINT15\u3001X0\u2212I\uff5eX15\u2212I\uff0fINT0\u2212\uff5eINT15\u2212\u3001HSTAI\uff0fATMRI\u30011MSI\uff0f1MS\u30012MSI\uff0f2MS\u30013MSI\uff0f3MS\u30014MSI\uff0f4MS\u30015MSI\uff0f5MS\u300110MSI\uff0f10MS\u300150MSI\uff0f50MS\u3001100MSI\uff0f100MS\uff09 are also a kind of subroutine. It is also placed in sub program area. However, the calling of interrupt service program is triggered off by the signaling of hardware to make the CPU perform the corresponding interrupt service program (which we called as the calling of the interrupt service program). The interrupt service program can also call subroutine or interrupted by other interrupts with higher priority. Since it is also a subroutine (which occupied one level), it can only call or interrupted by 4 levels of subroutine or interrupt service program. Please refer to RTI instruction for explanation.<\/p>\n<h4>FUN68 RTS RETURN FROM SUBROUTINE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p065-1.png\" alt=\"\" width=\"199\" height=\"78\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction is used to represent the end of a subroutine. Therefore it can only appear within the subroutine area. Its input side has no control signal, so there is no way to serially connect any contacts. This instruction is self sustain, and is directly connected to the power line.<\/p>\n<p>\u25cf When PLC encounter this instruction, it means that the execution of a subroutine is finished. Therefore it will return to the address immediately after the CALL instruction, which were previously executed and will continue to execute the program.<\/p>\n<p>\u25cf If this instruction encounters any of the three flow control instructions MC, SKP, or JMP, then this instruction may not be executed (it will be regarded as not exist). If the above instructions are used in the subroutine and causing the subroutine not to execute the RTS instruction, then PLC will halt the operation and set the M1933( flow error flag) to 1. Therefore, no matter what the flow is going, it must always ensure that any subroutine must be able to execute a matched RTS instruction.<\/p>\n<p>\u25cf For the usage of the RTS instruction please refer to instructions for the CALL instruction.<\/p>\n<h4>FUN69 RTI RETURN FROM INTERRUPT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p066-1.png\" alt=\"\" width=\"199\" height=\"109\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The function of this instruction is similar to RTS. Nevertheless, RTS is used to end the execution of sub program, and RTI is used to end the execution of interrupt service program. Please refer to the explanation of RTS instruction.<\/p>\n<p>\u25cf A RTI instruction can be shared by more than one interrupt service program. The usage is the same as the sharing of an RTS by many subroutines. Please refer to the explanation of CALL instruction.<\/p>\n<p>\u25cf The difference between interrupts and call is that the sub program name (LBL) of a call is defined by user, and the label name and its call instruction are included in the main program or other sub program. Therefore, when PLC performs the CALL instruction and the input \u201cEN\u201d=1 or changes from 0\u21921 (P instruction), the PLC will call (execute) this sub program. For the execution of interrupt service program, it is directly used with hardware signals to interrupt CPU to pause the other less important works, and then to perform the interrupt service program corresponding to the hardware signal (we call it the calling of interrupt service program). In comparing to the call instruction that need to be scanned to execute, the interrupt is a more real time in response to the event of the outside world. In addition, the interrupt service program cannot be called by label name; therefore we preserve the special \u201creserved words\u201d label name to correspond to the various interrupts offered by PLC (check FUN65 explanation for details). For example, the reserved word X0+I is assigned to the interrupt occurred at input point X0; as long as the sub program contains the label of X0+I, when input point X0 interrupt is occurred (X0: \u21b1), the PLC will pause the other lower priority program and jump to the subroutine address which labeled as X0+I to execute the program immediately.<\/p>\n<p>\u25cf If there is a interrupt occurred while CPU is handling the higher priority (such as hardware high speed counter interrupt) or same priority interrupt program (please refer to Chapter 10 for priority levels), the PLC will not execute the interrupt program for this interrupt until all the higher priority programs were finished.<\/p>\n<p>\u25cf If the RTI instruction cannot be reached and performed in the interrupt service routine, may cause a serious CPU shut down. Consequently, no matter how you control the flow of program, it must be assured that the RTI instruction will be executed in any interrupt service program.<\/p>\n<p>\u25cf For the detailed explanation and example for the usage of interrupts, please refer to Chapter 9 for explanation.<\/p>\n<h4>FUN70 FOR FOR<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p067-1.png\" alt=\"N : Number of times of loop execution Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 16383 N \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"515\" height=\"171\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction has no input control, is connected directly to the power line, and cannot be in series with any conditions.<\/p>\n<p>\u25cf The programs within the FOR and NEXT instructions form a program loop (the start of the loop program is the next instruction after FOR, and the last is the instruction before NEXT). When PLC executes the FOR instruction, it first records the N value after that instruction (loop execution number), then for N times successively execution from start to last of the programs in the loop. Then it jumps out of the loop, and continues executes the instruction immediately after the NEXT instruction.<\/p>\n<p>\u25cf The loop can have a nested structure, i.e. the loop includes other loops, like an onion. 1 loop is called a level, and there can be a maximum of 5 levels. The FOR and NEXT instructions must be used in pairs. The first FOR instruction and the last NEXT instruction are the outermost (first) level of a nested loop. The second FOR instruction and the second last NEXT instruction are the second level, the last FOR instruction and the first NEXT instruction form the loop&#8217;s innermost level.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p067-2.png\" alt=\"\u2024In the example in the diagram at left, loop \u25cf will be 70 executed 4 \u00d73 \u00d72 = 24 times, loop \u25cf will be FOR 2 executed 3 \u00d72 = 6 times, and loop \u25cf will be executed 2 times. 70 \u2024If there is a FOR instruction and no corresponding NEXT FOR 3 instruction, or the FOR and NEXT instructions in the nested loop\" width=\"634\" height=\"365\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN71 NEXT LOOP END<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p068-1.png\" alt=\"\" width=\"199\" height=\"81\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction and the FOR instruction together form a program loop. The instruction itself has no input control, is connected directly to the power line, and cannot be in series with any conditions.<\/p>\n<p>\u25cf When PLC has not yet entered the loop (has not yet executed to the FOR instruction, or has executed but then jumped out), but the NEXT instruction is reached, then PLC will not take any action, just as if this instruction did not exist.<\/p>\n<p>\u25cf For the usage of this instruction please refer to the explanations for the FOR instruction on the preceding page.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p069-1.png\" alt=\"FUN 74 P IMDIO\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>IMMEDIATE I\/O<\/p>\n<p>FUN 74 P IMDIO<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p069-2.png\" alt=\"D : Starting number of I\/O points to be refreshed N : Number of I\/O points to be refreshed X Y K Range Xn of Yn of 1 Main Main \u2223 Ope- Unit. Unit. 36 rand D \u25cb \u25cb N \u25cb\" width=\"585\" height=\"233\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf For normal PLC scan cycle, the CPU gets the entire input signals before the program is executed, and then perform the executing of program based on the fresh input signals. After finished the program execution the CPU will update all the output signals according to the result of program execution. Only after the complete scan has been finished will all the output results be transferred all at once to the output. Thus for the input event to output responses, there will be a delay of at least 1 scan time (maximum of 2 scan time). With this instruction, the input signals or output signals specified by this instruction can be immediately refresh to get the faster input to output response without the limitation imposed by the scan method.<\/p>\n<p>\u25cf When refresh control &#8220;EN&#8221; = 1 or has a transition from 1 to 0( P instruction), then the status of N input points or output points (D~D+N-1) will be refreshed.<\/p>\n<p>\u25cf The I\/O points for FBs-PLC&#8217;s immediate I\/O are only limited to I\/O points on the main unit. The table below shows permissible I\/O numbers for 20, 32, 40 and 60 point main units:<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td rowspan=\"2\">Main-unit type<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td rowspan=\"3\">60<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">10<\/td>\n<td rowspan=\"2\">14<\/td>\n<td rowspan=\"2\">20<\/td>\n<td rowspan=\"2\">24<\/td>\n<td rowspan=\"2\">32<\/td>\n<td rowspan=\"2\">40<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Permissible<\/td>\n<\/tr>\n<tr>\n<td>points<\/td>\n<td>points<\/td>\n<td>points<\/td>\n<td>points<\/td>\n<td>points<\/td>\n<td>points<\/td>\n<td>points<\/td>\n<\/tr>\n<tr>\n<td>numbers<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Input signals<\/td>\n<td>X0\uff5eX5<\/td>\n<td>X0\uff5eX7<\/td>\n<td>X0\uff5eX11<\/td>\n<td>X0\uff5eX13<\/td>\n<td>X0\uff5eX19<\/td>\n<td>X0\uff5eX23<\/td>\n<td>X0\uff5eX35<\/td>\n<\/tr>\n<tr>\n<td>Output signals<\/td>\n<td>Y0\uff5eY3<\/td>\n<td>Y0\uff5eY5<\/td>\n<td>Y0\uff5eY7<\/td>\n<td>Y0\uff5eY9<\/td>\n<td>Y0\uff5eY11<\/td>\n<td>Y0\uff5eY15<\/td>\n<td>Y0\uff5eY23<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf If the intended refresh I\/O signals of this instruction is beyond the range of I\/O points specified on above table then PLC will be unable to operate and the M1931 error flag will be set to 1. ( for example, if in a program, D=X11, N=10, which means X11 to X20 are to be immediately retrieved. Supposing the main unit is FBs-32MA, then its biggest input point is X19, and clearly X20 has already exceeded the main unit&#8217;s input point number so under such case M1931 error flag will be set to 1).<\/p>\n<p>\u25cf With this instruction, PLC can immediately refresh input\/output signals. However, the delay of the hardware or the software filter impose on the I\/O signals still exist. Please pay attention on this.<\/p>\n<h4>FUN76 D TKEY DECIMAL- KEY INPUT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p070-2.png\" alt=\"IN : Key input point D : register storing key-in numerals KL: starting coil to reflect the input status D may combine with V, Z, P0~P9 to serve indirect address application X Y M S WY WM WS TMR CTR HR OR SR ROR DR XR Range X0 Y0 M0 S0 WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \" width=\"604\" height=\"249\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction has designated 10 input points IN~IN+9 (IN0~IN9) to one decimal number entry (IN-&gt;0, IN+1-&gt;1\u2026). According to the key-in sequence (ON) of these input points, it is possible to enter 4 or 8 decimal numbers into the registers specified by D.<\/p>\n<p>\u25cf When input control &#8220;EN&#8221; = 1, this instruction will monitor the<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p070-3.png\" alt=\"10 input points starting from IN and put the corresponding number into D register while the key were depressed. It will wait until the input point has released, then monitor the next &quot;ON&quot; input point, and shift in the new number into D register (high digit is older than low digit ) . For the 16-bit \" width=\"601\" height=\"310\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When input control &#8220;EN&#8221; = 0, this instruction will not be executed. KPR output and KL coil status will be 0. However, the numerical values of D register will remain unchanged.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p070-4.png\" alt=\"76.TKEY Y0 X20 EN IN : X 0 KPR D : R 0 KL : M 0\" width=\"259\" height=\"150\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024The instruction at left represents the input point X0 with the number &#8220;0&#8221;, X1 is represented by 1, &#8230; , M0 records the action of X0, M1 records the action of X1 &#8230; , and the input numerical values are stored in the R0 register.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p071-1.png\" alt=\"FUN 76 D FUN 76 D DECIMAL- KEY INPUT TKEY TKEY The following diagram is the input wiring schematic for this example: 0 1 2 3 4 5 6 7 8 9 C X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 FBS-PLC input side \u25cf If the X0~X3 key-in sequence follow the \u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf sequence in the following diagram. At step \u25cf and \u25cf the X20 is \" width=\"655\" height=\"355\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>register can only hold 4 key numbers, Of these 5 steps the first key was kick out. The key strokes 3302 of<\/p>\n<h4>the steps \u25cf\u25cf\u25cf\u25cf are entered in the R0 register.<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p071-2.png\" alt=\"X20 5 X0 2 2 7 X1 1 6 1 6 X2 4 3 4 X3 M0 M1 M2 M3 4 5 6 2 3 3 4 5 6 Y0 R0 0000 3302 3302 3302 0000 0000 0001 0013 0001 0013 0133 1330 0001 0013 0133 1330 1330\" width=\"545\" height=\"462\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p072-1.png\" alt=\"FUN 77 D FUN 77 D HEX-KEY INPUT HKEY HKEY IN : Starting of digital input for key scan OT: Starting of digital output for multiplexing key scan (4 points) D : Register to store key-in numbers KL : Starting relay for key status WR: Working register, it can&#x27;t repeat in use D may combine with V\u3001Z\u3001P0~P9 \" width=\"654\" height=\"340\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The numeric (0~9) key function of this instruction is similar as for the TKEY instruction. The hardware connection for TKEY and HKEY is different. For TKEY instruction each key have one input point to connect, while HKEY use 4 input points and 4 output points to form a 4&#215;4 multiplex 16 key input. 4\u00d74 means that there can be 16 input keys, so in addition to the 10 numeric keys, the other 6 keys can be used as function keys (just like the usual discrete input). The actions of the numeric keys and the function keys are independent and have no effect on each other.<\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1, this instruction will scan the numeric keys and function keys in the matrix formed by the 4 input points starting from IN and the 4 output points starting from OT. For the function of the numeric keys and &#8220;NKP&#8221; output please refer to the TKEY instruction. The function keys maintain the key-in status of the A~F keys in the last 6 relays specified by KL (the first 10 store the key-in status of the numeric keys). If any one of the A~F keys is depressed, FKP (FO1) will set to 1. The OT output points for this instruction must be transistor outputs.<\/p>\n<p>\u25cf The biggest number for a 16-bit operand is 4 digits (9999), and for 32-bit operand is 8 digits (99999999).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p072-2.png\" alt=\"However, there are only 6 function keys (A~F), no matter whether it is a 16-bit or 32-bit operand. 77D.HKEY M10 X10 Function EN IN : X0 NKP Keys D E F C OT : Y0 D : R0 M11 8 9 A B FKP M0 KL : Numeric WR : D0 4 5 6 7 Keys 3 0 1 2 \u2024 The instruction in the diagram above S\/S X0 X1 X2 X3 + uses X0~X3 and\" width=\"631\" height=\"305\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p073-1.png\" alt=\"FUN 78 D FUN 78 D DIGITAL SWITCH INPUT DSW DSW Ladder symbol IN : Starting of input for thumb wheel switch OT : Starting of output for multiplexing scan 78D.DSW (4 points) IN : Input control EN DN Readout completed D : Register to store readout value OT : WR: Working register, it can&#x27;t repeat in use\" width=\"627\" height=\"326\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When input control &#8220;EN&#8221; = 1, this instruction will readout one digit data from the 4 input points starting from IN (IN0~IN3). It takes 4 scans to read out a group of 4-digit BCD values (0000~9999) and store them into D register. With a 32-bit operand, each scan can get 2 digits of data by reading the additional digit from IN4-IN7 and store it in the D+1 register. Each bit of OT0~OT3 will sequentially set to 1 and get the digit data respectively into 100(ones), 101(tens), 102(hundreds), and 103(thousands). As long as EN is 1, PLC will scan and read out in continuous cycles. When each complete cycle is finished (i.e. the 4 digit readout of 100~103 is completed), the readout completed flag &#8220;DN&#8221; is set to 1. However, it is only kept for one scan. If any digital readout value is not within the range of 0~9 (BCD), then reading error &#8220;ERR&#8221; will be set to 1 and<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p073-2.png\" alt=\"the value of that group of digits will be set to 0000. \u25cf The output points must be transistor outputs. \u2024In this example, when X10 is 1, then the numeric value of the 78.DSW M10 X10 thumb wheel switch (5678 in this example) will be read out EN IN : X0 DN and stored into the R0 register. OT : Y0 \u2024The \" width=\"625\" height=\"443\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN79 D 7-SEGMENT OUTPUT WITH LATCH<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p074-2.png\" alt=\"Ladder symbol S : Register storing the data (BCD) to be 79D.7SGDL displayed S : Output complete OT : Starting number of scanning output Execution control EN DN OT : N : Specify signal output and polarity of latch WR : Working register, it can&#x27;t repeat in use N : S may combine with V\u3001Z\u3001P0~P9 to serve\" width=\"624\" height=\"263\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When input control &#8220;EN&#8221; = 1, the 4 nibbles of the S register, from digit 0 to digit 3, are sequentially sent out to the 4 output points, OT0~OT3. While output the digit data, the latch signal of that digit (OT4 corresponds to digit 0, OT5 corresponds to digit 1, etc&#8230;) at the same time is also sent out so that the digital value will be loaded and latched into the 7-segment display respectively.<\/p>\n<p>\u25cf When in D (32-bit) instruction, nibbles 0~3 from the S register, and nibbles 0~3 from the S+1 register are transferred separately to OT0~OT3 and OT8~OT11. Because they are transferred at the same time, they can use the same latch signal. 16-bit instructions do not use OT8~OT11.<\/p>\n<p>\u25cf As long as &#8220;EN&#8221; remains 1, PLC will execute the transfer cyclically. After each transfer of a complete group of numerical values (nibbles 0~3 or 0~7), the output completed flag &#8220;DN&#8221; will set to 1. However, it will only be kept for 1 scan.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p074-3.png\" alt=\"79D.7SGDL \u25cf In this example, when X0=1, the 4 nibbles of R0 M10 X0 S : R0 DN will be transferred to the first group 7-segment EN display in the diagram below. The 4 nibbles of R1 OT : Y0 will be transferred to the second group 7-segment N : 2 display. WR : D0 first group second group 8 8 VCC VCC 4 4\" width=\"609\" height=\"338\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p075-1.png\" alt=\"FUN 79 D FUN 79 D 7-SEGMENT OUTPUT WITH LATCH 7SGDL 7SGDL\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf FATEK PLC&#8217;s transistor output has both a negative logic transistor output (NPN transistor &#8211; when the output status is ON, the terminal voltage of the transistor output is low), and a positive logic transistor output (PNP when the output status is ON, the terminal voltage of the transistor output is high). Their structure is as follows:<\/p>\n<p>FBs-PLC negative logic output (NPN transistor)<\/p>\n<p>FBs-PLC positive logic output (PNP transistor)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p075-2.png\" alt=\"+24V +24V Yn When Yn is Yn &quot;ON&quot;, this output voltage is low 0V C\" width=\"272\" height=\"107\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p075-3.png\" alt=\"+24V C +24V When Yn is &quot;ON&quot;, Yn Yn&#x27;s terminal Yn voltage is high 0V 0V\" width=\"293\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The data inputs (8,4,2,1) and latch signals of the 7-segment displays on the shelf for positive and negative logic are all available. For example, for numerical value &#8220;8&#8221;, the positive logic input should be 1000, and the negative logic input 0111. Similarly, when the latch signal is 0, the positive logic latch permits the display numerical values to enter through the latch (i.e. be loaded). When the latch signal is 1, the numerical values in the latch are<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p075-4.png\" alt=\"latched (maintained), and with negative logic they are not. The following diagram of a CD-4511 7-segment display IC is an example of a positive logic numerical value input with latch. CD4511 Numberical value input R a a (1)A b c f g b (2)B 4bit BCD to LED d Drive latch (4)C 7-segment e e c f (8)D g \" width=\"620\" height=\"296\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>specify the polarity relation between the PLC transistor output, and the 7-segment display. The table below shows all the possibility.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p075-5.png\" alt=\"Latch signal (100-103) Numerical value input (8~1) Value of N Same 0 Same Different 1 Same 2 Different Different 3\" width=\"503\" height=\"119\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the diagram above, CD4511 is used as an example. If use NPN output, the data input polarity is different to PLC, and its latch input polarity is the same as PLC, so N value should chosen as 2.<\/p>\n<h4>FUN80 MUXI MULTIPLEX INPUT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p076-1.png\" alt=\"IN : Multiplex input point number OT : Multiplex output point number (must be transistor output point) N : Multiplex input lines (2~8) D : Register for storing results D may combine with V, Z, P0~P9 to serve indirect address application XR X Y WY WM WS TMR CTR HR OR SR ROR DR K Range X0 Y0 WY0 WM0 W\" width=\"610\" height=\"279\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction uses the multiplex method to read out N lines of input status from 8 consecutive input points (IN0~IN7) starting from the input point specified by IN. With this method we can obtain 8\u00d7N input status, but only need to use 8 input points and N output points.<\/p>\n<p>\u25cf The multiplex scanning method goes through N output points starting from the OT output point. Each scan one of the N bits will set to 1 and the corresponding line will be selected. OT0 responsible for first line, while OT1 responsible for second line, etc. Until it read all the N lines the 8\u00d7N status that has been read out is then stored into the register starting at D, and the execution completed flag &#8220;DN&#8221; is set as 1 (but is only kept for one scanning period).<\/p>\n<p>\u25cf With every scan, this instruction retrieves a line for 8 input status, so N lines require N scan cycles before they<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p076-2.png\" alt=\"can be completed. \u25cf This example retrieves 4 lines\u00d78 points of input, 80.MUXI M10 X0 32 point status in all. They are stored into the IN : X24 DN EN OT : Y16 32-bit register of DWM0 (M0~M31). N : 4 D : WM0 WR : D0 Fourth line M24 M25 M26 M27 M28 M29 M30 M31 Third line M17 M18 M19 M20 M21 M22 M23 Sec\" width=\"602\" height=\"423\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p077-1.png\" alt=\"FUN 81 D PULSE OUTPUT PLSO Ladder symbol 81D.PLSO MD : Output control EN Output go OUT Fr : PC : Pause control PAU DN Output completed UY:or CK U\/D DY:or DR Error Up\/Down direction ERR Or DIR HO :\" width=\"377\" height=\"239\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN 81 D PLSO<\/p>\n<p>MD : Output mode selection<\/p>\n<p>Fr : Pulse frequency<\/p>\n<p>PC : Output pulse count<\/p>\n<p>UY : Up pulse output point (MD=0). DY : Down pulse output point (MD=0). HO : Cumulative output pulse register. (Can be not assigned).<\/p>\n<p>CK : Pulse output point (MD=1). DR : Up\/Down output point (MD=1). DIR: 1- up; 0- down.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td rowspan=\"2\">Range<\/td>\n<td>Y<\/td>\n<td>WX<\/td>\n<td>WY<\/td>\n<td>WM<\/td>\n<td>WS<\/td>\n<td>TMR<\/td>\n<td>CTR<\/td>\n<td>HR<\/td>\n<td>OR<\/td>\n<td>SR<\/td>\n<td>ROR<\/td>\n<td>DR<\/td>\n<td>K<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">Yn of<br \/>Main<br \/>Unit<\/td>\n<td rowspan=\"3\">WX0<br \/>\u2223<br \/>WX240<\/td>\n<td rowspan=\"3\">WY0<br \/>\u2223<br \/>WY240<\/td>\n<td rowspan=\"3\">WM0<br \/>\u2223<br \/>WM1896<\/td>\n<td rowspan=\"3\">WS0<br \/>\u2223<br \/>WS984<\/td>\n<td rowspan=\"3\">T0<br \/>\u2223<br \/>T255<\/td>\n<td rowspan=\"3\">C0<br \/>\u2223<br \/>C255<\/td>\n<td rowspan=\"3\">R0<br \/>\u2223<br \/>R3839<\/td>\n<td rowspan=\"3\">R3904<br \/>\u2223<br \/>R3967<\/td>\n<td rowspan=\"3\">R3968<br \/>\u2223<br \/>R4167<\/td>\n<td rowspan=\"3\">R5000<br \/>\u2223<br \/>R8071<\/td>\n<td rowspan=\"3\">D0<br \/>\u2223<br \/>D4095<\/td>\n<td rowspan=\"3\">16\/32-bit<br \/>+\/- number<\/td>\n<\/tr>\n<tr>\n<td>Ope-<\/td>\n<\/tr>\n<tr>\n<td>rand<\/td>\n<\/tr>\n<tr>\n<td>MD<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>0\uff5e1<\/td>\n<\/tr>\n<tr>\n<td>Fr<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>8\uff5e2000<\/td>\n<\/tr>\n<tr>\n<td>PC<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>UY\uff0cCK<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>DY\uff0cDR<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>HO<\/td>\n<td><\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb*<\/td>\n<td>\u25cb*<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf When MD=0, this instruction performs the pulse output control as following:<\/p>\n<p>\u25cf Whenever the output control \u201cEN\u201d changes from 0\u21921, it first performs the reset action, which is to clear the output flag \u201cOUT\u201d and \u201cDN\u201d as well as the pulse out register HO to be 0. It gets the pulse frequency and output pulse count values, and reads status of up and down direction \u201cU\/D\u201d, so as to determine the direction to be upward or downward. As the reset finished, this instruction will check the input status of pause output \u201cPAU\u201d. No action will be taken if the pause output is 1 (output pause). If the PAU is 0, it will start to output the ON\/OFF pulse with 50% duty at the frequency Fr to the UY(U\/D=1) or DY(U\/D=0) point. It will increment the value of HO register each time when a pulse is output, and will stop the output when HO register\u2019s pulse count is equal to or greater than the cumulative pulse count of PC register and set the output complete flag \u201cDN\u201d to 1. During the time when output pulse is transmitting the output transmitting flag \u201cOUT\u201d will be set to 1, otherwise it will be 0.<\/p>\n<p>\u25cf Once it starts to transmit pulse, the output control \u201cEN\u201d should kept to 1. If it is changed to 0, it will stop the pulse sending (output point become OFF) and the flag \u201cOUT\u201d changes back to 0, but the other status or data will keep unchanged. However, when its \u201cEN\u201d changes again from 0 to 1, it will lead to a reset action and treat as a new start; the entire procedure will be restarted again.<\/p>\n<p>\u25cf If you want to pause the pulse output and not to restart the entire procedure, the \u2018pause output\u2019 \u201cPAU\u201d input can be used to pause it. When \u201cPAU\u201d =1, this instruction will pause the pulse transmitting (output point is OFF, flag \u201cOUT\u201d change back to 0 and the other status or data keeps unchanged). As it waits until the \u201cPAU\u201d changes back from 1 to 0, this instruction will return to the status before it is paused and continues the pulse transmitting output.<\/p>\n<p>\u25cf During the pulse transmission, this instruction will keep monitoring the value of pulse frequency Fr and output pulse count PC. Therefore, as long as the pulse output is not finished, it may allow the changing of the pulse frequency and pulse count. However, the up\/down direction \u201cU\/D\u201d status will be got only once when it takes the reset action (\u201cEN\u201d changes from 0\u21921), and will keep the status until the pulse output completed or another reset occur. That is to say, except that at the very moment of reset, the change of \u201cU\/D\u201d does not influence the operation of this instruction.<\/p>\n<p>\u25cf The main purpose of this instruction is to drive the stepping motor with the UY (upward) and DY (downward) two directional pulses control, so as to help you control the forward or reverse rotating of stepping motor. Nevertheless, if you need only single direction revolving, you can assign just one of the UY or DY (which will save one output point), and leaving the other output blank. In such case, the instruction will ignore the up\/down input status of \u201cU\/D\u201d, and the output pulse will send to the output point you assigned.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p078-1.png\" alt=\"FUN 81 D FUN 81 D PULSE OUTPUT PLSO PLSO\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When MD=1, the pulse output will reflect on the control output DIR (pulse direction. DIR=1, up; DIR=0, down) and CK (pulse output).<\/p>\n<p>\u25cf This instruction can only be used once, and UY (CK) and DY (DR) must be transistor output point on the PLC main unit.<\/p>\n<p>\u25cf The effective range of output pulse count PC for 16 bit operand is 0\uff5e32767. For the 32 bit operand( instruction), it is 0\uff5e2147483647. If the PC value = 0, it is treated as infinite pulse count, and this instruction will transmit pulses without end with HO value and \u201cDN\u201d flag set at 0 all the time. The effective range of pulse frequency (Fr) is 8\uff5e2000. If the value PC or Fr exceeds the range, this instruction will not be carried out and the error flag \u201cERR\u201d will set to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p078-2.png\" alt=\"\u25cf In this example, the program controls the stepping motor 81D.PLSO M0 X0 to drive forward for 80 pulses (steps) at the speed of MD : 0 EN OUT 100Hz first, and then makes it turn reverse for 40 pulses Fr : R 0 X1 M1 the speed of 50Hz. Make sure that the up\/down direction, PAU PC : R 1 DN frequency F\" width=\"587\" height=\"138\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p078-3.png\" alt=\"Turn forward Turn reverse 100Hz going 80 steps 50Hz going 40 steps Stop Reset Stop Reset Start (finished) enable re-start (finished) Output enable X0 Pause Pause X1 Forward Recerse X2 Direction 79 80 1 2 76 77 78 Y0 Up-pulse 2 1 40 Down-pulse Y1 M0 Under output M1 Output done Frequency R0 100 50 Pul\" width=\"620\" height=\"438\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p079-1.png\" alt=\"FUN 82 FUN 82 PULSE WIDTH MODULATION PWM PWM To : Pulse ON width (0~32767mS) Tp : Pulse period (1~32676mS) OT : Pulse output point Y WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range Yn WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 0 Ope- of main \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand unit WX240 WY240 WM\" width=\"654\" height=\"313\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1, will send the pulse to output point OT with the &#8220;ON&#8221; state for To ms and period as Tp. OT must be a transistor output point on the main unit. When &#8220;EN&#8221; is 0, the output point will be<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p079-2.png\" alt=\"To Tp\" width=\"250\" height=\"153\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>OFF.<\/p>\n<p>\u25cf The units for Tp and To are mS, resolution is 1 mS. The minimum value for To is 0 (under such case the output point OT will always be OFF), and its maximum value is the same as Tp (under such case the output point OT will always be on). If To &gt; Tp there will be an error, this instruction will not be carried out, and the error flag &#8220;ERR&#8221; will set to 1.<\/p>\n<p>\u25cf This instruction can only be used once.<\/p>\n<h4>FUN83 SPD SPEED DETECTION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p080-1.png\" alt=\"Ladder symbol S : Pulse input point for speed detection 83.SPD TI : Sampling duration S : Overflow Detection control EN OVF (units in mS) TI : D : Register storing results D : X WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range X0 WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 1 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223\" width=\"578\" height=\"237\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction uses the interrupt feature of the 8 high speed input points (X0~X7) on the PLC main unit to detect the frequency of the input signal. Within a specific sampling time (TI), it will calculate the input pulse count for S input point, and indirectly find the revolution speed of rotating devices (such as motors).<\/p>\n<p>\u25cf While use this instruction to detect the rotating speed of devices, The application should design to generate more pulse per revolution in order to get better result, but the sum of input frequency of all detected signals should under 5KHz, otherwise the WDT may occur.<\/p>\n<p>\u25cf The D register for storing results uses 3 successive 16-bit registers starting from D (D0~D2). Besides D0 which is used to store counting results, D1 and D2 are used to store current counting values and sampling duration.<\/p>\n<p>\u25cf When detection control &#8220;EN&#8221; = 1, it starts to calculate the pulse count for the S input point, which can be shown in D1 register. Meanwhile the sampling timer (D2) is switched on and keeps counting until the value of D2 is reach to the sampling period (TI). The final counted value is stored into the D0 register, and then a new counting cycle is started again. The sampling counting will go on repeating until &#8220;EN&#8221; = 0.<\/p>\n<p>\u25cf Because D0 only has 16 bits, so the maximum count is 32767. If the sampling period is too long or the input pulse is too fast then the counted value may exceed 32767, under that case the overflow flag will set to 1, and the counting action will stop.<\/p>\n<p>\u25cf Because the sampling period TI is already known and if every revolution of attached rotating device produces &#8220;n&#8221; pulses, then the following equation can be used to get the revolution<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p080-2.png\" alt=\"(D0)\u00d760 3 speed :N= \u00d710 (rpm) n\u00d7TI 83.SPD X20 X20 EN S : X 0 OVF TI : 1000 X0 D : R 0 1000 0 \u25cf In the above example, if every revolution of the rotating R2 1000mS 1000mS 1000mS device produces 20 pulses (n = 20), and the R0 value is 200, then the revolution per minute speed &quot;N&quot; is as R1a R1b R1c (20\" width=\"633\" height=\"261\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p081-1.png\" alt=\"FUN 84 TDSP\" width=\"80\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p081-2.png\" alt=\"FUN 84 TDSP\" width=\"76\" height=\"60\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>PATTERN CONVERSION FOR 16\/7-SEGMENT DISPLAY<\/p>\n<p>Ladder symbol<\/p>\n<p>Md : Mode selection<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p081-3.png\" alt=\"84.TDSP Md : Execution control EN S : N : Input control OFF S N : L D : Input control ON\" width=\"196\" height=\"144\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S : Starting address of begin converted characters Ns : Start of character<\/p>\n<p>Nl : Length of character<\/p>\n<p>D : Starting address to store the converted pattern S operand can be combined with V, Z, P0~P9 index registers for indirect addressing<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p081-4.png\" alt=\"HR OR ROR DR K XR Rang e R0 R3904 R5000 D0 V\u3001Z 16\/32 bit \u2223 \u2223 \u2223 \u2223 P0~P9 Operand R3839 R3967 R8071 D4095 Md 0~1 S \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Ns \u25cb \u25cb \u25cb \u25cb \u25cb Nl \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb \u25cb* \u25cb\" width=\"292\" height=\"142\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction is used for FBs-7SG1\/FBs-7SG2 module\u2019s application. It can convert the source alphanumeric characters into display patterns suited for 16 segment encoded mode display or perform the leading zero substitution of the packed BCD number for non-decoded mode 7 segment display.<\/p>\n<p>\u25cf When execution control \u201cEN\u201d =1, and input \u201cOFF\u201d = 0, input \u201cON\u201d=0, if Md=0, this instruction will perform the display pattern conversion, where S is the starting address storing the being converted characters, Ns is the pointer to locate the starting address character, NI tells the length of being converted characters, and D is the starting address to store the converted result.<\/p>\n<p>Byte 0 of S is the \u201c1st\u201d displaying character, byte 1 of S is the 2nd displaying character,\u2026\u2026..<\/p>\n<p>Ns is the pointer to tell where the start character is.<\/p>\n<p>After execution, each 8-bit character of the source will be converted into the corresponding 16-bit display pattern.<\/p>\n<p>\u25cf When input \u201cOFF\u201d = 1, all bits of display pattern will be \u2018off\u2019 if Md = 0, if Md=1, all BCD codes will be substituted by blank code (0F)<\/p>\n<p>\u25cf When input \u201cON\u201d = 1, all bits of display pattern will be \u2018on\u2019 if Md=0. If Md=1, all BCD codes will be substituted by code 8(all light).<\/p>\n<p>\u25cf Please refer Chapter 16 \u201cFBs-7SG display module\u201d for more detail description.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p082-1.png\" alt=\"FUN 86 FUN 86 PID TEMPERATURE CONTROL INSTRUCTION TPCTL TPCTL Md: Selection of PID method =0, Modified minimum overshoot method =1, Universal PID method Yn: Starting address of PID ON\/OFF output; it takes Zn points. Sn: Starting point of PID control of this instruction; Sn = 0\uff5e31. Zn: Number of the \" width=\"654\" height=\"582\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf By employing the temperature module and table editing method to get the current value of temperature and let it be as so called Process Variable (PV); after the calculation of software PID expression, it will respond the error with an output signal according to the setting of Set Point (SP),the error&#8217;s integral and the rate of change of the process variable. Through the closed loop operation, the steady state of the process may be expected.<\/p>\n<p>\u25cf Convert the output of PID calculation to be the time proportional on\/off (PWM) output, and via transistor output to control the SSR for heating or cooling process; this is a good performance and very low cost solution.<\/p>\n<p>\u25cf Through the analog output module (D\/A module), the output of PID calculation may control the SCR or proportional valve to get more precise process control.<\/p>\n<p>\u25cf Digitized PID expression is as follows:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p082-2.png\" alt=\"n Mn = [Kc\u00d7En]+ \u2211 [Kc\u00d7Ti\u00d7Ts\u00d7En]\u2212[Kc\u00d7Td\u00d7(PVn\u2212PVn-1)\/Ts] 0\" width=\"344\" height=\"45\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Where,<\/p>\n<p>Mn: Output at time \u201cn\u201d.<\/p>\n<p>Kc: Gain (Range: 1\uff5e9999\uff1bPb=100(%) \/ Kc)<\/p>\n<p>Ti: Integral tuning constant (Range:0\uff5e9999, equivalent to 0.00\uff5e99.99 Repeat\/Minute)<\/p>\n<p>Td: Derivative tuning constant (Range:0\uff5e9999, equivalent to 0.00\uff5e99.99 Minute)<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<h4>FUN86 TPCTL PID TEMPERATURE CONTROL INSTRUCTION<\/h4>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>PVn : Process variable at time \u201cn\u201d<\/p>\n<p>PVn_1: Process variable when loop was last solved<\/p>\n<p>En: Error at time \u201cn\u201d ; E= SP \u2013 PVn<\/p>\n<p>Ts: Solution interval for PID calculation (Valid value are 10, 20, 40, 80,160, 320; the unit is in 0.1Sec)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p083-1.png\" alt=\"PID Parameter Adjustment Guide\" width=\"246\" height=\"26\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf As the gain (Kc) adjustment getting larger, the larger the proportional contribution to the output. This can obtain a sensitive and rapid control reaction. However, when the gain is too large, it may cause oscillation. Do the best to adjust \u201cKc\u201d larger (but not to the extent of making oscillation), which could increase the process reaction and reduce the steady state error.<\/p>\n<p>\u25cf Integral item may be used to eliminate the steady state error. The larger the number (Ti, integral tuning constant), the larger the integral contribution to the output. When there is steady state error, adjust the \u201cTi\u201d larger to decrease the error.<\/p>\n<p>When the \u201cTi\u201d = 0, the integral item makes no contribution to the output.<\/p>\n<p>For exam. , if the reset time is 6 minutes, Ti=100\/6=17\uff1bif the integral time is 5 minutes, Ti=100\/5=20.<\/p>\n<p>\u25cf Derivative item may be used to make the process smoother and not too over shoot. The larger the number (Td, derivative tuning constant), the larger the derivative contribution to the output. When there is too over shoot, adjust the \u201cTd\u201d larger to decrease the amount of over shoot.<\/p>\n<p>When the \u201cTd\u201d = 0, the derivative item makes no contribution to the output.<\/p>\n<p>For exa, if the rate time is 1 minute, then the Td = 100; if the differential time is 2 minute, then the Td = 200.<\/p>\n<p>\u25cf Properly adjust the PID parameters can obtain an excellent result for temperature control.<\/p>\n<p>\u25cf The default solution interval for PID calculation is 4 seconds (Ts=40)<\/p>\n<p>\u25cf The default of gain value (Kc) is 110, where Pb=1000\/110\u00d70.1%\u22520.91%; the system full range is 1638\u00b0, it means 1638\u00d70.91\u225214.8\u00b0to enter proportional band control.<\/p>\n<p>\u25cf The default of integral tuning constant is 17, it means the reset time is 6 minutes (Ti=100\/6=17).<\/p>\n<p>\u25cf The default of derivative tuning constant is 50, it means the rate time is 0.5 minutes (Td=50).<\/p>\n<p>\u25cf When changing the PID solution interval, it may tune the parameters Kc, Ti, Td again.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p083-2.png\" alt=\"Instruction guide\" width=\"120\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf FUN86 will be enabled after reading all temperature channels.<\/p>\n<p>\u25cf When execution control \u201cEN\u201d = 1, it depends on the input status of H\/C for PID operation to make heating (H\/C=1) or cooling (H\/C=0) control. The current values of measured temperature are through the multiplexing temperature module ; the set points of desired temperature are stored in the registers starting from Sv. With the calculation of software PID expression, it will respond the error with an output signal according to the setting of set point, the error&#8217;s integral and the rate of change of the process variable. Convert the output of PID calculation to be the time proportional on\/off (PWM) output, and via transistor output to control the SSR for heating or cooling process; where there is a good performance and very low cost solution. It may also apply the output of PID calculation (stored in registers starting from OR), by way of D\/A analog output module, to control SCR or proportional valve, so as to get more precise process control.<\/p>\n<p>\u25cf When the setting of Sn, Zn (0 Sn 31 and 1 Zn 32, as well as 1 Sn + Zn 32) comes error, this instruction will not be executed and the instruction output \u201cERR\u201d will be ON.<\/p>\n<p>This instruction compares the current value with the set point to check whether the current temperature falls within deviation range (stored in register starting from Os). If it falls in the deviation range, it will set the in-zone bit of that point to be ON; if not, clear the in-zone bit of that point to be OFF, and make instruction output \u201cALM\u201d to be ON.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p084-1.png\" alt=\"FUN 86 FUN 86 PID TEMPERATURE CONTROL INSTRUCTION TPCTL TPCTL\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the mean time, this instruction will also check whether highest temperature warning (the register for the set point of highest temperature warning is R4008). When successively scanning for ten times the current values of measured temperature are all higher than or equal to the highest warning set point, the warning bit will set to be ON and instruction output \u201cALM\u201d will be on. This can avoid the safety problem aroused from temperature out of control, in case the SSR or heating circuit becomes short.<\/p>\n<p>\u25cf This instruction can also detect the unable to heat problem resulting from the SSR or heating circuit runs open, or the obsolete heating band. When output of temperature control turns to be large power (set in R4006 register) successively in a certain time (set in R4007 register), and can not make current temperature fall in desired range, the warning bit will set to be ON and instruction output \u201cALM\u201d will be ON.<\/p>\n<p>\u25cf WR: Starting of working register for this instruction. It takes 9 registers and can\u2019t be repeated in using. The content of the two registers WR+0 and WR+1 indicating that whether the current temperature falls within the deviation range (stored in registers starting from Os). If it falls in the deviation range, the in-zone bit of that point will be set ON; if not, the in-zone bit of that point will be cleared OFF.<\/p>\n<p>Bit definition of WR+0 explained as follows:<\/p>\n<p>Bit0=1, it represents that the temperature of the Sn+0 point is in-zone\u2026<\/p>\n<p>Bit15=1, it represents that the temperature of the Sn+15 point is in-zone.<\/p>\n<p>Bit definition of WR+1 explained as follows:<\/p>\n<p>Bit0=1, it represents that the temperature of the Sn+16 point is in-zone\u2026<\/p>\n<p>Bit15=1, it represents that the temperature of Sn+31 point is in-zone.<\/p>\n<p>The content of the two registers WR+2 and WR+3 are the warning bit registers, they indicate that whether there exists the highest temperature warning or heating circuit opened.<\/p>\n<p>Bit definition of WR+2 explained as follows:<\/p>\n<p>Bit0=1, it means that there exists the highest warning or heating circuit opened at the Sn+0 point&#8230; Bit15=1, it means that there exists the highest warning or heating circuit opened at the Sn+15 point. Bit definition of WR+11 explained as follows:<\/p>\n<p>Bit0=1, it means that there exists the highest warning or heating circuit opened at the Sn+16 point&#8230; Bit15=1 , it means that there exists the highest warning or heating circuit opened at the Sn+31 point. Registers of WR+4 \uff5e WR+8 are used by this instruction.<\/p>\n<p>\u25cf It needs separate instructions to perform the heating or cooling control.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p084-2.png\" alt=\"Specific registers related to FUN86\" width=\"229\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf R4005 : The content of Low Byte to define the solution interval between PID calculation<\/p>\n<p>=0, perform the PID calculation every 1 seconds.<\/p>\n<p>=1, perform the PID calculation every 2 seconds.<\/p>\n<p>=2, perform the PID calculation every 4 seconds. (System default)<\/p>\n<p>=3, perform the PID calculation every 8 seconds.<\/p>\n<p>=4, perform the PID calculation every 16 seconds.<\/p>\n<p>\u22655, perform the PID calculation every 32 second.<\/p>\n<p>: The content of High Byte to define the cycle time of PID ON\/OFF\uff08PWM\uff09output.<\/p>\n<p>=0\uff0cPWM cycle time is 1 seconds.<\/p>\n<p>=1\uff0cPWM cycle time is 2 seconds. (System default)<\/p>\n<p>=2\uff0cPWM cycle time is 4 seconds.<\/p>\n<p>=3\uff0cPWM cycle time is 8 seconds.<\/p>\n<p>=4\uff0cPWM cycle time is 16 seconds.<\/p>\n<p>\u22655\uff0cPWM cycle time is 32 second.<\/p>\n<p>Note 1: When changing the value of R4005, the execution control \u201cEN\u201d of FUN86 must be set at 0. The next time when execution control \u201cEN\u201d =1, it will base on the latest set point to perform the PID calculation.<\/p>\n<p>Note 2: The smaller the cycle time of PWM, the more even can it perform the heating. However, the error caused by the PLC scan time will also become greater. For the best control, it can base on the scan time of PLC to adjust the solution interval of PID calculation and the PWM cycle time.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p085-1.png\" alt=\"FUN 86 FUN 86 PID TEMPERATURE CONTROL INSTRUCTION TPCTL TPCTL\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf R4006: The setting point of large power output detection for SSR or heating circuit opened, or heating band obsolete. The unit is in % and the setting range falls in 80\uff5e100(%); system default is 90(%).<\/p>\n<p>\u25cf R4007: The setting time to detect the continuing duration of large power output while SSR or heating circuit opened, or heating band obsolete. The unit is in second and the setting range falls in 60\uff5e65535 (seconds); system default is 600 (seconds).<\/p>\n<p>\u25cf R4008: The setting point of highest temperature warning for SSR, or heating circuit short detection. The unit is in 0.1 degree and the setting range falls in 100\uff5e65535; system default is 3500 ( Unit in 0.1\u00b0).<\/p>\n<p>\u25cf R4012: Each bit of R4012 to tell the need of PID temperature control.<\/p>\n<p>Bit0=1 means that 1st point needs PID temperature control.<\/p>\n<p>Bit1=1 means that 2nd point needs PID temperature control.<\/p>\n<p>\u2027<\/p>\n<p>\u2027<\/p>\n<p>Bit15=1 means that 16th point needs PID temperature control.<\/p>\n<p>(The default of R4012 is FFFFH)<\/p>\n<p>\u25cf R4013: Each bit of R4013 to tell the need of PID temperature control.<\/p>\n<p>Bit0=1 means that 17th point needs PID temperature control.<\/p>\n<p>Bit1=1 means that 18th point needs PID temperature control.<\/p>\n<p>\u2027<\/p>\n<p>\u2027<\/p>\n<p>Bit15=1 means that 32th point needs PID temperature control.<\/p>\n<p>(The default of R4013 is FFFFH)<\/p>\n<p>\u25cf While execution control \u201cEN\u201d=1 and the corresponding bit of PID control of that point is ON (corresponding bit of R4012 or R4013 must be 1), the FUN86 instruction will perform the PID operation and respond to the calculation with the output signal.<\/p>\n<p>\u25cf While execution control \u201cEN\u201d=1 and the corresponding bit of PID control of that point is OFF (corresponding bit of R4012 or R4013 must be 0), the FUN86 will not perform the PID operation and the output of that point will be OFF.<\/p>\n<p>\u25cf The ladder program may control the corresponding bit of R4012 and R4013 to tell the FUN86 to perform or not to perform the PID control, and it needs only one FUN86 instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p086-1.png\" alt=\"FUN87 T.01S FUN87 T.01S FUN88 T.1S FUN88 T.1S ACCUMULATIVE TIMER FUN89 T1S FUN89 T1S CV : Register storing elapse time (current value) PV : Preset value of timer WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 0 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand W\" width=\"579\" height=\"310\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The operation for this instruction is the same as that for the basic timer (T0~T255), except that the basic timer only has a &#8220;timing control&#8221; input &#8211; when its input is 1 it starts timing, and when input is 0 it get clear. Every time the input changes, it starts timing again and is unable to accumulate. Timing with this instruction is only permissible when enable control &#8220;EN&#8221; = 1. With this instruction, when timing control &#8220;TIM&#8221; is 1, it is the same as a basic timer, but when &#8220;TIM&#8221; is 0, it does not clear, but keeps the current value. If the timer need to clear, then change enable control &#8220;EN&#8221; to 0. When timing control &#8220;TIM&#8221; is once again to be 1, it will continue to accumulate from the previous value when the timer last paused. In addition, this instruction also has two outputs, &#8220;Time up TUP&#8221; (when time up it is 1, usually it is 0) and &#8220;Time not up&#8221; (usually it is 1, when time is up it is 0). Users can utilize input and output combinations to produce timers with various different functions. For example:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p086-2.png\" alt=\"\u25cf On delay energizing timer: 89.T1S Y0 X0 R 0 TUP TIM CV : PV : 10 EN NUP\" width=\"285\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This timer&#8217;s output (Y0 in this example) is normally not energized. When this timer&#8217;s input control (X0 in this example) is activated (ON), only after delay by 10 sec will output Y0 become energized (ON).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p086-3.png\" alt=\"\u25cf On delay de-energizing timer: 89.T1S X0 CV : R 0 TUP TIM Y0 10 PV : EN NUP\" width=\"285\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The output Y0 of this timer is usually energized. When this timer&#8217;s input control X0 is on, only after delay by 10 sec will the output become de-energized (OFF).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p087-1.png\" alt=\"FUN87 T.01S FUN88 T.1S FUN89 T1S\" width=\"170\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN87 T.01S<\/p>\n<p>FUN88 T.1S<\/p>\n<p>ACCUMULATIVE TIMER<\/p>\n<p>FUN89 T1S<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p087-2.png\" alt=\"\u25cf Off delay energizing timer: 89.T1S Y0 X0 TIM CV : R 0 TUP PV : 10 EN NUP\" width=\"273\" height=\"116\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This timer&#8217;s output Y0 is usually<\/p>\n<p>de-energized. When this timer&#8217;s input control X0 is off, only after delay by 10 sec will output Y0 become energized (ON).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p087-3.png\" alt=\"\u25cf Off delay de-energizing timer: 89.T1S X0 TIM CV : R 0 TUP Y0 PV : 10 EN NUP\" width=\"273\" height=\"107\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This timer&#8217;s output Y0 is usually energized. When this timer&#8217;s timing control X0 is off, only after delay by 10 sec will output Y0 become de-energized (OFF).<\/p>\n<p>\u25cf The diagram below shows the relation on input and output for the above 4 kinds of timers.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p087-4.png\" alt=\"&quot;OFF&quot; (X0 released) &quot;ON&quot; (X0 pressed down) ON OFF OFF X0 10S ON OFF OFF ON delay energizing 10S ON ON ON delay de-energizing OFF 10S ON ON OFF delay energizing OFF ON 10S OFF OFF OFF delay de-enrgizing\" width=\"475\" height=\"302\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN90 P WDT WATCHDOG TIMER<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p088-2.png\" alt=\"N : The watchdog time. The range of N is 5~120, unit in 10mS (i.e. 50ms~1.2 sec)\" width=\"655\" height=\"110\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1 or transition from 0 to 1( P instruction), will set the watchdog time to Nx10ms. If the scan time exceeds this preset time, PLC will shut down and not execute the application program.<\/p>\n<p>\u25cf The WDT feature is designed mainly as a safety consideration from the system view for the application. For example, if the CPU of PLC is suddenly damaged, and there is no way to execute the program or refresh I\/O, then after the WDT time expired, the WDT will automatically switch off all the I\/Os, so as to ensure safety. In certain applications, if the scan time is too long, it may cause safety problems or problems of non-conformance with control requirements. This instruction can used to establish the limitation of the scan time that you require.<\/p>\n<p>\u25cf Once the WDT time has been set it will always be kept, and there is no need to set it again on each scan. Therefore, in practice this instruction should use the P instruction.<\/p>\n<p>\u25cf Default WDT time is 0.25 sec.<\/p>\n<p>\u25cf For the operation principles of WDT please refer to the RSWDT(FUN 91) instruction.<\/p>\n<h4>FUN91 P RSWDT RESET WATCHDOG TIMER<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p089-2.png\" alt=\"This instruction has no operand.\" width=\"652\" height=\"108\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), the WDT timer will be reset (i.e. WDT will start timing again from 0).<\/p>\n<p>\u25cf The functions of WDT have already been described in FUN90 (WDT instruction).<\/p>\n<p>The operation principles of watch dog timer are as follows:<\/p>\n<p>The watchdog timer is normally implemented by a hardware one-shot timer (it can not be software, otherwise if CPU fail, the timer becomes ineffective, and safeguards are quite impossible). &#8220;One-shot&#8221; means that after triggered the timer once, the timing value will immediately be reset to 0 and timing will restart. If WDT has begun timing, and never triggered it again, then the WDT timing value will continue accumulating until it reach the preset value of N, at that time WDT will be activated, and PLC will be shut down. If trigger the WDT once every time before the WDT time N has been reached, then WDT will never be activated. PLC can use this feature to ensure the safety of the system. Each time when PLC enters into system housekeeping after finished the program scanning and I\/O refresh, it will usually trigger WDT once, so if the system functions normally and scan time does not exceed WDT time then WDT is never activated. However, if CPU is damaged and unable to trigger WDT, or the scan time is too long, then there will not be enough time to trigger WDT within the period N, WDT will be activated and will shut off PLC.<\/p>\n<p>\u25cf In some applications, when you set the WDT time (FUN90) to desire, the scan time of your program in certain situations may temporarily exceed the preset time of WDT. This situation can be anticipated and allowed for, and you naturally do not wish PLC to shut down for this reason. You can use this instruction to trigger WDT once and avoid the activation of WDT. This is the main purpose of this instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p090-1.png\" alt=\"FUN 92 D P HSCTR\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN 92 D P<\/p>\n<p>HARDWARE HIGH SPEED COUNTER CURRENT VALUE (CV) ACCESS<\/p>\n<p>HSCTR<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p090-2.png\" alt=\"CN : Hardware high speed counter number 0: HSC0 or HST0 1: HSC1 or HST1 2: HSC2 or HST2 3: HSC3 or HST3 4: HSTA\" width=\"655\" height=\"120\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The HSC0\uff5eHSC3 counters of FBs-PLC are 4 sets of 32bit high speed counter with the variety counting modes such as up\/down pulse, pulse-direction, AB-phase. All the 4 high speed counters are built in the ASIC hardware and could perform count, compare, and send interrupt independently without the intervention of the CPU. In contrast to the software high speed counters HSC4\uff5eHSC7, which employ interrupt method to request for CPU processing, hence if there are many counting signals or the counting frequency is high, the PLC performance (scanning speed) will be degraded dramatically. Since the current values CV of HSC0\uff5eHSC3 are built in the internal hardware circuits of ASIC, the user control program (ladder diagram) cannot retrieve them directly from ASIC. Therefore, it must employ this instruction to get the CV value from hardware HSC and put it into the register which control program can access. The following is the arrangement of CV, PV in ASIC and their corresponding CV, PV registers of PLC for HSC0~HSC3.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p090-3.png\" alt=\"PLC register ASIC DR4096 CV CV register H L HSC0 DR4098 PV HSC0 PV register H L DR4100 CV CV register H L HSC1 DR4102 PV HSC1 PV register H L DR4104 CV CV register H L HSC2 DR4106 PV HSC2 PV register H L DR4108 CV CV register H L HSC3 DR4110 PV HSC3 PV register H L DR4152 CV CV register H L HSTA R41\" width=\"441\" height=\"354\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When access control \u201cEN\u201d =1 or changes from 0\u21921( P instruction), will gets the CV value of HSC designated by CN from ASIC and puts into the HSC corresponding CV register (i.e. the CV of HSC0 will be read and put into DR4096 or the CV of HSC1 will be read and put into DR4100).<\/p>\n<p>\u25cf Although the PV within ASIC has a corresponding PV register in CPU, but it is not necessary to access it (actually it can\u2019t be) for that the PV value within ASIC comes from the PV register in CPU.<\/p>\n<p>\u25cf HSTA is a timer, which use 0.1ms as its time base. The content of CV represents elapse time counting at 0.1mS tick.<\/p>\n<p>\u25cf For detailed applications, please refer to Chapter 10 \u201cThe high speed counter and high speed timer of FBs-PLC\u201d.<\/p>\n<p>FUN 93 D P HARDWARE HIGH SPEED COUNTER CURRENT VALUE AND PRESET FUN 93 D P HSCTW<\/p>\n<p>VALUE WRITING<\/p>\n<p>HSCTW<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p091-1.png\" alt=\"S : The source data for writing CN : Hardware high speed counter to be written 0: HSC0 or HST1 1: HSC1 or HST2 2: HSC2 or HST3 3: HSC3 or HST4 4: HSTA D : Write target (0 represents CV, 1 represents PV)\" width=\"655\" height=\"178\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Please refer first to FUN92 for the relation between the CV or PV value of HSC0\uff5eHSC3 and HSTA within ASIC and their corresponding CV and PV registers in CPU.<\/p>\n<p>\u25cf When write control \u201cEN\u201d=1 or changes from 0\u21921 ( P instruction), it writes the content of CV or PV register of high speed counter designed by CN of CPU, to the corresponding CV or PV of HSC within ASIC.<\/p>\n<p>\u25cf It is quit often to set the PV value for most application program, When the count value reaches the preset value, the counter will send out interrupt signal immediately. By way of the interrupt service program, you can implement different kinds of precision counting or positioning control.<\/p>\n<p>\u25cf When there is an interrupt of power supply for FBs-PLC, the values of current value registers CV of HSC0\uff5eHSC3 within ASIC will be read out and wrote into the HSC0\uff5eHSC3 CV registers (with power retentive function) of CPU automatically. When power comes up, these CV values will be restored to ASIC. However, if your application demands that when power is on, the values should be cleared to 0 or begin counting from a certain value, then you have to use this instruction to write in the CV value for HSC in ASIC.<\/p>\n<p>\u25cf When write a non-zero value into the PV register of HSTA will cause the HSTAI interrupt subroutine to be executed for every PV\u00d70.1ms.<\/p>\n<p>\u25cf For detailed applications, please refer Chapter 10 \u201cThe high speed counter and high speed timer of FBs-PLC\u201d.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p091-2.png\" alt=\"\u25cf As the program in the left diagram, when M0 changes from 0\u21921, it clears the current value of HSC0 to 0, 93D.HSCTW M0 and writes into ASIC hardware through FUN93. S : 0 EN HSC0 CN : D : CV \u25cf When M0 is 0, it reads out the current counting value. M0 92 EN HSCTR HSC0 \u25cf When M1 changes from 0\u21921, it mo\" width=\"631\" height=\"244\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN94 P ASCWR ASCII WRITE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p092-1.png\" alt=\"MD: Output mode =0, output to communication port1. others, reserved for future usage. S : Starting register of file data. Pt : Starting working register for this instruction instance. It taken up 8 registers and can\u2019t be reused in other part of program. WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range\" width=\"616\" height=\"282\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When MD=0 and output control \u201cENU\u201d changes from 0\u21921, it transmits the ASCII data which starting from S to the communication port 1 (Port1), until reach end of file.<\/p>\n<p>\u25cf S file data can be edited with the programming software PROLADDER or WinProladder (please refer to the explanation of Chapter 14 \u201cASCII function application\u201d.). If necessary the user can also edit the ASCII file directly by change the value of data registers. However, the edited data must be follow the ASCII file format (the details described in chapter 14), otherwise, this instruction will halt the transmission and set the error flag \u201cERR\u201d to 1. If the entire file is correctly and successfully transmitted, then the output is completed and \u201cDN\u201d is set to 1.<\/p>\n<p>\u25cf The control input of this instruction is of positive edge triggered. Once \u201cENU\u201d changes from 0\u21921 then this instruction starts the execution, until finished the transmission of the entire file then the execution is completed. During the transmission, the action flag \u201cACT\u201d will be kept at 1 all the time. Only when output pause, error, or abort occurs, will it change back to 0.<\/p>\n<p>\u25cf This instruction can be repeatedly used, but only one will be executed (transmit data) at any certain time. It is the obligation of user to make sure the right execution sequence.<\/p>\n<p>\u25cf While this instruction is in execution, if the pause \u201cPAU\u201d is 1, this instruction will pause the transmission of file data. It will resume transmission when the pause \u201cPAU\u201d backs to 0.<\/p>\n<p>\u25cf While this instruction is in execution, if the abort \u201cABT\u201d is 1, this instruction will abandon the transmission of file data, and then it is able to take next instruction for execution.<\/p>\n<p>\u25cf or detail applications, please refer to Chapter 14 \u201cThe Application of ASCII file output function\u201d.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p093-1.png\" alt=\"FUN 94 FUN 94 ASCII WRITE ASCWR ASCWR\" width=\"652\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Interface signals:<\/p>\n<p>M1927: This signal is control by CPU, it is applied in ASCWR MD:0<\/p>\n<p>: ON, it represents that the RTS (connect to the CTS of PLC) of the printer is \u201cFalse\u201d. I.e. the printer is not ready or abnormal.<\/p>\n<p>: OFF, it represents that the RTS of the Printer is \u201cTrue\u201d; Printer is Ready.<\/p>\n<p>Note: Using the M1927 associates with timer can detect if the printer is abnormal or not.<\/p>\n<h4>FUN95 P RAMP RAMP FUNCTION FOR D\/A OUTPUT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p094-2.png\" alt=\"\" width=\"247\" height=\"186\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>PV : Preset value of ramp timer (the unit is 0.01 second) or the increment value of every 0.01 second SL : Lower limit value<\/p>\n<p>(ramp floor value).<\/p>\n<p>SU : Upper limit value<\/p>\n<p>(ramp ceiling value).<\/p>\n<p>D : Register storing current ramping value.<\/p>\n<p>D+1 : Working register<\/p>\n<p>SU, SL could be positive or negative value when incorporate with AO module application.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td rowspan=\"2\">Range<\/td>\n<td>WX<\/td>\n<td>WY<\/td>\n<td>WM<\/td>\n<td>WS<\/td>\n<td>TMR<\/td>\n<td>CTR<\/td>\n<td>HR<\/td>\n<td>IR<\/td>\n<td>OR<\/td>\n<td>SR<\/td>\n<td>ROR<\/td>\n<td>DR<\/td>\n<td>K<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">WX0<br \/>\u2223<br \/>WX240<\/td>\n<td rowspan=\"3\">WY0<br \/>\u2223<br \/>WY240<\/td>\n<td rowspan=\"3\">WM0<br \/>\u2223<br \/>WM1896<\/td>\n<td rowspan=\"3\">WS0<br \/>\u2223<br \/>WS984<\/td>\n<td rowspan=\"3\">T0<br \/>\u2223<br \/>T255<\/td>\n<td rowspan=\"3\">C0<br \/>\u2223<br \/>C255<\/td>\n<td rowspan=\"3\">R0<br \/>\u2223<br \/>R3839<\/td>\n<td rowspan=\"3\">R3840<br \/>\u2223<br \/>R3903<\/td>\n<td rowspan=\"3\">R3904<br \/>\u2223<br \/>R3967<\/td>\n<td rowspan=\"3\">R3968<br \/>\u2223<br \/>R4167<\/td>\n<td rowspan=\"3\">R5000<br \/>\u2223<br \/>R8071<\/td>\n<td rowspan=\"3\">D0<br \/>\u2223<br \/>D4095<\/td>\n<td rowspan=\"3\">16-bit<br \/>+\/- number<\/td>\n<\/tr>\n<tr>\n<td>Ope-<\/td>\n<\/tr>\n<tr>\n<td>rand<\/td>\n<\/tr>\n<tr>\n<td>Tn<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>PV<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>SL<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>SU<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<td>\u25cb<\/td>\n<td>\u25cb<\/td>\n<td>\u25cb*<\/td>\n<td>\u25cb<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p094-3.png\" alt=\"Description\" width=\"77\" height=\"27\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Tn must be a 0.01 sec time base timer and never used in other part of program.<\/p>\n<p>\u25cf PV is the preset value of ramp timer. Its unit is 10ms (0.01 second).<\/p>\n<p>\u25cf When input control \u201cENU\u201d changes from 0\u21921, it first reset the timer Tn to 0.<\/p>\n<p>When \u201cU\/D\u201d=1 it will load the value of SL to register D. And when M1974 = 0 it will be increased by SU\u2212SL \/ PV every 0.01 sec or when M1974 = 1 it will increase by PV every 0.01 sec. When the D value reaches the SU value the output \u201cASU\u201d =1.<\/p>\n<p>When \u201cU\/D\u201d=0 it will load the value of SU to register D. When M1974 = 0 it will be decreased by SU\u2212SL \/ PV every 0.01 sec or when M1974 = 1 it will be decreased by PV every 0.01 sec. When the D value reaches the SL value the output \u201cASL\u201d =1.<\/p>\n<p>\u25cf The ramping direction(U\/D) is determined at the time when input control \u201cENU\u201d changes from 0\u21921. After the output D start to ramp, the change of U\/D is no effect.<\/p>\n<p>\u25cf If it is required to pause the ramping action, it must let the input control \u201cPAU\u201d = 1; when \u201cPAU\u201d=0, and the ramping action is not completed, it will continue to complete the ramping action.<\/p>\n<p>\u25cf The value of SU must be larger than SL, otherwise the ramp function will not be performed, and the output \u201cERR\u201d will set to 1.<\/p>\n<p>\u25cf This instruction use the register D to store the output ramping value; if the application use the D\/A module to send the speed command, then speed command can be derived from the RAMP function to get a more smooth movement.<\/p>\n<p>\u25cf In addition to use register D to store the ramping value, this instruction also used the register D+1 to act as internal working register; therefore the other part of program can not use the register D+1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p095-1.png\" alt=\"FUN 95 P FUN 95 P RAMP FUNCTION FOR D\/A OUTPUT RAMP RAMP Program example\" width=\"652\" height=\"96\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p095-2.png\" alt=\"95.RAMP M100 M0 EN Tn : T20 ERR Move the ramping value to AO output register PV : R100 R3904 M101 M1 ASL PAU SL : R101 SU : R102 M102 M2 U\/D D : R103 ASU 8.MOV M0 EN S : R103 D : R3904\" width=\"561\" height=\"182\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>T20: Ramp timer (timer with 0.01 second time base)<\/p>\n<p>R100: preset value of ramp timer (the unit is 0.01 second, 100 for a second).<\/p>\n<p>R101: Lower limit value.<\/p>\n<p>R102: Upper limit value.<\/p>\n<p>R103: Register storing current ramp value.<\/p>\n<p>R104: Working register<\/p>\n<p>\u25cf If M1974=0, When input control M0 changes from 0\u21921, it first reset the timer T20 to 0. If M2=1, it will load the R101 (lower limit) value into the R103, and it will increase the output with fixed value (R102-R101 \/ R100) for every 0.01 second and stores it to register R103. When the T2 timer going up to the preset value R100, the output value equals to R102, and the output M102 will set to 1. If M2=0, will load the R102 (upper limit) value into the R103, and it will decrease the output amount with fixed ratio (R102-R101 \/ R100) for every 0.01 second and store it to register R103. The T2 timer going up to the preset value R100, the output value equals to R102, and the output M101 will set to 1.<\/p>\n<p>\u25cf M1=1, pause the ramping action.<\/p>\n<p>\u25cf The value of R102 must be greater than R101, otherwise the ramp action will not be performed, and the output M100 will set to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p095-3.png\" alt=\"SU SL t PV PV\" width=\"429\" height=\"254\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN98 RAMP2 TRACKING TYPE RAMP FUNCTION FOR D\/A OUTPUT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p096-1.png\" alt=\"98.RAMP2 Om\uff1aMaximum output; range from 0~65535 Execution EN Om : ACC Ta \uff1aThe acceleration time for the output from 0 up to maximum; Ta : Range from 0~65000, unit is in mS Td : DEC Td \uff1aThe deceleration time for the output from Rt : maximum down to 0; Rc : Range from 0~65000, unit is in mS Rt \uff1aRegiste\" width=\"640\" height=\"220\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>WR\uff1aStarting address of working registers, it needs 4 registers<\/p>\n<p>\uff0aThis instruction can be supported in PLC OS firmware V4.60 or late<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p096-2.png\" alt=\"HR OR ROR DR K Operand Range R0 R3904 R5000 D0 \u2223 \u2223 \u2223 \u2223 16bit R3839 R3967 R8071 D3999 Om \u25cb \u25cb \u25cb \u25cb 0~65535 Ta \u25cb \u25cb \u25cb \u25cb 0~65000 Td \u25cb \u25cb \u25cb \u25cb 0~65000 Rt \u25cb \u25cb \u25cb \u25cb Rc \u25cb \u25cb \u25cb \u25cb WR \u25cb \u25cb \u25cb* \u25cb\" width=\"218\" height=\"160\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution \u301dEN\u301e=0, current output value (Rc) will be 0 immediately; the output indicators ACC=0 and DEC=0.<\/p>\n<p>\u25cf When execution \u301dEN\u301e=1, this instruction being executed; it will output current value (Rc) first, and then compare the target output value (Rt) with current output value (Rc) every scan; if the target output value is greater than current output value, the current output will be increased according to the rate, which is decided by the settings of acceleration time (Ta) and maximum output (Om), till current output value is equal to the target output value (ACC=1 during this time); if the target output value is less than current output value, the current output will be decreased according to the rate, which is decided by the settings of deceleration time (Td) and maximum output (Om), till current output value is equal to the target output value (DEC=1 during this time).<\/p>\n<p>\u25cf If the setting value of target output (Rt) is greater than maximum output(Om), the output value will be clamped by the maximum value.<\/p>\n<p>\u25cf It can have smooth activity for acceleration and deceleration control via the execution of this instruction by using current output value (Rc) for analog output (R39044~R3967).<\/p>\n<p>\u25cf The setting value of target output (Rt) needs to stay two scan times at least for proper operation.<\/p>\n<p>\u25cf It needs 4 registers for working, they can not be repeated in use\u3002<\/p>\n<p>\u25cf This instruction is for positive value operation, but it also can have negative output by short and easy application program for help. Please see example 2.<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<h4>FUN98 RAMP2 TRACKING TYPE RAMP FUNCTION FOR D\/A OUTPUT<\/h4>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>Example 1\uff1aPositive output for ACC\/DEC control<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p097-1.png\" alt=\"\" width=\"614\" height=\"184\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D10 \uff1aSetting of maximum output, it is 16383<\/p>\n<p>D0 \uff1aThe acceleration time for the output from 0 up to maximum, it is 30000mS<\/p>\n<p>D1 \uff1aThe deceleration time for the output from maximum down to 0, it is 20000mS<\/p>\n<p>D100\uff1aSetting of target output value, it is 8192<\/p>\n<p>R3904\uff1aRegister of current output, it is used for analog output<\/p>\n<p>D1000~D1003\uff1aWorking registers<\/p>\n<p>Description: When M0=0, current output value is 0 immediately (No ramp).<\/p>\n<p>When M0=1, it will output the value of R3904 first; and then compare the target output value (D100) with current output value (R3904) every scan; if D100\uff1eR3904, the current output value of R3904 will be increased according to the rate of 16383\/30000 (Om=16383, Ta=30000), till R3904=D100 (ACC=1 during this time); if D100\uff1cR3904, the current output value of R3904 will be decreased according to the rate of 16383\/20000 (Om=16383, Td=20000), till R3904=D100 (DEC=1 during this time).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p097-2.png\" alt=\"Om Rt Rt Rt Rc Rt t Ta Td\" width=\"611\" height=\"316\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<h4>FUN98 RAMP2 TRACKING TYPE RAMP FUNCTION FOR D\/A OUTPUT<\/h4>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>Example 2\uff1aBoth positive and negative output for ACC\/DEC control<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p098-1.png\" alt=\"D10 \uff1aSetting of maximum output, it is 8191\" width=\"611\" height=\"578\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D0 \uff1aThe acceleration time for the output from 0 up to maximum, it is 20000mS<\/p>\n<p>D1 \uff1aThe deceleration time for the output from maximum down to 0, it is 10000mS<\/p>\n<p>D100\uff1aSetting of target output value, it is 0<\/p>\n<p>D200\uff1aRegister of current output, it is used for analog output<\/p>\n<p>D1000~D1003\uff1aWorking registers<\/p>\n<p>Description: When M0=0, current output value is 0 immediately (No ramp).<\/p>\n<p>When M0=1, it will output the value of D200 first; and then compare the target output value (D100) with current output value (D200) every scan; if D100\uff1eD200, the current output value of D200 will be increased according to the rate of 8191\/20000 (Om=8191, Ta=20000), till D200=D100 (ACC=1 during this time); if D100\uff1cD200, the current output value of D200 will be decreased according to the rate of 8191\/10000 (Om=8191, Td=10000), till D200=D100 (DEC=1 during this time).<\/p>\n<p>M100=1, positive output control; M101=1, negative output control.<\/p>\n<p>The target output (D100) is always positive value from 0~65535.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p099-1.png\" alt=\"FUN98 FUN98 TRACKING TYPE RAMP FUNCTION FOR D\/A OUTPUT RAMP2 RAMP2 Om Rt Rt Rt Rt Rc t Ta Td Rc -Om\" width=\"654\" height=\"643\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>Table Instructions<\/h4>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>Fun No.<\/td>\n<td>Mnemonic<\/td>\n<td>Functionality<\/td>\n<td>Fun No.<\/td>\n<td>Mnemonic<\/td>\n<td>Functionality<\/td>\n<\/tr>\n<tr>\n<td>100<\/td>\n<td>R\u2192T<\/td>\n<td>Register to table data move<\/td>\n<td>107<\/td>\n<td>T_FIL<\/td>\n<td>Table fill<\/td>\n<\/tr>\n<tr>\n<td>101<\/td>\n<td>T\u2192R<\/td>\n<td>Table to register data move<\/td>\n<td>108<\/td>\n<td>T_SHF<\/td>\n<td>Table shift<\/td>\n<\/tr>\n<tr>\n<td>102<\/td>\n<td>T\u2192T<\/td>\n<td>Table to table data move<\/td>\n<td>109<\/td>\n<td>T_ROT<\/td>\n<td>Table rotate<\/td>\n<\/tr>\n<tr>\n<td>103<\/td>\n<td>BT_M<\/td>\n<td>Block table move<\/td>\n<td>110<\/td>\n<td>QUEUE<\/td>\n<td>Queue<\/td>\n<\/tr>\n<tr>\n<td>104<\/td>\n<td>T_SWP<\/td>\n<td>Block table swap<\/td>\n<td>111<\/td>\n<td>STACK<\/td>\n<td>Stack<\/td>\n<\/tr>\n<tr>\n<td>105<\/td>\n<td>R-T_S<\/td>\n<td>Register to table search<\/td>\n<td>112<\/td>\n<td>BKCMP<\/td>\n<td>Block compare<\/td>\n<\/tr>\n<tr>\n<td>106<\/td>\n<td>T-T_C<\/td>\n<td>Table to table compare<\/td>\n<td>113<\/td>\n<td>SORT<\/td>\n<td>Data Sort<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf A table consists of 2 or more consecutive registers (16 or 32 bits). The number of registers that comprise the table is called the table length (L). The operation object of the table instructions always takes the register as unit (i.e. 16 or 32 bit data).<\/p>\n<p>\u25cf The operation of table instructions are used mostly for data processing such as move, copy, compare, search etc, between tables and registers, or between tables. These instructions are convenient for application.<\/p>\n<p>\u25cf Among the table instructions, most instructions use a pointer to specify which register within a table will be the target of operation. The pointer for both 16 and 32-bit table instructions will always be a 16-bit register. The effective range of the pointer is 0 to L-1, which corresponds to registers T0 to TL-1 (a total of L registers). The table shown below is a schematic diagram for 16-bit and 32-bit tables.<\/p>\n<p>\u25cf Among the table operations, shift left\/right, rotate left\/right operations include a movement direction. The direction toward the higher register is called left, while the direction toward the lower register is called right, as shown in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p100-1.png\" alt=\"Pointer Pr \u2500\u2500\u2510 4 \u2502 B15 B0 \u2502 \u2502 T (right) \u2502 B15 B0 (right)\u2502 \ufe37 T0 R0 \u2502 T1 R1 \u2502 \u2502 T2 R2 \u2502 T3 R3 \u2190\u2500\u2518 T4 R4 \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e (left) TL\u22121 RL-1\" width=\"140\" height=\"264\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p100-2.png\" alt=\"Pointer Pr \u2500\u2500\u2510 2 \u2502 B15 B0 \u2502 \u2502 T \u2502 B31 B0 (right)\u2502 \ufe37 T0 R1 R0 \u2502 T1 R3 R2 \u2502 \u2502 T2 R5 R4 \u2502 T3 R7 R6 \u2190\u2500\u2518 T4 R9 R8 \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e \uff0e TL\u22121 R 2L\u22121 R 2L\u22122 (left)\" width=\"192\" height=\"262\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Table length<\/p>\n<p>Table length<\/p>\n<p>16bit table<\/p>\n<p>32bit table<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p101-1.png\" alt=\"FUN100 D P FUN100 D P REGISTER TO TABLE MOVE R\u2192T R\u2192T Rs : Source data , can be constant or register Ladder symbol 100DP.R T Td : Source register for destination table EN RS : Move control END Move to end L : Length of destination table Td : Pr : Pointer register Pointer increment INC L : ERR Pointer\" width=\"646\" height=\"346\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or transition from 0 to 1( P instruction), the contents of the source register Rs will be written onto the register Tdpr indicated by the pointer Pr within the destination table Td (length is L). Before executing, this instruction will first check the pointer clear &#8220;CLR&#8221; input signal. If &#8220;CLR&#8221; is 1, it will first clear the pointer Pr, and then carry out the move operation. After the move has been completed, it will then check the Pr value. If the Pr value has already reached L-1 (point to the last register in the table) then it will only set the move-to-end flag &#8220;END&#8221; to 1, and finish execution of this instruction. If the Pr value is less than L-1, then it must again check the pointer increment &#8220;INC&#8221; input signal. If &#8220;INC&#8221; is 1, then Pr value will be also increased. Besides, pointer clear &#8220;CLR&#8221; is able to operate independently, without being influenced by other input.<\/p>\n<p>\u25cf The effective range of the pointer is 0 to L-1. Beyond this range, the pointer error &#8220;ERR&#8221; will be set to 1, and this instruction will not be performed.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p101-2.png\" alt=\"100P.R T X1 EN RS : R 0 END Td : R 10 INC L : 8 ERR Pr : R 50 CLR\" width=\"179\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The example at left at the very beginning pointer Pr = 4, the entire content of table Td is 0, and the Rs value is<\/p>\n<p>8888. The diagram below shows the operation results when X1 have the transition of 0\u21921 twice.<\/p>\n<p>\u25cf Because INC is 1, Pr will increase by 1 each time the instruction is executed.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p101-3.png\" alt=\"Pr Pr Pr 4 R50 5 R50 6 R50 Td Td Td 0 0 0 0 R10(T0) 0 0 0 0 R10 0 0 0 0 R10 0 0 0 0 R11(T1) 0 0 0 0 R11 0 0 0 0 R11 Rs 0 0 0 0 R12(T2) X0\uff1d\u21b1 0 0 0 0 R12 0 0 0 0 R12 X0\uff1d\u21b1 8 8 8 8 0 0 0 0 R13(T3) (First) 0 0 0 0 R13 (Second) 0 0 0 0 R13 R0 0 0 0 0 R14(T4) \u25cf 8 8 8 8 R14 \u25cf 8 8 8 8 R14 0 0 0 0 R15(T5) 0 0\" width=\"542\" height=\"201\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p102-1.png\" alt=\"FUN101 D P FUN101 D P TABLE TO REGISTER MOVE T\u2192R T\u2192R Ladder symbol Ts : Source table starting register 101DP.T R L : Length of source table Move control EN TS : END Move to end Pr : Pointer register L : Rd : Destination register Pointer increment INC Pr : ERR Pointer error Ts, Rd may combine with V,\" width=\"644\" height=\"334\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or transition from 0 to 1 ( P instruction), the value of the register Tspr specified by pointer Pr within source table Ts (length is L) will be written into the destination register Rd. Before executing, this instruction will first check the input signal of pointer clear &#8220;CLR&#8221;. If &#8220;CLR&#8221; is 1, it will first clear Pr and then carry out the move operation. After completing the move operation, it will then check the value of Pr. If the Pr value has already reached L-1 (point to the last register in the table), then it sets the move-to-end flag to 1, and finishes executing of this instruction. If Pr is less than L-1, it check the status of &#8220;INC&#8221;. If &#8220;INC&#8221; is 1, then it will increase Pr and finish the execution of this instruction. Besides, pointer clear &#8220;CLR&#8221; can execute independently and is not influenced by other inputs.<\/p>\n<p>\u25cf The effective range of the pointer is 0 to L-1. Beyond this range the pointer error &#8220;ERR&#8221; will be set to 1 and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p102-2.png\" alt=\"101P.T R X0 TS : R 0 END EN L : 9 INC Pr : R 19 ERR Rd : R 20 CLR\" width=\"194\" height=\"112\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the example at left, at the very beginning Pr = 7 and Ts and Rd are as shown at left in the diagram below. When X0 have a transition from 0\u21921 twice, the results are shown at right in the diagram below.<\/p>\n<p>\u25cf At the second time execution, the pointer has already reached to the end so there will be no increment.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p102-3.png\" alt=\"Ts Pr Pr Pr 1 1 1 1 7 R19 8 R19 8 R19 R0(T0) 2 2 2 2 R1(T1) 3 3 3 3 R2(T2) X0\uff1d\u21b1 X0\uff1d\u21b1 4 4 4 4 Rd Rd Rd R3(T3) (first) (second) 5 5 5 5 0000 R20 \u25cf 8 8 8 8 R20 \u25cf 9 9 9 9 R20 R4(T4) 6 6 6 6 R5(T5) 7 7 7 7 END END END R6(T6) 8 8 8 8 0 0 1 R7(T7) 9 9 9 9 R8(T8) Before execution First time execution Second\" width=\"512\" height=\"185\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p103-1.png\" alt=\"FUN102 D P FUN102 D P TABLE TO TABLE MOVE T\u2192T T\u2192T Ladder symbol Ts : Starting number of source table register Td : Starting number of destination table 102DP.T T register Move control EN TS : END Move to end L : Table (Ts and Td) length Td : Pr : Pointer register Pointer increment INC L : ERR Pointe\" width=\"644\" height=\"339\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or have a transition from 0 to 1( P instruction), the register Tspr pointed by pointer Pr within the source table will be moved to a register Tdpr, which also pointed by the pointer Pr in the destination table. Before execution, it will first check the input signal of pointer clear &#8220;CLR&#8221;. If &#8220;CLR&#8221; is 1, it will first clear Pr to 0 and then do the move (in this case Ts0\u2192Td0). After the move action has been completed it will then check the value of pointer Pr. If the Pr value has already reached L-1 (point to the last register on the table), then it will set the move-to-end flag &#8220;END&#8221; to 1 and finish executing of this instruction. If the Pr value is less than L-1, it will check the status of &#8220;INC&#8221;. If &#8220;INC&#8221; is 1, then the Pr value will be increased by 1 before execution. Besides, pointer clear &#8220;CLR&#8221; can execute independently, and will not be influenced by other input.<\/p>\n<p>\u25cf The effective range of the pointer is 0 to L-1. Beyond this range, the pointer error flag &#8220;ERR&#8221; will be set to 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p103-2.png\" alt=\"\u25cf The diagram at left below is the status before execution. 102P.T T X0 When X0 from 0\u21921, the content of R5 in Ts table will copy to TS : R 0 END EN R15 and pointer R20 will be increased by 1. Td : R 10 INC L : 10 ERR Pr : R 20 CLR Pr Pr R20 5 6 R20 Ts Td Td 1 1 1 1 0 0 0 0 0 0 0 0 R0 R10 R10 1 1 1 \" width=\"585\" height=\"343\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p104-1.png\" alt=\"FUN103 D P BT_M\" width=\"94\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p104-2.png\" alt=\"FUN103 D P BT_M\" width=\"88\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BLOCK TABLE MOVE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p104-3.png\" alt=\"Ts :Starting register for source table Td : Starting register for destination table L: Lengths of source and destination tables Ts, Td may combine with V, Z, P0~P9 to serve indirect WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z Ope- \u2223 \u2223 \u2223\" width=\"578\" height=\"234\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In this instruction the source table and destination table are the same length. When this instruction was executed all the data in the Ts table is completely copied to Td. No pointer is involved in this instruction.<\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or have a transition from 0 to 1 ( P instruction), all the data from source table Ts (length L) is copied to the destination table Td, which is the same length.<\/p>\n<p>\u25cf One table is completely copied every time this instruction is executed, so if the table length is long, it will be very time consuming. In practice, P modifier should be used to avoid time waste caused by each scan repeating the same movement action.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p104-4.png\" alt=\"103P.BT_M X0 EN TS : R 0 Td : R 10 L : 10\" width=\"183\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The diagram at left below is the status before execution. When X0 from 0\u21921, the content of R0~R9 in Ts table will copy to R10~R19.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p104-5.png\" alt=\"Ts Td Td 0 0 0 0 \u2500\u2500\u2192R10 0 0 0 0 R10 0 0 0 0 R0 1 1 1 1 \u2500\u2500\u2192R11 0 0 0 0 R11 1 1 1 1 R1 2 2 2 2 \u2500\u2500\u2192R12 0 0 0 0 2 2 2 2 R2 R12 X0\uff1d\u21b1 R13 3 3 3 3 3 3 3 3 \u2500\u2500\u2192R13 0 0 0 0 R3 \u25cf R14 4 4 4 4 \u2500\u2500\u2192R14 0 0 0 0 4 4 4 4 R4 5 5 5 5 \u2500\u2500\u2192R15 0 0 0 0 R15 5 5 5 5 R5 6 6 6 6 \u2500\u2500\u2192R16 0 0 0 0 R16 6 6 6 6 R6 7 7 7 7 \u2500\u2500\u2192R17 0 0\" width=\"350\" height=\"217\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p105-1.png\" alt=\"FUN104 D P T_SWP\" width=\"94\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p105-2.png\" alt=\"FUN104 D P T_SWP\" width=\"88\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BLOCK TABLE SWAP<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p105-3.png\" alt=\"Ta : Starting register of Table a Tb : Starting register of Table b L : Lengths of Table a and b Ts, Td may combine with V, Z, P0~P9 to serve indirect address application WY WM WS TMR CTR HR OR SR ROR DR K XR Range WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 2 V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 Ope- WY240 WM18\" width=\"585\" height=\"236\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction swaps the contents of Tables a and b, so the table must be the same length, and the registers in the table must of write able. Since a complete swap is done with each time the instruction is executed, no pointer is needed.<\/p>\n<p>\u25cf When move control &#8220;EN&#8221; = 1 or have a transition from 0 to 1 ( P instruction), the contents of Table a and Table b will be completely swapped.<\/p>\n<p>\u25cf This instruction will swap all the registers specified in L each time the instruction is executed, so if the table length is big, it will be very time consuming, therefore P instruction should be used.<\/p>\n<p>\u25cf The diagram at left below is the status before execution.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p105-4.png\" alt=\"104P.T_SWP X0 Ta : R 0 EN Tb : R 10 L : 10\" width=\"174\" height=\"84\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>When X0 from 0\u21921, the contents of R0~R9 in Ts table will swap with R10~R19.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p105-5.png\" alt=\"Ta Tb Ta Tb R10 0 0 0 0 0 0 0 0 R10 1 1 1 1 1 1 1 1 R0 R0 0 0 0 0 1 1 1 1 1 1 1 1 R11 0 0 0 0 R1 R11 R1 R12 0 0 0 0 R2 0 0 0 0 R12 1 1 1 1 R2 1 1 1 1 X0\uff1d\u21b1 R3 R13 0 0 0 0 0 0 0 0 R13 1 1 1 1 1 1 1 1 R3 \u25cf R4 0 0 0 0 1 1 1 1 1 1 1 1 R14 0 0 0 0 R4 R14 R15 0 0 0 0 0 0 0 0 R15 1 1 1 1 1 1 1 1 R5 R5 0 0 0\" width=\"422\" height=\"200\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p106-1.png\" alt=\"FUN105 D P R-T_S\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p106-2.png\" alt=\"FUN105 D P R-T_S\" width=\"83\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>REGISTER TO TABLE SEARCH<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p106-3.png\" alt=\"Rs : Data to search, It can be a constant or a register Ts : Starting register of table being searched L : Label length Pr : Pointer of table Rs, Ts may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R39\" width=\"624\" height=\"278\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When search control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will search from the first register of Table Ts (when &#8220;FHD&#8221; = 1 or Pr value has reached L-1), or from the next register (Tspr + 1) pointed by the pointer within the table (&#8220;FHD&#8221; = 0, while Pr value is less than L-1) to find the first data different with Rs(when D\/S = 1) or find the first data the same with Rs (when D\/S = 0). If it find a data match the condition it will immediately stop the search action, and the pointer Pr will point to that data and found objective flag &#8220;FND&#8221; will set to 1. When the searching has searched to the last register of the table, the execution of the instruction will stop, whether it was found or not. In that case the search-to-end flag &#8220;END&#8221; will be set to 1 and the Pr value will stop at L-1. When this instruction next time is executed, Pr will automatically return to the head of the table (Pr = 0) before the search begin.<\/p>\n<p>\u25cf The effective range of Pr is 0 to L-1. If the value exceeds this range then the pointer error flag &#8220;ERR&#8221; will change to 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p106-4.png\" alt=\"105P.R-T_S X0 \u25cf The instruction at left is searching the table for a register with the EN RS : 5555 FND value 5555 (because D\/S = 0, it is searching for same value). TS : R 0 Before execution, the pointer point to R2, but the starting point of FHD L : 10 END the search is Pr + 1 (i.e. it starts from\" width=\"592\" height=\"119\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p106-5.png\" alt=\"Pr Ts Pr FN EN 2 R0 5 5 5 5 6 R20 \u25cfX0\uff1d\u21b1 R20 1 0 R1 0 0 0 0 (First) R2 5 5 5 5 Start Rs R3 2 2 2 2 \u2190 point Pr FN EN 5 5 5 5 R4 3 3 3 3 \u25cfX0\uff1d\u21b1 R20 9 0 1 (Second) R5 4 4 4 4 R6 5 5 5 5 R7 6 6 6 6 Pr FN EN R8 7 7 7 7 0 \u25cfX0\uff1d\u21b1 R20 1 0 (Third) R9 8 8 8 8 Before execution After execution\" width=\"510\" height=\"199\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p107-1.png\" alt=\"FUN106 D P T-T_C\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p107-2.png\" alt=\"FUN106 D P T-T_C\" width=\"83\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>TABLE TO TABLE COMPARE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p107-3.png\" alt=\"Ta : Starting register of Table a Tb : Starting register of Table b L : Lengths of Table Pr : Pointer Ta, Tb may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223\" width=\"623\" height=\"274\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When comparison control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), then starting from the first register in the tables Ta and Tb (when &#8220;FHD&#8221; = 1 or Pr value has reached L-1) or starting from the next pair of registers (Tapr+1 and Tbpr+1) pointed by Pr (&#8220;FHD&#8221; = 0, while Pr is less than L-1), this instruction will search for pairs of registers with different values (when &#8220;D\/S&#8221; = 1) or the same value (when &#8220;D\/S&#8221; = 0). When search found (either different or the same), it will immediately stop the search and the pointer Pr will point to the register pairs met the search criteria. The found flag &#8220;FND&#8221; will be set to 1. When it has searched to the last register of the table, the instruction will stop executing. whether it found or not. The compare-to-end flag &#8220;END&#8221; will be set to 1, and the pointer value will stop at L-1. When this instruction is executed next time, Pr will automatically return to the head of the table to begin the search. The effective range of Pr is 0 to L-1. The Pr value should not changed by other programs during the operation. As this will affect the result of the search. If the Pr value not in the effective range, the pointer error flag &#8220;ERR&#8221; will be set to 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p107-4.png\" alt=\"\u25cf The instruction at left starts from the register next to the register 106P.T-T_C pointed by the pointer (because &quot;FHD&quot; is 0) to search for register X0 pairs with different data (because &quot;D\/S&quot; is 1) within the 2 tables. EN Ta : R 0 FND At the very beginning, Pr points to Ta1 and Tb1. There are 3 Tb\" width=\"614\" height=\"371\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-1.png\" alt=\"FUN107 D P T_FIL\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-2.png\" alt=\"FUN107 D P T_FIL\" width=\"83\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>TABLE FILL<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-3.png\" alt=\"Rs : Source data to fill, can be a constant or a register Td : Starting register of destination table L :Table length Rs, Td may combine with V, Z, P0~P9 to serve indirect address application Range WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR 16\/32-bit V\u3001Z WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R\" width=\"612\" height=\"256\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When fill control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), the Rs data will be filled into all the registers of the table Td.<\/p>\n<p>\u25cf This instruction is mainly used for clearing the table (fill 0) or unifying the table (filling in the same values). It should be used with the P instruction.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-4.png\" alt=\"107P.T_FIL X0 EN RS : 5555 Td : R 0 L : 10\" width=\"180\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left will fill 5555 into the whole table Td. The results are as shown in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-5.png\" alt=\"Td 1 5 4 7 R0 2 3 1 4 R1 7 7 2 5 R2 0 0 1 3 R3 5 2 4 7 R4 1 9 2 5 R5 6 7 4 4 R6 5 3 1 9 R7 9 7 8 8 R8 2 7 9 6 R9\" width=\"74\" height=\"171\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-6.png\" alt=\"Td 5 5 5 5 R0 R1 5 5 5 5 5 5 5 5 R2 X0\uff1d\u21b1 R3 5 5 5 5 \u25cf R4 5 5 5 5 5 5 5 5 R5 R6 5 5 5 5 5 5 5 5 R7 R8 5 5 5 5 5 5 5 5 R9\" width=\"141\" height=\"172\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p108-7.png\" alt=\"Rs 5 5 5 5\" width=\"96\" height=\"143\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Before execution<\/p>\n<p>After execution<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p109-1.png\" alt=\"FUN108 D P T_SHF\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p109-2.png\" alt=\"FUN108 D P T_SHF\" width=\"83\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>TABLE SHIFT<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p109-3.png\" alt=\"IW : Data to fill the room after shift operation, can be a constant or a register Ts : Source table Td : Destination table storing shift results L : Lengths of tables Ts and Td OW : Register to accept the shifted out data Ts, Td may combine with V, Z, P0~P9 to serve indirect address application WX W\" width=\"608\" height=\"304\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When shift control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), all the data from table Ts will be taken out and shifted one position to the left (when &#8220;L\/R&#8221; = 1) or to the right (when &#8220;L\/R&#8221; = 0). The room created by the shift operation will be filled by IW and the results will be written into table Td. The data shifted out will be written into OW.<\/p>\n<p>\u25cf In the program at left, Ts and Td is the same table.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p109-4.png\" alt=\"108P.T_SHF X0 EN IW : R 10 TS : R 0 X1 Td : R 0 L\/R L : 10 OW : R 11\" width=\"179\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Therefore, the table shifts itself and then writes back to itself (the table must be writ able). It first perform a shift left operation (let X1 = 1, and X0 go from 0\u21921) then perform a shift to right operation (let X1 = 0, and makes X0 go from 0 \u21921). The result are shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p109-5.png\" alt=\"(Shift left) (Shift right) Ts(Td) Td(Ts) Td(Ts) R0 0 0 0 0 R0 1 2 3 4 R0 0 0 0 0 (Shift left) R1 1 1 1 1 R1 0 0 0 0 R1 1 1 1 1 R2 2 2 2 2 R2 1 1 1 1 R2 2 2 2 2 OW R3 3 3 3 3 R3 2 2 2 2 R3 3 3 3 3 R10 1 2 3 4 R4 4 4 4 4 R11 \u00d7\u00d7\u00d7\u00d7 R4 3 3 3 3 R4 4 4 4 4 R5 5 5 5 5 R5 4 4 4 4 R5 5 5 5 5 R6 6 6 6 6 R6 5 5\" width=\"507\" height=\"255\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p110-1.png\" alt=\"FUN109 D P T_ROT\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p110-2.png\" alt=\"FUN109 D P T_ROT\" width=\"83\" height=\"43\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>TABLE ROTATE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p110-3.png\" alt=\"Ts : Source table for rotate Td : Destination table storing results of rotation L : Lengths of table Ts, Td may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \" width=\"612\" height=\"246\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When rotation control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), the data from the table of Ts will be rotated 1 position to the left (when &#8220;L\/R&#8221; = 1)or 1 position to the right (when &#8220;L\/R&#8221; = 0). The results of the rotation will then be written onto table Td.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p110-4.png\" alt=\"109P.T_ROT X0 TS : R 0 EN Td : R 0 X1 L\/R L : 10\" width=\"173\" height=\"88\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, Ts and Td is the same table. The table after rotation will write back to itself. It first perform one left rotation (let X1 = 1, and X0 go from 0\u21921), and then performs one right rotation (let X1 = 0, and X0 go from 0\u21921). The results are shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p110-5.png\" alt=\"Rotate left Rotate right (Rotate left) (Rotate right) Ts(Td) Td(Ts) Td(Ts) R0 0 0 0 0 (right) R0 9 9 9 9 R0 0 0 0 0 R1 1 1 1 1 R1 0 0 0 0 R1 1 1 1 1 R2 2 2 2 2 R2 1 1 1 1 R2 2 2 2 2 R3 3 3 3 3 R3 2 2 2 2 R3 3 3 3 3 R4 4 4 4 4 R4 3 3 3 3 R4 4 4 4 4 R5 5 5 5 5 R5 4 4 4 4 R5 5 5 5 5 R6 6 6 6 6 R6 5 5 5\" width=\"433\" height=\"242\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p111-1.png\" alt=\"FUN110 D P QUEUE\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p111-2.png\" alt=\"FUN110 D P QUEUE\" width=\"82\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>QUEUE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p111-3.png\" alt=\"IW : Data pushed into queue, can be a constant or a register QU : Starting register of queue L : Size of queue Pr : Pointer register OW : Register accepting data popped out from queue QU may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Ra\" width=\"635\" height=\"300\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Queue is also a kind of table. It is different from ordinary table in that its queue register numbers go from 1 to L and not from 0 to L-1. In other words QU1~QUL respectively correspond to pointers Pr = 1 to L, and Pr = 0 is used to show that the queue is empty.<\/p>\n<p>\u25cf Queue is a first in first out (FIFO) device, i.e. &#8211; the data that first pushed into the queue will be the first to pop out from the queue. A queue is comprised of L consecutive 16 or 32 bit registers ( D instruction) starting from the QU register, as in the diagram below:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p111-4.png\" alt=\"Pr 4 IW QU \u25cf5555 QU1 \u25cf4444 QU2 \u25cf3333 Push QU3 \u25cf2222 down push(I\/O=1) QU4 \u25cf1111 OW 1.IW always push into QU5 \u00d7\u00d7\u00d7\u00d7 QU1 \u2026 \u2026 2.Pr\uff0b1\u2192Pr Pop out(I\/O=0) 2. QUpr \u2192OW \u25cf\uff5e\u25cfis the sequence number of operation QUL 3. Pr\uff0d1\u2192Pr\" width=\"543\" height=\"217\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), the status of in\/out control &#8220;I\/O&#8221; determines whether the IW data will be pushed into the queue (when &#8220;I\/O&#8221; = 1) or be popped out and transferred to OW (when &#8220;I\/O&#8221; = 0). As shown in the diagram above, the IW data will always be pushed into the first (QU1) register of the queue. After it has been pushed in, Pr will immediately be increased by 1, so that the pointer can always point to the first data that was pushed into the queue. When it is popped out, the data pointed by Pr will be transferred directly to OW. Pr will be reduced by 1, so that it still point to the first data remained in the queue.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p112-1.png\" alt=\"FUN110 D P FUN110 D P QUEUE QUEUE QUEUE\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf If no data has yet been pushed into the queue or the pushed in data has already been popped out (Pr = 0), then the queue empty flag will be set to 1. In this case, even if there is further popping out action, this instruction will not be executed. If data is only pushed in and not popped out, or pushed in is more than that popped out, then the queue finally becomes full (pointer Pr indicates the QUL position), and the queue full flag is changed to 1. In this case, if there is more pushing in action, this instruction will not execute. The pointer for this instruction is used during access of the queue, to indicate the data that was pushed in the earliest. Other programs should not be allowed to change it, or else an operation error will be created. If there is a specific application, which requires the setting of a Pr value, then its permissible range is 0 to L (0 means empty, and 1 to L respectively correspond to QU1 to QUL). Beyond this range, the pointer error flag &#8220;ERR&#8221; will be set as 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p112-2.png\" alt=\"110P.QUEUE X0 EN IW : R 0 EPT QU : R 2 X1 L : 10 FUL I\/O Pr : R 1 OW : R 20 ERR\" width=\"209\" height=\"120\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The program at left assumes the queue content is the same with the queue at preceding page. It will first perform queue push operation, and then perform pop out action. The results are shown below. Under any circumstance, Pr always point to the first (oldest) data that was remained in queue.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p112-3.png\" alt=\"Pr 5\" width=\"53\" height=\"36\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p112-4.png\" alt=\"Pr 4\" width=\"53\" height=\"36\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p112-5.png\" alt=\"QU QU 5 5 5 5 R2 5 5 5 5 R2 QU1 QU1 QU2 4 4 4 4 R3 QU2 4 4 4 4 R3 3 3 3 3 R4 3 3 3 3 R4 QU3 QU3 2 2 2 2 R5 OW 2 2 2 2 R5 OW QU4 QU4 1 1 1 1 R6 \u00d7\u00d7\u00d7\u00d7 R20 1 1 1 1 R20 QU5 QU5 R6 \u2191 QU6 R7 QU6 R7 QU7 R8 OW unchanged QU7 R8 QU8 R9 QU8 R9 QU9 R10 QU9 R10 QU10 R11 QU10 R11 After push in (X1=1\uff0cX0 from 0\u21921) A\" width=\"455\" height=\"208\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p113-1.png\" alt=\"FUN111 D P STACK\" width=\"90\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p113-2.png\" alt=\"FUN111 D P STACK\" width=\"81\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>STACK<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p113-3.png\" alt=\"IW : Data pushed into stack, can be a constant or a register ST : Starting register of stack L : Size of stack Pr : Pointer register OW : Register accepting data popped out from stack ST may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Ra\" width=\"627\" height=\"298\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Like queue, stack is also a kind of table. The nature of its pointer is exactly the same as with queue, i.e. Pr = 1 to L, which corresponds to ST1 to STL, and when Pr = 0 the stack is empty.<\/p>\n<p>\u25cf Stack is the opposite of queue, being a last in first out (LIFO) device. This means that the data that was most recently pushed into the stack will be the first to be popped out of the stack. The stack is comprised of L consecutive 16 or 32-bit ( D instruction) registers starting from ST, as shown in the following diagram:<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p113-4.png\" alt=\"Pr 4 \u25cf\uff5e\u25cf is the sequence number of operation ST \u2190Bottom of stack ST1 \u25cf1111 \u25cf2222 ST2 ST3 \u25cf3333 IW \u25cf4444 OW ST4 \u00d7\u00d7\u00d7\u00d7 ST5 \u25cf5555 push(I\/O=1) pop(I\/O=0) push 1.Pr\uff0b1\u2192Pr 1.STpr\u2192OW 2.IW\u2192STpr 2.Pr\uff0d1\u2192Pr STL\" width=\"528\" height=\"214\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), the status of in\/out control &#8220;I\/O&#8221; determines whether the IW data will be pushed into the stack (when &#8220;I\/O&#8221; = 1), or the data pointed by Pr within the stack (the data most recently pushed into the stack) will be moved out and transferred to OW (when &#8220;I\/O&#8221; = 0). Note that the data pushed in is stacking, so before pushed in, Pr will increased by 1 to point to the top of the stack then the data will be pushed in. When it is popped out, the data pointed by pointer Pr (the most recently pushed in data) will be transferred to OW. After then Pr will decreased by 1. Under any circumstances, the pointer Pr will always point to the data that was pushed into the stack most recently.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p114-1.png\" alt=\"FUN111 D P FUN111 D P STACK STACK STACK\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When no data has yet been pushed into the stack or the pushed in data has already been popped out (Pr = 0), the stack empty flag &#8220;EPT&#8221; will set to 1. In this case any further pop up actions, will be ignored. If more data is pushed than popped out, sooner or latter the stack will be full (pointer Pr points to STL position), and the stack full flag &#8220;FUL&#8221; will set to 1. In this case any further push actions, will be ignored. As with queue, the stack pointer in normal case should not be changed by other instructions. If there is a special application which requires to set the Pr value, then its effective range is 0 to L (0 means empty, 1 to L respectively correspond to ST1 to STL). Beyond this range, the pointer error flag &#8220;ERR&#8221; will set to 1, and the instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p114-2.png\" alt=\"111P.STACK X0 EN IW : R 0 EPT ST : R 2 X1 L : 10 FUL I\/O Pr : R 1 OW : R 20 ERR\" width=\"209\" height=\"121\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The program at left assumes that the initial content of the stack is just as in the diagram of a stack on the preceding page. The operation illustrated in this example is to push a data and than pop it from stack. The results are shown below. Under any circumstances, Pr always point to the data that was most recently pushed into the stack.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p114-3.png\" alt=\"Pr 5 R1\" width=\"66\" height=\"36\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p114-4.png\" alt=\"Pr 4\" width=\"53\" height=\"36\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p114-5.png\" alt=\"ST QU 1 1 1 1 R2 1 1 1 1 R2 ST1 ST1 ST2 2 2 2 2 R3 ST2 2 2 2 2 R3 3 3 3 3 R4 3 3 3 3 R4 ST3 ST3 4 4 4 4 R5 OW 4 4 4 4 R5 OW ST4 ST4 5 5 5 5 R6 R20 5 5 5 5 R20 ST5 \u00d7\u00d7\u00d7\u00d7 ST5 R6 \u2191 ST6 R7 ST6 R7 ST7 R8 OW unchanged ST7 R8 ST8 R9 ST8 R9 ST9 R10 ST9 R10 ST10 R11 ST10 R11 After push(X1=1\uff0cX0 from 0\u21921) After\" width=\"452\" height=\"209\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p115-1.png\" alt=\"FUN112 D P BKCMP\" width=\"91\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p115-2.png\" alt=\"FUN112 D P BKCMP\" width=\"82\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>BLOCK COMPARE\uff08DRUM\uff09<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p115-3.png\" alt=\"Rs : Data for compare, can be a constant or a register Ts : Starting register block storing upper and lower limit L : Number of pairs of upper and lower limits D : Starting relay storing results of comparison Y M S WX WY WM WS TMR CTR HR IR OR SR ROR DR K Range 16\/32-bit Y0 M0 S0 WX0 WY0 WM0 WS0 T0 \" width=\"622\" height=\"283\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When comparison control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), comparisons will be perform one by one between the contents of Rs and the upper and lower limits form by L pairs of 16 or 32-bit ( D modifier) registers starting from the Ts register (starting from T0 each adjoining 2 register units form a pair of upper and lower limits). If the value of Rs falls within the range of the pair, then the bit within the comparison results relay D which corresponds to that pair will be set to 1. Otherwise it will be set as 0 until comparison of all the L pairs of upper and lower limits is completed.<\/p>\n<p>\u25cf When M1975=0, if there is any pair where the upper limit value is less than the lower limit value, then the limit error flag &#8220;ERR&#8221; will be set to 1, and the comparison output for that pair will be 0.<\/p>\n<p>\u25cf When M1975=1, there is no restriction on the relation of upper limit and lower limit, this can apply for 360\u00b0rotary electronic drum switch application.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p115-4.png\" alt=\"Compare Compared Upper limit Lower limit Result value 0 TS1 TS0 D0 1 TS3 TS2 D1 Rs \u223d \u223d \u223d \u223d \u223d \u223d L\u22121 TS2L\u22121 TS2L\u22122 DL\u22121\" width=\"463\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Actually this instruction is a drum switch, which can be used in interrupt program and when incorporate with immediate I\/O instruction (IMDIO) can achieve an accurate electronic drum.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p115-5.png\" alt=\"X0 112.BKCMP \u25cf In this program, C0 represents the rotation angle (Rs) of RS : C 0 ERR EN a drum shaft. The block compare instruction performs a Ts : R 10 comparison between Rs and the 4 pairs (L = 4) of upper L : 4 and lower limits, R10,R11, R12,R13, R14,R15 and D : Y 5 R16,R17. The comparison resul\" width=\"634\" height=\"184\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p116-1.png\" alt=\"FUN112 D P FUN112 D P BLOCK COMPARE\uff08DRUM\uff09 BKCMP BKCMP\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The program in the diagram above coordinates a rotary encoder or other rotating angle detection device (directly connect to a rotating mechanism), which can form a mechanical device equivalent to the mechanical structure of an actual drum (see mechanism shown within dotted line in diagram below). While the upper and lower limits are being adjusted, you can change at will the range of the activated angle of the drum. This<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p116-2.png\" alt=\"cannot be done with the traditional drum mechanism. Equivalent mechanical drum emulated by above program Rotary encoder Rotary encoder 200 200 180 Rotating 180 Rotating 180 180 140 140 \uff0emechanism mechanism 220 220 80 80 90 90 80 80 60 60 320 40 0 320 40 0 0 Limit sw Limit sw X1 X1 Y8 Y8 Y7 Y7 Y6 Y6 \" width=\"655\" height=\"395\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p116-3.png\" alt=\"140 40 Y5 80 180 Y6 60 Y7 200 80 Y8 C0 160\u00b0 200\u00b0 240\u00b0 280\u00b0 320\u00b0 360\u00b0 40\u00b0 80\u00b0 120\u00b0 0\u00b0\" width=\"408\" height=\"175\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p117-1.png\" alt=\"FUN113 D P SORT\" width=\"93\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p117-2.png\" alt=\"FUN113 D P SORT\" width=\"86\" height=\"41\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>DATA SORTING<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p117-3.png\" alt=\"S : Starting register of source registers to sort D : Starting register of destination registers to store the data after sorted L : Total register for sorting Range TMR CTR HR IR OR SR ROR DR K 2 T0 C0 R0 R3840 R3904 R3968 R5000 D0 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand T255 C255 R3839 R3903 R3967 R4167 R8071 \" width=\"641\" height=\"245\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When sort control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), will sort the registers with ascending order (if A\/D = 1) or descending order (if A\/D = 0) and put the sorted result to the registers starting by D register.<\/p>\n<p>\u25cf The valid data length of sort operation is between 2 and 127, other length will set the \u201cERR\u201d to 1 and the sort operation will not perform.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p117-4.png\" alt=\"113P.SORT X0 EN S : R 0 ERR D : R 10 A\/D L : 10\" width=\"182\" height=\"78\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024The example at left sorts the table comprised of R0~R9 and stores the sorted data to the table locate at R10~R19.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p117-5.png\" alt=\"S D 1 5 4 7 0 0 1 3 R0 R10 2 3 1 4 1 5 4 7 R1 R11 7 7 2 5 R12 1 9 2 5 R2 0 0 1 3 2 3 1 4 R3 R13 X0\uff1d\u21b1 5 2 4 7 2 7 9 6 R4 R14 \u25cf R15 1 9 2 5 5 2 4 7 R5 6 7 4 4 5 3 1 9 R6 R16 5 3 1 9 R17 6 7 4 4 R7 9 7 8 8 7 7 2 5 R8 R18 2 7 9 6 R19 9 7 8 8 R9\" width=\"232\" height=\"172\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Before<\/p>\n<p>After<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-1.png\" alt=\"FUN114 D P Z-WR\" width=\"93\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-2.png\" alt=\"FUN114 D P Z-WR\" width=\"86\" height=\"40\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>ZONE WRITE<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-3.png\" alt=\"\" width=\"260\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Starting address of being set or reset<\/p>\n<p>N : Quantity of being set oe reset, 1~511<\/p>\n<p>D \u3001N operand can combine V \u3001Z \u3001P0~P9 for index<\/p>\n<p>addressing while word operation<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-4.png\" alt=\"Y M S WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range Y0 M0 S0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 Operand Y255 M1911 S99 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0\uff5eP9 \u25cb D \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb N \u25cb \u25cb \u25cb 1-511 \u25cb\" width=\"615\" height=\"93\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221;=1 or changes from 0\u21921\uff08 P instruction\uff09, it will perform the write operation according to the input status of write selection, the specified area of registers or bits will all be reset to 0 (&#8220;1\/0&#8243;=0) or set to 1(&#8220;1\/0&#8243;=1).<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-5.png\" alt=\"114.Z-WR X0 ERR EN D : R0 N : 10 I\/O\" width=\"216\" height=\"77\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Above example, registers R0~R9 will be reset to 0 while X0=1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p118-6.png\" alt=\"114.Z-WR X0 ERR D : M5 EN N : 7 I\/O\" width=\"217\" height=\"78\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024Above example, bits M5~M11 will be reset to 0 while X0=1.<\/p>\n<h4>Matrix Instructions<\/h4>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>Fun No.<\/td>\n<td>Mnemonic<\/td>\n<td>Functionality<\/td>\n<td>Fun No.<\/td>\n<td>Mnemonic<\/td>\n<td>Functionality<\/td>\n<\/tr>\n<tr>\n<td>120<\/td>\n<td>MAND<\/td>\n<td>Matrix AND<\/td>\n<td>126<\/td>\n<td>MBRD<\/td>\n<td>Matrix Bit Read<\/td>\n<\/tr>\n<tr>\n<td>121<\/td>\n<td>MOR<\/td>\n<td>Matrix OR<\/td>\n<td>127<\/td>\n<td>MBWR<\/td>\n<td>Matrix Bit Write<\/td>\n<\/tr>\n<tr>\n<td>122<\/td>\n<td>MXOR<\/td>\n<td>Matrix XOR<\/td>\n<td>128<\/td>\n<td>MBSHF<\/td>\n<td>Matrix Bit Shift<\/td>\n<\/tr>\n<tr>\n<td>123<\/td>\n<td>MXNR<\/td>\n<td>Matrix XNOR<\/td>\n<td>129<\/td>\n<td>MBROT<\/td>\n<td>Matrix Bit Rotate<\/td>\n<\/tr>\n<tr>\n<td>124<\/td>\n<td>MINV<\/td>\n<td>Matrix Inverse<\/td>\n<td>130<\/td>\n<td>MBCNT<\/td>\n<td>Matrix Bit Count<\/td>\n<\/tr>\n<tr>\n<td>125<\/td>\n<td>MCMP<\/td>\n<td>Matrix Compare<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf A matrix is comprised of 2 or more consecutive 16-bit registers. The number of registers comprising the matrix is called the matrix length (L). One matrix altogether has L\u00d716 bits (points), and the basic unit of the object for each operation is bit.<\/p>\n<p>\u25cf The matrix instructions treats the 16\u00d7L matrix bits as a set of series points( denoted by M0 to M16L-1). Whether the matrix is formed by register or not, the operation object is the bit not numerical value.<\/p>\n<p>\u25cf Matrix instructions are used mostly for discrete status processing such as moving, copying, comparing, searching, etc, of single point to multipoint (matrix), or multipoint-to-multipoint. These instructions are convenient, important for application.<\/p>\n<p>\u25cf Among the matrix instructions, most instruction need to use a 16-bit register as a pointer to points a specific point within the matrix. This register is known as the matrix pointer (Pr). Its effective range is 0 to 16L-1, which corresponds respectively to the bits M0 to M16L-1 within the matrix.<\/p>\n<p>\u25cf Among the matrix operations, there are shift left\/right, rotate left\/right operations. We define the movement toward higher bit is left direction, while the movement toward lower bit is right direction, as shown in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p119-1.png\" alt=\"\u2190\u2500 Width is 16 bit \u2500\u2192 Pr M 40 (right) M15 M0 \u2193 \u2193 M 4 0 R0 \u2191 R1 R2 1 \u2502 R3 \u2502 R4 Pr=40, point \u25cf \u25cf to M 4 0, \u25cf length \u25cf \u25cf \u25cf L \u25cf \u25cf \u25cf \u2502 \u25cf \u25cf \u25cf \u2502 \u25cf \u25cf \u25cf \u2193 \u25cf RL\u22121 \u2191 M16L\u22121(left)\" width=\"381\" height=\"254\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN120 P MAND MATRIX AND<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p120-2.png\" alt=\"Ma : Starting register of source matrix a Mb : Starting register of source matrix b Md : Starting register of destination matrix L : Length of matrix (Ma, Mb and Md) Ma, Mb, Md may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY\" width=\"641\" height=\"524\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, when X0 goes from 0\u21921, then<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p120-3.png\" alt=\"120P.MAND X0 EN Ma : R 0 Mb : R 10 Md : R 20 L : 5\" width=\"171\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>matrix Ma, comprised by R0 to R4, and matrix Mb, comprised by R10 to R14, will do an AND operation. The results will be stored back in matrix Md, comprised by R20 to R24. The result is shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p120-4.png\" alt=\"Ma15 Ma0 Mb15 Mb0 Md15 Md0 Ma Mb Md \u2193 \u2193 \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 R11 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R21 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 1 1 1 1 1 1 1 1 R12\" width=\"612\" height=\"128\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p121-1.png\" alt=\"FUN121 P FUN121 P MATRIX OR MOR MOR Ladder symbol Ma : Starting register of source matrix a 121P.MOR Mb : Starting register of source matrix b Ma : Operation control EN Md : Starting register of destination matrix Mb : L : Length of matrix (Ma, Mb and Md) Md : Ma, Mb, Md may combine with V, Z, P0~P9\" width=\"642\" height=\"583\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p121-2.png\" alt=\"121P.MOR X0 Ma : R 0 EN Mb : R 10 Md : R 10 L : 5\" width=\"171\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, when X0 goes from 0\u21921, then matrix Ma, comprised by R0 to R4, and matrix Mb, comprised by R10 to R14, will do an OR operation. The results will then be stored into the destination matrix Md, comprised by R10 to R14. In this example, Mb and Md is the same matrix, so after operation the source matrix Mb will replaced by the new value. The result is shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p121-3.png\" alt=\"Ma15 Ma0 Mb15 Mb0 Md15 Md0 Ma Mb Md \u2193 \u2193 \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 R11 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R21 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R12\" width=\"612\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN122 P MXOR MATRIX EXCLUSIVE OR\uff08XOR\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p122-2.png\" alt=\"Ma : Starting register of source matrix a Mb : Starting register of source matrix b Md : Starting register of destination matrix L : Length of matrix (Ma, Mb and Md) Ma, Mb, Md may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY\" width=\"641\" height=\"519\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p122-3.png\" alt=\"122P.MXOR X0 EN Ma : R 0 Mb : R 10 Md : R 20 L : 5\" width=\"171\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, when X0 goes from 0\u21921, will perform a XOR operation between matrix Ma, comprised by R0 to R4, and matrix Mb, comprised by R10 to R14. The results will then be stored in destination matrix Md, comprised by R20 to R24. The results are shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p122-4.png\" alt=\"Ma15 Ma0 Mb15 Mb0 Md15 Md0 Ma Mb Md \u2193 \u2193 \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 R11 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R21 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R12\" width=\"617\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN123 P MXNR MATRIX EXCLUSIVE NOR\uff08XNR\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p123-2.png\" alt=\"Ma : Starting register of source matrix a Mb : Starting register of source matrix b Md : Starting register of destination matrix L : Length of matrix (Ma, Mb and Md) Ma, Mb, Md may combine with V, Z,P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range V\u3001Z WX0\" width=\"641\" height=\"524\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p123-3.png\" alt=\"123P.MXNR X0 EN Ma : R 0 Mb : R 10 Md : R 10 L : 5\" width=\"171\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or goes from 0 to 1 ( P instruction), will perform a XNR operation between Ma matrix comprised by R0~R9 and Mb matrix comprised by R10~R19. The results will then be stored into the destination matrix Md comprised by R10~R19. The results are shown at right in the diagram below.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p123-4.png\" alt=\"Ma15 Ma Mb15 Mb0 Md15 Md0 Ma Mb Md \u2193 \u2193 \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 R11 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R21 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 1 1 1 1 1 1 1 1 R12 \" width=\"612\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN124 P MINV MATRIX INVERSE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p124-2.png\" alt=\"Ladder symbol Ms : Starting register of source matrix 124P.MINV Md : Starting register of destination Ms : Operation control EN L : Length of matrix (Ms and Md) Md : Ma, Md may combine with V, Z, P0~P9 to serve indirect L : address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY\" width=\"620\" height=\"247\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p124-3.png\" alt=\"Ms Md L Inverse Ms\" width=\"305\" height=\"244\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P<\/p>\n<p>instruction), source register Ms, which has a length of L, will be<\/p>\n<p>completely inverted (all the bits with a value of 1 will change to 0,<\/p>\n<p>and all those with a value of 0 will change to 1). The results will<\/p>\n<p>then be stored into destination matrix Md.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p124-4.png\" alt=\"124P.MINV X0 EN Ms : R 0 Md : R 0 L : 5\" width=\"175\" height=\"86\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, when X0 goes from 0\u21921, the matrix comprised by R0 to R4 will be inverted, and then store back into itself (because in this example Ms and Md are the same matrix). The results obtained are shown at right in the diagram below.<\/p>\n<p>Ms15<\/p>\n<p>Ms0<\/p>\n<p>Md15<\/p>\n<p>Md0<\/p>\n<p>Ms<\/p>\n<p>Md<\/p>\n<p>\u2193<\/p>\n<p>\u2193<\/p>\n<p>\u2193<\/p>\n<p>\u2193<\/p>\n<p>R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1<\/p>\n<p>R1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 R1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1<\/p>\n<p>R2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0<\/p>\n<p>R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1<\/p>\n<p>R4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>Ms79<\/p>\n<p>Ms64<\/p>\n<p>Md79<\/p>\n<p>Md64<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p124-5.png\" alt=\"Before execution After execution\" width=\"396\" height=\"34\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p125-1.png\" alt=\"FUN125 P FUN125 P MATRIX COMPARE MCMP MCMP Ladder symbol 125P.MCMP Md : Starting register of matrix a Ma : Comparison control EN FND Found objective Mb : Starting register of matrix b L : Length of matrix (Ma, Mb) Mb : Pr : Pointer register Compare from head FHD L : END Compare to end Ma, Mb may com\" width=\"646\" height=\"608\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The range for the pointer value is 0 to 16L-1. The Pr value should not be changed by other instructions, as this will affect the result of search. If the Pr value exceeds its range, then the pointer error flag &#8220;ERR&#8221; will be set to 1, and<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p125-2.png\" alt=\"this instruction will not be carried out. 125P.MCMP X0 \u25cf In the program at left, the &quot;FHD&quot; input is 0, so starting from a Ma : R 0 FND EN position 1 greater than the pointer value at that time (marked Mb : R 10 by *), the instruction will do a search for bits with different FHD L : 5 END status (bec\" width=\"632\" height=\"246\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<p>R4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 \u25cfR20 2<\/p>\n<p>1 0<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>\u2191<\/p>\n<p>Ma79<\/p>\n<p>Ma64<\/p>\n<p>Mb79<\/p>\n<p>Mb64<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>Before execution<\/p>\n<p>Execution result<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p126-1.png\" alt=\"FUN126 P FUN126 P MATRIX BIT READ MBRD MBRD Ms : Starting register of matrix L : Matrix length Pr : Pointer register Ms may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z \u2223 \u2223 \u2223\" width=\"655\" height=\"557\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The effective range of the pointer is 0 to 16L-1. Beyond this range the pointer error flag &#8220;ERR&#8221; will be set to 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p126-2.png\" alt=\"126P.MBRD X0 EN Ms : R 0 OTB L : 5 INC Pr : R 20 END ERR CLR\" width=\"202\" height=\"117\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, INC = 1, so every time there is one readout the pointer will be increased by 1. With this way each bit in Ms may be read out successively, as shown at left in the diagram below. When X0 goes 3 times from 0\u21921, the results are shown at right in the diagram below .<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p126-3.png\" alt=\"Pr OTB END Pr Ms15 Ms0 Ms 77 \u25cfR20 78 1 0 R20 \u2193 \u2193 R0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 R1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 OTB Pr OTB END 0 R2 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 \u25cfR20 79 0 0 R3 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 R4 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \u2191 \u2191 Pr \u2191 OTB END Ms79 Ms77 Ms64 \u25cfR20 79 1 1 Bef\" width=\"582\" height=\"146\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p127-1.png\" alt=\"FUN127 P FUN127 P MATRIX BIT WRITE MBWR MBWR Md : Starting register of matrix L : Matrix length Pr : Pointer register Md may combine with V, Z, P0~P9 to serve indirect address application WY WM WS TMR CTR HR OR SR ROR DR K XR Range WY0 WM0 WS0 T0 C0 R0 R3904 R3968 R5000 D0 2 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223\" width=\"654\" height=\"558\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The effective range of Pr is 0 to 16L-1. Beyond this range, the pointer error flag &#8220;ERR&#8221; will be set to 1, and this instruction will not be carried out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p127-2.png\" alt=\"127P.MBWR X0 EN Md : R 0 END X1 L : 5 INB ERR Pr : R 20 INC CLR\" width=\"211\" height=\"132\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In the program at left, pointer will be increased each time execution (because &#8220;INC&#8221; is 1). As shown in the diagram below, when X0 has a transition from 0\u21921, the status of INB (X1) will be written into the Mdpr (Md78) position, and pointer Pr will increased by 1 (changing to 79). In this case, although Pr is pointing to the end, it has not yet been written into Md79, so &#8220;END&#8221; flag is still 0. Only the next attempt to write to Md79 will set \u201cEND\u201d to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p127-3.png\" alt=\"Pr Pr X1 END 79 78 0 1 R20 R20 Md15 Md0 Md15 Md0 Md Md \u2193 \u2193 \u2193 \u2193 X0=\u21b1 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \u25cf R1 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 0 R2 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 0 R3 0 0 0 0 0 0 0 0 0\" width=\"453\" height=\"150\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p128-1.png\" alt=\"FUN128 P FUN128 P MATRIX BIT SHIFT MBSHF MBSHF Ms : Starting register of source matrix Md : Starting register of destination matrix L : Length of matrix (Ms and Md) Ms, Md may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0\" width=\"654\" height=\"735\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p128-2.png\" alt=\"Ms15 Ms0 Md15 Md0 Ms Md \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 X0=\u21b1 R1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 R1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 \u25cf R2 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" width=\"449\" height=\"125\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN129 P MBROT MATRIX BIT ROTATE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p129-2.png\" alt=\"Ms : Starting register of source matrix Md : Starting register of destination matrix L : Length of matrix (Ms and Md) Ms, Md may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z \" width=\"635\" height=\"679\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p129-3.png\" alt=\"Ms15 Ms0 Md15 Md0 Ms Md \u2193 \u2193 \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X0=\u21b1 R1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 OTB R2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 \u25cf R3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 R2 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 R3 0 0 0 0\" width=\"496\" height=\"126\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN130 P MBCNT MATRIX BIT STATUS COUNT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p130-2.png\" alt=\"Ms : Starting register of matrix L : Matrix length D : Register storing count results Ms may combine with V, Z, P0~P9 to serve indirect address application WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 2 V\u3001Z Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand \" width=\"577\" height=\"237\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When count control &#8220;EN&#8221; = 1 or has a transition from 0 to 1( P instruction), then among the 16L bits of the Ms matrix, this instruction will count the total amount of bits with a status of 1 (when input &#8220;1\/0&#8221; = 1) or the total amount of bits with a status of 0 (when input &#8220;1\/0&#8221; = 0). The results of the counting will be stored into the register specified by D. If the value of these amounts is 0, then the Result-is-0 flag &#8220;D = 0&#8221; will be set to<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p130-3.png\" alt=\"1. 130P.MBCNT X0 EN Ms : R 0 D=0 L : 5 X1 1\/0 D : R 0\" width=\"212\" height=\"120\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The program at left sets X1 first as 0 (to count bits with status of 0) and then as 1 (to count bits with status of 1) and let the signal X0 has a transition from 0\u21921 for both case, the execution results are shown at right in the diagram below .<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p130-4.png\" alt=\"Ms15 Ms0 Ms D \u25cf D \u2193 \u2193 R0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X0=\u21b1 R20 64 R20 16 0 R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \u25cf R2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 \u25cf R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X1=0 X1=1 R4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \u2191 \u2191 Ms79 Ms64 Source matrix Count of \u20180\u2019 bit Count of \u20181\u2019 bit\" width=\"517\" height=\"132\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN139 HSPWM HIGH SPEED PULSE WIDTH MODULATION OUTPUT<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p131-1.png\" alt=\"PW : PWM output ( 0 = Y0\u30011 = Y2\u30012 = Y4\u30013 = Y6 ) Op : Output polarity ; 0 = Normal 1 = Inverse of output RS : Resolution ; 0 = 1\/100 (1%) 1 = 1\/1000 (0.1%) Pn : Setting of output frequency( 0~255 ) OR : Setting register of output pulse width ( 0~100 or 0~1000) WR : Working register Y WX WY WM WS TMR \" width=\"652\" height=\"390\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The setting of resolution(RS) must be same between output0(Y0) and output1(Y2) also the setting of output frequency(Pn). It means both output0 and output1 have the same output frequency and the same output resolution, only the pulse width can be different. Same principle for output2(Y4) and output3(Y6).<\/p>\n<p>\u25cf When operation control \u201cEN\u201d = 1, the specified digital output will perform the PWM output, the expression for output frequency as shown bellow:<\/p>\n<p>184320<\/p>\n<p>1. f =<\/p>\n<p>while Rs(Resolution)=1\/100<\/p>\n<p>pwm (P +)1<\/p>\n<p>n<\/p>\n<p>18432<\/p>\n<p>2. f =<\/p>\n<p>while Rs(Resolution)=1\/1000<\/p>\n<p>pwm (P +)1<\/p>\n<p>n<\/p>\n<p>Example 1 : If Pn ( Setting of output frequency ) = 50, Rs = 0( 1\/100 ), then<\/p>\n<p>184320<\/p>\n<p>fpwm =<\/p>\n<p>=3614.117\u2027\u2027\u2027 \u22523.6KHz<\/p>\n<p>(50 +1)<\/p>\n<p>1<\/p>\n<p>T(Period)= \u2252277uS<\/p>\n<p>fpwm<\/p>\n<p>For Rs = 1\/100, if OR( Setting of output pulse width ) = 1, then T0 2.7uS; if OR( Setting of output pulse width )<\/p>\n<p>\u2252<\/p>\n<p>= 50, then To \u2252 140uS.<\/p>\n<p>.Output waveform :<\/p>\n<p>(1).Pn ( Output frequency ) = 50, Rs = 0 ( 1\/100 ), OR ( Output pulse width ) = 1 :<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<h4>FUN139 HSPWM HIGH SPEED PULSE WIDTH MODULATION OUTPUT<\/h4>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>To \u22522.7usec<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p132-1.png\" alt=\"Tp \u2252277usec\" width=\"408\" height=\"102\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>(2).Pn ( Output frequency ) = 50, Rs = 0 ( 1\/100 ), OR ( Output pulse width ) = 50 :<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p132-2.png\" alt=\"Example 2 : If Pn ( Setting of output frequency ) = 200, Rs = 1( 1\/1000 ), then 18432 fpwm = 91.7Hz \u2252 (200 +1)\" width=\"453\" height=\"216\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>1<\/p>\n<p>T(Period)=<\/p>\n<p>10.9mS<\/p>\n<p>\u2252<\/p>\n<p>fpwm<\/p>\n<p>For Rs = 1\/1000, if OR( Setting of output pulse width ) = 10, then T0 \u2252109uS; if OR( Setting of output pulse width ) = 800, then To \u2252 8.72mS<\/p>\n<p>.Output waveform :<\/p>\n<p>(1).Pn ( Output frequency ) = 200, Rs = 1 ( 1\/1000 ), OR ( Output pulse width ) = 10 :<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p132-3.png\" alt=\"(2).Pn ( Output frequency ) = 200, Rs = 1 ( 1\/1000 ), OR ( Output pulse width ) = 800 :\" width=\"631\" height=\"338\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN140 HSPSO HIGH SPEED PULSE OUTPUT INSTRUCTION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p133-1.png\" alt=\"Ps : The Pulse Output (0\uff5e3) selection 0:Y0 &amp; Y1 1:Y2 &amp; Y3 2:Y4 &amp; Y5 3:Y6 &amp; Y7 SR : Positioning program starting register. WR : Starting working register of instruction operation, total 7 registers, can not used in any other part of program. HR DR ROR K Range R0 D0 R5000 2 \u2223 \u2223 \u2223 \u2223 Ope- R3839 D4095 R8\" width=\"655\" height=\"296\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The NC positioning program of HSPSO (FUN140) instruction is a program written and edited with text. The executing unit of program is divided by step (which includes output frequency, traveling distance, and transferring conditions). For one FUN140 instruction, can program 250 steps of positioning points at the most. Each step of positioning program requires 9 registers. For detailed application, please refer to chapter 13 \u201cthe NC positioning control of FBs-PLC\u201d.<\/p>\n<p>\u25cf The benefits of storing the positioning program in the register is that, while in application which use the MMI (man machine interface) as the operation console can save the positioning programs to MMI. Whenever the change of the positioning programs is requested, the download of positioning program can be simply done by a series of write register commands.<\/p>\n<p>\u25cf The NC positioning of this instruction doesn\u2019t provide the linear interpolation function.<\/p>\n<p>\u25cf When execution control \u201cEN\u201d=1, if Ps0\uff5e3 is not controlled by other FUN140 instruction (the status of Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 is ON respectively), it will start to execute from the next step of positioning point (when goes to the last step, it will be restarted from the first step); if Ps0\uff5e3 is controlled by other FUN140 instruction (the status of Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 are OFF), this instruction will wait and acquires the control right of output point immediately right after other FUN140 release the output.<\/p>\n<p>\u25cf When execution control input \u201cEN\u201d =0, it stops the pulse output immediately.<\/p>\n<p>\u25cf When output pause \u201cPAU\u201d =1 and execution control was 1, it will pause the pulse output. When output pause \u201cPAU\u201d =0 and execution control is still 1, it will continue the unfinished pulse output.<\/p>\n<p>\u25cf When output abort \u201cABT\u201d=1, it will halt and stop pulse output immediately. (When the execution control input \u201cEN\u201d becomes 1 next time, it will restart from the first step of positioning point to execute.)<\/p>\n<p>\u25cf While send the output pulse, the output indication \u201cACT\u201d is ON.<\/p>\n<p>\u25cf When there is an execution error, the output indication \u201cERR\u201d will be ON. (The error code is stored in the error code register.)<\/p>\n<p>\u25cf When the execution of each step of positioning program is completed, the output indication \u201cDN\u201d will be ON.<\/p>\n<p>*** The working mode of Pulse Output must be configured (without setting, Y0\uff5eY7 will be treated as normal output) to any one of following modes, before the HSPSO instruction can be worked.<\/p>\n<p>U\/D Mode: Y0 (Y2, Y4, Y6), as up pulse.<\/p>\n<p>Y1 (Y3, Y5, Y7), as down pulse.<\/p>\n<p>K\/R Mode: Y0 (Y2, Y4, Y6), as the pulse out..<\/p>\n<p>Y1 (Y3, Y5, Y7), as the direction.<\/p>\n<p>A\/B Mode: Y0 (Y2, Y4, Y6), as A phase pulse.<\/p>\n<p>Y1 (Y3, Y5, Y7), as B phase pulse.<\/p>\n<p>hThe output polarity for Pulse Output can select to be Normally ON or Normally OFF.<\/p>\n<p>hThe working mode of Pulse Output can be configured by WINPROLADDER in \u201cOutput Setup\u201d setting page. FUN141<\/p>\n<p>NC POSITIONING PARAMETER VALUE SETTING<\/p>\n<h4>FUN141 MPARA (Brief description on function)<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p134-1.png\" alt=\"\" width=\"273\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Ps : The pulse output (0\uff5e3) selection<\/p>\n<p>SR : Starting register for parameter table; it has 18 parameters totally, and occupy 24 registers.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p134-2.png\" alt=\"HR DR ROR K Range R0 D0 R5000 2 \u2223 \u2223 \u2223 \u2223 Ope- R3839 D4095 R8071 256 rand Ps 0\uff5e3 SR \u25cb \u25cb \u25cb\" width=\"201\" height=\"90\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p134-3.png\" alt=\"Operation descriptions\" width=\"655\" height=\"26\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>hIt is not necessary to use this instruction. if the system default for parameter values is matching what user demanded, then this instruction is not needed. However, if it needs to change the parameter value dynamically, this instruction is required.<\/p>\n<p>hThis instruction incorporates with FUN140 or FUN147 for positioning control purpose.<\/p>\n<p>hWhether the execution control input \u201cEN\u201d = 0 or 1, this instruction will be performed.<\/p>\n<p>hWhen there are any errors in parameter value, the output indication \u201cERR\u201d will be ON. (The error code is stored in the error code register.)<\/p>\n<p>hFor detailed functional description and usage, please refer to Chapter 11 \u201cThe NC positioning control of FBs-PLC\u201d for explanation.<\/p>\n<h4>FUN142 P PSOFF (Brief description on function)<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p135-2.png\" alt=\"Ps : 0\uff5e3 Enforce the Pulse Output PSOn (n= Ps) to stop. Command descriptions\" width=\"655\" height=\"122\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control \u201cEN\u201d =1 or changes from 0\u21921( P instruction), this instruction will enforce the assigned number set of HSPSO (High Speed Pulse Output) to stop pulse output.<\/p>\n<p>\u25cf While in the application for mechanical original point reset, as soon as reach the original point can use this instruction to stop the pulse output immediately, so as to make the original point stop at the same position every time when performing mechanical original point resetting.<\/p>\n<p>\u25cf For detailed functional description and usage, please refer to Chapter 11 \u201cThe NC positioning control of FBs-PLC\u201d for explanation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p136-1.png\" alt=\"FUN143 P PSCNV\" width=\"85\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>CONVERT THE CURRENT PULSE VALUE TO DISPLAY VALUE<\/p>\n<p>FUN143 P<\/p>\n<p>(mm, Deg, Inch, PS) (Brief description on function)<\/p>\n<p>PSCNV<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p136-2.png\" alt=\"\" width=\"233\" height=\"130\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Ps : 0\uff5e3; it converts the number of the pulse position to be the mm (Deg, Inch, PS) that has same unit as the set value, so as to make current position displayed.<\/p>\n<p>D : Register that stores the current position after<\/p>\n<p>conversion. It uses 2 registers, e.g. if D = D10, which means D10 is Low Word and D11 is High Word.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p136-3.png\" alt=\"HR DR ROR K Range R0 D0 R5000 2 Ope- \u2223 \u2223 \u2223 \u2223 rand R3839 D4095 R8071 256 Ps 0 \uff5e3 D \u25cb \u25cb \u25cb\" width=\"216\" height=\"95\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p136-4.png\" alt=\"Command descriptions\" width=\"655\" height=\"26\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution control \u201cEn\u201d =1 or changes from 0\u21921( P instruction), this instruction will convert the assigned current pulse position (PS) to be the mm (or Deg, Inch, or PS) that has same unit as the set value, so as to make current position displaying.<\/p>\n<p>\u25cf Only when the FUN140 instruction is executed, then it can get the correct conversion value by executing this instruction.<\/p>\n<p>\u25cf For detailed functional description and usage, please refer to Chapter 11 \u201cThe NC positioning control of FBs-PLC\u201d for explanation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p137-1.png\" alt=\"FUN145 P EN\" width=\"83\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN145 P<\/p>\n<p>ENABLE CONTROL OF THE INTERRUPT AND PERIPHERAL<\/p>\n<p>EN<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p137-2.png\" alt=\"LBL : External input or peripheral label name that to be enabled. \u25cf When enable control \u201cEN\u201d =1 or changes from 0\u21921 ( P instruction), it allows the external input or peripheral interrupt action which is assigned by LBL.\" width=\"611\" height=\"129\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The enabled interrupt label name is as follows:(Please refer the section 9.3 for details)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p137-3.png\" alt=\"LBL name Description LBL name Description LBL name Description HSTA High speed X4 positive edge X10 positive edge HSTAI X4+I X10+I counter interrupt interrupt interrupt HSC0 High speed X5 negative edge X10 negative edge X4\u2212I X10\u2212I HSC0I counter interrupt interrupt interrupt HSC1 High speed X5 positi\" width=\"583\" height=\"447\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf In practical application, some interrupt signals should not be allowed to work at sometimes, however, it should be allowed to work at some other times. Employing FUN146 (DIS) and FUN145 (EN) instructions could attain the above mentioned demand.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p137-4.png\" alt=\"Program example M0 145P. EN EN X0+I\" width=\"242\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When M0 changes from 0\u21921, it allows X0 to send interrupt when X0 changes from 0\u21921. CPU can rapidly process the interrupt service program of X0+I.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p138-1.png\" alt=\"FUN146 P DIS\" width=\"82\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN146 P<\/p>\n<p>DISABLE CONTROL OF THE INTERRUPT AND PERIPHERAL<\/p>\n<p>DIS<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p138-2.png\" alt=\"\" width=\"241\" height=\"79\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>LBL : Interrupt label intended to disable or peripheral name to be disabled.<\/p>\n<p>\u25cf When prohibit control \u201cEN\u201d =1 or changes from 0\u21921 ( P instruction), it disable the interrupt or peripheral operation designated by LBL.<\/p>\n<p>\u25cf The interrupt label name is as follows:<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>LBL name<\/td>\n<td>Description<\/td>\n<td>LBL name<\/td>\n<td>Description<\/td>\n<td>LBL name<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>HSTAI<\/td>\n<td>HSTA High speed<br \/>counter interrupt<\/td>\n<td>X4+I<\/td>\n<td>X4 positive edge<br \/>interrupt<\/td>\n<td>X10+I<\/td>\n<td>X10 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>HSC0I<\/td>\n<td>HSC0 High speed<br \/>counter interrupt<\/td>\n<td>X4\u2212I<\/td>\n<td>X5 negative edge<br \/>interrupt<\/td>\n<td>X10\u2212I<\/td>\n<td>X10 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>HSC1I<\/td>\n<td>HSC1 High speed<br \/>counter interrupt<\/td>\n<td>X5+I<\/td>\n<td>X5 positive edge<br \/>interrupt<\/td>\n<td>X11+I<\/td>\n<td>X11 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>HSC2I<\/td>\n<td>HSC2 High speed<br \/>counter interrupt<\/td>\n<td>X5\u2212I<\/td>\n<td>X5 negative edge<br \/>interrupt<\/td>\n<td>X11\u2212I<\/td>\n<td>X11 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>HSC3I<\/td>\n<td>HSC3 High speed<br \/>counter interrupt<\/td>\n<td>X6+I<\/td>\n<td>X6 positive edge<br \/>interrupt<\/td>\n<td>X12+I<\/td>\n<td>X12 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X0+I<\/td>\n<td>X0 positive edge<br \/>interrupt<\/td>\n<td>X6\u2212I<\/td>\n<td>X6 negative edge<br \/>interrupt<\/td>\n<td>X12\u2212I<\/td>\n<td>X12 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X0\u2212I<\/td>\n<td>X0 negative edge<br \/>interrupt<\/td>\n<td>X7+I<\/td>\n<td>X7 positive edge<br \/>interrupt<\/td>\n<td>X13+I<\/td>\n<td>X13 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X1+I<\/td>\n<td>X1 positive edge<br \/>interrupt<\/td>\n<td>X7\u2212I<\/td>\n<td>X7 negative edge<br \/>interrupt<\/td>\n<td>X13\u2212I<\/td>\n<td>X13 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X1\u2212I<\/td>\n<td>X1 negative edge<br \/>interrupt<\/td>\n<td>X8+I<\/td>\n<td>X8 positive edge<br \/>interrupt<\/td>\n<td>X14+I<\/td>\n<td>X14 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X2+I<\/td>\n<td>X2 positive edge<br \/>interrupt<\/td>\n<td>X8\u2212I<\/td>\n<td>X8 negative edge<br \/>interrupt<\/td>\n<td>X14\u2212I<\/td>\n<td>X14 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X2\u2212I<\/td>\n<td>X2 negative edge<br \/>interrupt<\/td>\n<td>X9+I<\/td>\n<td>X9 positive edge<br \/>interrupt<\/td>\n<td>X15+I<\/td>\n<td>X15 positive edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X3+I<\/td>\n<td>X3 positive edge<br \/>interrupt<\/td>\n<td>X9\u2212I<\/td>\n<td>X9 negative edge<br \/>interrupt<\/td>\n<td>X15\u2212I<\/td>\n<td>X15 negative edge<br \/>interrupt<\/td>\n<\/tr>\n<tr>\n<td>X3\u2212I<\/td>\n<td>X3 negative edge<br \/>interrupt<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf In practical application, some interrupt signals should not be allowed to work at certain situation. To achieve this, this instruction may be used to disable the interrupt signal.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p138-3.png\" alt=\"Program example M0 146P. X2+I EN DIS\" width=\"249\" height=\"96\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When M0 changes from 0\u21921, it prohibits X2 from sending interrupt when X2 changes from 0\u21921.<\/p>\n<h4>FUN147 MHSPO Multi-Axis High Speed Pulse Output<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p139-1.png\" alt=\"Gp : Group number (0\uff5e1) SR : Starting register for positioning program (example explanation) WR : Starting register for instruction operation (example explanation). It controls 9 registers, which the other program cannot repeat in using. HR DR ROR K Range R0 D0 R5000 Ope- \u2223 \u2223 \u2223 R3839 D3999 R8071 ran\" width=\"617\" height=\"290\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p139-2.png\" alt=\"Instruction Explanation\" width=\"143\" height=\"24\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>1. The FUN147 (MHSPO) instruction is used to support the linear interpolation for multi-axis motion control, it consists of the motion program written and edited with text programming. We named every position point as a step (which includes output frequency, traveling distance, and transfer conditions). Every step of positioning point owns 15 registers for coding.<\/p>\n<p>2. The FUN147 (MHSPO) instruction can support up to 4 axes for simultaneous linear interpolation; or 2 sets of 2-axis linear interpolation (i.e. Gp0 = Axes Ps0 &amp; Ps1 ; Gp1 = Axes Ps2 &amp; Ps3)<\/p>\n<p>3. The best benefit to store the positioning program into the registers is that in the case of association with MMI (Man Machine Interface) to operate settings, it may save and reload the positioning program via MMI when replacing the molds.<\/p>\n<p>4. When execution control \u201cEN\u201d=1, if the other FUN147\/FUN140 instructions to control Ps0\uff5e3 are not active (corresponding status of Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 will be ON), it will start to execute from the next step of positioning point (when goes to the last step, it will be restarted from the first step to perform); if Ps0\uff5e3 is controlled by other FUN147\/FUN140 instruction (corresponding status of Ps0=M1992, Ps1=M1993, Ps2=M1994, and Ps3=M1995 would be OFF), this instruction will acquire the pulse output right of positioning control once the controlling FUN147\/FUN140 has released the control right.<\/p>\n<p>5. When execution control input \u201cEN\u201d =0, it stops the pulse output immediately.<\/p>\n<p>6. When output pause \u201cPAU\u201d =1 and execution control \u201cEN\u201d was 1 beforehand, it will pause the pulse output. When output pause \u201cPAU\u201d =0 and execution control is still 1, it will continue the unfinished pulse output.<\/p>\n<p>7. When output abort \u201cABT\u201d=1, it stops pulse output immediately. (When the execution control input \u201cEN\u201d becomes 1 next time, it will restart from the first step of positioning point to execute.)<\/p>\n<p>8. While the pulse is in output transmitting, the output indication \u201cACT\u201d is ON.<\/p>\n<p>9. When there is execution error, the output indication \u201cERR\u201d will be ON.<\/p>\n<p>(The error code is stored in the error code register.)<\/p>\n<p>10. When each step of positioning point is complete, the output indication \u201cDN\u201d will be ON.<\/p>\n<p>11. Please refer to Chapter 11 \u201cThe NC Positioning Control of FBs-PLC\u201d for further details.<\/p>\n<h4>FUN148 MPG MANUAL PULSE GENERATOR FOR POSITIONING<\/h4>\n<p>Execution EN Sc : ACT Ps \uff1aAxis of pulse output; 0~3<\/p>\n<p>Fo \uff1aSetting of output speed (2 registers)<\/p>\n<p>Ps :<\/p>\n<p>Mr \uff1aSetting of multiplier (2 registers)<\/p>\n<p>Fo :<\/p>\n<p>Mr+0\uff1aMultiplicand (Fa)<\/p>\n<p>Mr :<\/p>\n<p>Mr+1\uff1aDividend (Fb)<\/p>\n<p>WR\uff1aStarting address of working registers, it needs<\/p>\n<p>WR :<\/p>\n<p>4 registers<\/p>\n<p>\uff0aThis instruction can be supported in PLC OS firmware V4.60 or late<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p140-1.png\" alt=\"HR ROR DR K Range Operand R0 R5000 D0 \u2223 \u2223 \u2223 16 bit R3839 R8071 D3999 Sc \u25cb \u25cb \u25cb 0~7 Ps \u25cb \u25cb \u25cb 0~3 Fo \u25cb \u25cb \u25cb Mr \u25cb \u25cb \u25cb WR \u25cb \u25cb* \u25cb\" width=\"190\" height=\"144\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf Let this instruction be executed in 50mS fixed time interrupt service routine (50MSI)\u3001or by using the 0.1mS high speed timer to generate 50mS fixed time interrupt service to have accurate repeat time to sample the pulse input from manual pulse generator. If it comes the input pulses, it will calculate the number of pulses needing to output according to the setting of multiplier (Mr+0 and Mr+1), and then outputs the pulse stream in the speed of setting (Fo) during this time interval. The setting of output speed (Fo) must be fast enough, and the acceleration \/ deceleration rate ( Parameter 4 and parameter 8 of FUN141 instruction) must be sharp to guarantee it can complete the sending of pulse stream during the time interval if it is under high multiplier (100 or 200 times) situation.<\/p>\n<p>\u25cf When execution \u301dEN\u301e=1, this instruction will sample the pulse input from manual pulse generator by reading the current value of assigned high speed counter every time interval; it doesn\u2019t have any output if it doesn\u2019t have any input pulse; but If it senses the input pulses, it will calculate the number of pulses needing to output according to the setting of multiplier (Mr+0 and Mr+1), and then outputs the pulse stream in the speed of setting (Fo) during this time interval.<\/p>\n<p>Number of output pulses = (Number of input pulses \u00d7 Fa) \/ Fb<\/p>\n<p>\u25cf This instruction also under the control of hardware resource management; it wouldn\u2019t be executed if the hardware is occupied.<\/p>\n<p>\u25cf The output indicator ACT=1 if it outputs the pulses; otherwise ACT=0.<\/p>\n<p>\u25cf Please refer to Chapter 11 \u201cThe NC Positioning Control of FBs-PLC\u201d for further details.<\/p>\n<p>50mS<\/p>\n<p>50mS<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p140-2.png\" alt=\"\" width=\"36\" height=\"13\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p140-3.png\" alt=\"\" width=\"36\" height=\"13\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p140-4.png\" alt=\"\" width=\"36\" height=\"13\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p140-5.png\" alt=\"\" width=\"36\" height=\"13\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\uff0eSample pulse input<\/p>\n<p>\uff0eSample pulse input<\/p>\n<p>\u2026<\/p>\n<p>\uff0eOutput pulse stream<\/p>\n<p>\uff0eOutput pulse stream<\/p>\n<p>in the speed of Fo<\/p>\n<p>in the speed of Fo<\/p>\n<h4>FUN150 M-BUS MODBUS MASTER INSTRUCTION<\/h4>\n<p>\uff08WHICH MAKES PLC AS THE MODBUS MASTER THROUGH PORT 1~4\uff09<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p141-1.png\" alt=\"Pt \uff1a1~4, specify the communication port being acted as the Modbus master SR\uff1aStarting register of communication program WR :Starting register for instruction operation. It controls 8 registers, the other programs can not repeat in using. HR ROR DR K Range R0 R5000 D0 Ope- \u2223 \u2223 \u2223 R3839 R8071 D4095 rand\" width=\"652\" height=\"304\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>1. FUN150 (M-BUS) instruction makes PLC act as Modbus master through Port 1\uff5e4, thus it is very easy to communicate with the intelligent peripheral with Modbus RTU\/ASCII protocol.<\/p>\n<p>2. The master PLC may connect with 247 slave stations through the RS-485 interface.<\/p>\n<p>3. Only the master PLC needs to use Modbus RTU\/ASCII instruction.<\/p>\n<p>4. It employs the program coding method or table filling method to plan for the data flow controls; i.e. from which one of the slave station to get which type of data and save them to the master PLC, or from the master PLC to write which type of data to the assigned slave station. It needs only seven registries to make definition; every seven registers define one packet of data transaction.<\/p>\n<p>5. When execution control \u301dEN\u301echanges from 0\u21921 and both inputs Pause \u201cPAU\u201d and Abort \u201cABT\u201d are 0, and if Port 1\/2\/3\/4 hasn\u2019t been controlled by other communication instructions [i.e. M1960 (Port1) \/ M1962 (Port2) \/ M1936 (Port3) \/ M1938 (Port4) = 1], this instruction will control the Port 1\/2\/3\/4 immediately and set the M1960\/M1962\/M1936\/M1938 to be 0 (which means it is being occupied), then going on a packet of data transaction immediately. If Port 1\/2\/3\/4 has been controlled (M1960\/M1962\/M1936\/M1938 = 0), then this instruction will enter into the standby status until the controlling communication instruction completes its transaction or pause\/abort its operation to release the control right (M1960\/M1962\/M1936\/M1938 =1), and then this instruction will become enactive, set M1960\/M1962\/M1936\/M1938 to be 0, and going on the data transaction immediately.<\/p>\n<p>6. While in transaction processing, if operation control \u201cABT\u201d becomes 1, this instruction will abort this transaction immediately and release the control right (M1960\/M1962\/M1936\/M1938 = 1). Next time, when this instruction takes over the transmission right again, it will restart from the first packet of data transaction.<\/p>\n<p>7. While\u301dA\/R\u301e=0\uff0cModbus RTU protocol\uff1b\u301dA\/R\u301e=1\uff0cModbus ASCII protocol\u3002<\/p>\n<p>8. While it is in the data transaction, the output indication \u201cACT\u201d will be ON.<\/p>\n<p>9. If there is error occurred when it finishes a packet of data transaction, the output indication \u201cDN\u201d &amp; \u201cERR\u201d will be ON.<\/p>\n<p>10. If there is no error occurred when it finishes a packet of data transaction, the output indication \u201cDN\u201d will be ON.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p142-1.png\" alt=\"COMMUNICATION LINK INSTRUCTION FUN 151 FUN 151 (WHICH MAKES PLC ACT AS THE MASTER STATION IN CPU LINK NETWORK CLINK CLINK THROUGH PORT 1~4) Pt : Assign the port, 1\uff5e4 MD : Communication mode, MD0~MD3 SR : Starting register of communication table (see example for its explanation) WR : Starting registe\" width=\"655\" height=\"379\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf This instruction provides 4 instruction modes MD0\uff5eMD3. Of which, three instruction modes MD0\uff5eMD2, are \u201cregular link network\u201d, and the MD3 is the \u201chigh speed link network\u201d. The following are the function description of respective modes.<\/p>\n<p>hMD0 : Master station mode for FATEK CPU LINK.<\/p>\n<p>For any PLC, whose ladder program contains the FUN151:MD0 instruction, will become master station of FATEK CPU LINK network. The master station PLC will base on the communication program stored in data registers in which the target station, data type, data length, etc, were specified to read or write slave station via \u201cFATEK FB-PLC Communication Protocol\u201d command. With this approach up to 254 PLC stations can share the data each other<\/p>\n<p>hMD1 : Active ASCII data transmission mode.<\/p>\n<p>With this mode, the FUN151 instruction will parse the communication program stored in data registers and base on the parsing result send the data from port2 to ASCII peripherals (such as computer, other brand PLC, inverter, moving sign, etc, this kind of device can command by ASCII message). The operation can set to be (1) transmit only, which ignores the response from peripherals, (2) transmit and then to receive the response from peripherals. When operate with mode (2) then the user must base on the communication protocol of peripheral to parsing and prepare the response message by writing the ladder instructions.<\/p>\n<p>hMD2 : Passive ASCII data receiving mode.<\/p>\n<p>With this mode, the FUN151 will first wait to receive ASCII messages sent by external ASCII peripherals (such as computer, other brand PLC, card reader, bar code reader, electronic weight, etc. this kind of device can send ASCII message). Upon receiving the message, the user can base on the communication protocol of peripheral to parsing and react accordingly. The operation can set to (1) receive only without responding, or (2) receive then responding. For operation mode (2) the user can use the table driver method to write a communication program and after received a message this instruction can base on this communication program automatically reply the message to peripheral.<\/p>\n<p>hMD3 : Master station mode of FATEK high speed CPU LINK.<\/p>\n<p>The most distinguished difference between this mode and MD0 is that the communication response of MD3 is much faster than MD0. With The introduction of MD3 mode CPU LINK, The FATEK PLC can easily to implement the application of distributed control and real time data monitoring.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p143-1.png\" alt=\"FUN160 D P RWFR\" width=\"95\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p143-2.png\" alt=\"FUN160 D P RWFR\" width=\"91\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>READ\/WRITE FILE REGISTER<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p143-3.png\" alt=\"Ladder symbol 160DP.RWFR Sa : Operation control EN ERR Range Error Sb : Pr : Read\/Write R\/W L : Increment INC\" width=\"323\" height=\"153\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Sa: Starting address of data register<\/p>\n<p>Sb: Starting address of file register<\/p>\n<p>Pr : Record pointer register<\/p>\n<p>L : Quantity of register to form a record, 1~511 Sa operand can combine V\u3001Z\u3001P0~P9 for index addressing.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p143-4.png\" alt=\"FR WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR Range WX0 WY0 WM0 WS0 T0 C0 R0 R3840 R3904 R3968 R5000 D0 V\u3001Z F0 Ope- \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 rand WX240 WY240 WM1896 WS984 T255 C255 R3839 R3903 R3967 R4167 R8071 D4095 P0\uff5eP9 F8191 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb Pr \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb* \u25cb* \u25cb L \u25cb* \u25cb 1~5\" width=\"652\" height=\"158\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When operation control &#8220;EN&#8221;=1 or changes from 0\u21921( P instruction), it will perform the read (&#8220;R\/W&#8221;=1) or write (&#8220;R\/W&#8221;=0) file register operation. While reading, the content of data registers starting from Sa will be overwritten by the content of file registers addressed by the base file register Sb and record pointer Pr; while writing, the content of file registers addressed by the base file register Sb and record pointer Pr will be overwritten by the content of data registers starting from Sa; L is the operation quantity or record size. The access of file register adopts the concept of RECORD data structure to implement. For example, Sa=R0, Sb=F0, L=10, the read\/write details shown as below<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p143-5.png\" alt=\"Sb F0 ~ F9 Pr = 0 (L=10) Sa F10 ~ F19 Pr = 1 (L=10) R0 ~ R9 F20 ~ F29 Pr = 2 (L=10) (L=10) F30 ~ F39 Pr = 3 (L=10)\" width=\"316\" height=\"245\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p144-1.png\" alt=\"FUN160 D P FUN160 D P READ\/WRITE FILE REGISTER RWFR RWFR\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf For ladder program application, only this instruction can access the file registers.<\/p>\n<p>\u25cf The record pointer will be increased by 1 after execution while pointer control input &#8220;INC&#8221;=1.<\/p>\n<p>\u25cf This instruction will not be executed and error indicator \u201dERR&#8221; will be 1 while incorrect record size (L=0 or &gt; 511) or the operation out of the file register&#8217;s range (F0\uff5eF8191).<\/p>\n<p>.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p144-2.png\" alt=\"160P.RWFR M10 M0 EN Sa : R0 ERR Sb : F100 R\/W Pr : D0 L : 50 INC\" width=\"254\" height=\"123\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>When M0 changes from 0\u25cf1, if D0 =2, the contents of file registers F200~F249 will be overwritten by the content of data registers R0~R49. the record length is 50.<\/p>\n<p>.Pointer will be increased by 1 after operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p144-3.png\" alt=\"160P.RWFR M10 M0 Sa : R0 ERR EN Sb : F100 Pr : D0 R\/W L : 50 INC\" width=\"254\" height=\"123\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>.When M0 changes from 0\u25cf1, if D0 = 1, the content of data registers R0~R49 will be overwritten by the file registers F150~F199.<\/p>\n<p>.The record pointer will be increased by 1 after operation.<\/p>\n<h4>FUN161 P WR-MP Write Data Record into the MEMORY_PACK<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p145-1.png\" alt=\"S \uff1aStarting address of the source data BK\uff1aBlock number of the MEMORY_PACK\uff0c0\uff5e1 Os\uff1aOffset of the block Pr\uff1aAddress of the pointer L\uff1aQuantity of writing\uff0c1\uff5e128 WR\uff1aStarting address of working registers, it takes 2 registers S may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application HR ROR DR K XR Ra\" width=\"619\" height=\"335\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The main purpose of the MEMORY_PACK of FBs series&#8217;s is used for long term storing of the user&#8217;s ladder program, except this, through the FUN161\/FUN162 instructions, the MEMORY_PACK can be worked as the portable MEMORY_PACK for machine working parameters&#8217;s saving and loading.<\/p>\n<p>When execution control\u301dEN\u301echanges from 0\u21921, it will perform the data writing, where S is the starting address of the source data, BK is the block number of the MEMORY_PACK to store this writing, Os is the offset of specified block, Pr is the pointer to point to corresponding data area, L is the quantity of this writing. The access of MEMORY_PACK manipulation adopts the concept of RECORD data structure to implement with. The working diagram as shown below :<\/p>\n<p>MEMORY_PACK<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p145-2.png\" alt=\"\u25cf When input &quot;INC&quot; = 1, the content of the pointer will be increased by one after the execution of writing, it points to next record.\" width=\"633\" height=\"324\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p146-1.png\" alt=\"FUN161P Write Data Record into the MEMORY_PACK FUN161P WR-MP \uff08Write memory pack\uff09 WR-MP\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf If the value of L is equal to 0 or greater than 128, or the pointed data area over the range, the output &#8220;ERR&#8221; will be 1, it will not perform the writing operation.<\/p>\n<p>\u25cf It needs couple of PLC solving scans for data writing and verification; during the execution, the output &#8220;ACT&#8221; will be 1; when completing the execution and verification without the error, the output &#8220;DN&#8221; will be 1; when completing the execution and verification with the error, the output &#8220;ERR&#8221; will be 1.<\/p>\n<p>The MEMORY_PACK can be configured to store the user&#8217;s ladder program or machine&#8217;s working parameters, or both. The ladder program can be stored into the block 0 only, but the machine&#8217;s working parameters can be stored into block 0 or 1; the memory capacity of each block has 32K Word in total.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p146-2.png\" alt=\"Example program : Writing the record into block 1 of MEMORY_PACK with the different length 161P.WR_MP M100 M1 EN S : R0 ACT Bk : 1 M101 M2 0 ERR INC Os : M102 Pr : D1 DN L : 20 WR: R2900 161P.WR_MP M103 M3 EN S : R100 ACT Bk : 1 M104 M4 INC Os : 10000 ERR M105 Pr : D2 DN L : 50 R2910 WR:\" width=\"529\" height=\"294\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p146-3.png\" alt=\"MEMORY_PACK Block 1 Head of Block 1 Write Os = 0 The length is 20 The RECORD starts from R0, Pr = 0 the length is 20(R0~R19) of RECORD 0 The length is 20 Pr = 1 of RECORD 1 \u2022 \u2022 \u2022 \u2022 \u2022 The length is 20 Pr = 499 of RECORD 499 Os = 9999 Write Os = 10000 The RECORD starts from R100, The length is 50 Pr =\" width=\"512\" height=\"382\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p147-1.png\" alt=\"FUN162 P RD-MP\" width=\"87\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Read Data Record from the MEMORY_PACK<\/p>\n<h4>FUN162 P RD-MP \uff08Read memory pack\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p147-2.png\" alt=\"BK\uff1aBlock number of the MEMORY_PACK\uff0c0\uff5e1 Os\uff1aOffset of the block Pr\uff1aAddress of the pointer L\uff1aQuantity of reading\uff0c1\uff5e128 D\uff1aStarting address to store the reading record HR ROR DR K Range Operand R0 R5000 D0 \u2223 \u2223 \u2223 R3839 R8071 D3999 BK 0\uff5e1 Os \u25cb \u25cb \u25cb 0\uff5e32510 Pr \u25cb \u25cb* \u25cb L \u25cb \u25cb* \u25cb 1\uff5e128 D \u25cb \u25cb* \u25cb\" width=\"564\" height=\"299\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf If the MEMORY_PACK of the FBs series&#8217;s has stored the data record written by the FUN161 instruction, they can be read out for machine&#8217;s working through this instruction, it will reduce the tuning time for machine operation.<\/p>\n<p>\u25cf When execution control &#8220;EN&#8221; = 1 or from 0\u21921( P instruction), it will perform the data reading, where BK is the block number of the MEMORY_PACK storing the record, Os is the offset of specified block, Pr is the pointer to point to corresponding data area, L is the quantity of this record, and D is the starting address to stor this reading of record. The access of MEMORY_PACK manipulation adopts the concept of RECORD data structure to implement with.<\/p>\n<p>The working diagram as shown below:<\/p>\n<p>MEMORY_PACK<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p147-3.png\" alt=\"Block 0 Block 1 Head of Block 0 Head of Block 1 Os = 0 The length is L The length is L Pr = 0 of RECORD 0 of RECORD 0 The length is L The length is L Pr = 1 The RECORD strats from D, of RECORD 1 of RECORD 1 Read the length is L. The length is L The length is L Pr = 2 of RECORD 2 of RECORD 2 \u2022 \u2022 \u2022 \u2022 \" width=\"620\" height=\"254\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When input &#8220;INC&#8221;=1, the content of the pointer will be increased by one after the execution of reading, it points to next record.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p148-1.png\" alt=\"FUN162 P Read Data Record from the MEMORY_PACK FUN162 P RD-MP \uff08Read memory pack\uff09 RD-MP\" width=\"655\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf If the value of L is equal to 0 or greater than 128, or the pointed data area over the range, the output &#8220;ERR&#8221; will be 1, it will not perform the reading operation.<\/p>\n<p>\u25cf Output will be \u201cERR\u201d if MEMORY_PACK is empty or data format not correct, and user used FUN162 to read data from MEMORY_PACK.<\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<p>Example program : Reading the record from block 1 of MEMORY_PACK with the different length<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u203b It is necessary that correct data in MEMORY_PACK or this example can\u2019t execute correctly.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p148-2.png\" alt=\"162P.RD_MP M110 M10 EN Bk : 1 ERR Os : 0 M11 INC Pr : D10 L : 20 D : R0 162P.RD_MP M111 M12 EN Bk : 1 ERR 10000 Os : M13 INC Pr : D11 50 L : D : R100\" width=\"327\" height=\"239\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p148-3.png\" alt=\"\" width=\"547\" height=\"451\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-1.png\" alt=\"FUN170 D =\" width=\"85\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>EQUAL TO COMPARE<\/p>\n<h4>FUN170 D \uff08Compare whether Sa is equal to Sb\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-2.png\" alt=\"170D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN = Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa=Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-5.png\" alt=\"\" width=\"597\" height=\"93\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When R0=R2\u3001R4=R6 and M0=1, the output status of Y0 is 1; otherwise it is 0<\/p>\n<p>R0=R2\u3001R8=R10 and M1=1, the output status of Y1 is 1; otherwise it is 0<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-6.png\" alt=\"Example 2\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p149-7.png\" alt=\"\" width=\"596\" height=\"125\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612\u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-1.png\" alt=\"FUN171 D &gt;\" width=\"82\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>GREATER THAN COMPARE<\/p>\n<h4>FUN171 D \uff08Compare whether Sa is greater than Sb\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-2.png\" alt=\"171D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN &gt; Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa&gt;Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-5.png\" alt=\"\" width=\"596\" height=\"74\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M10=1\u3001R20 &gt; R22 or M11=1, the output status of Y2 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-6.png\" alt=\"Example 2\uff1a\" width=\"98\" height=\"26\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p150-7.png\" alt=\"\" width=\"596\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612\u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-1.png\" alt=\"FUN172 D &lt;\" width=\"85\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>LESS THAN COMPARE<\/p>\n<h4>FUN172 D \uff08Compare whether Sa is less than Sb\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-2.png\" alt=\"172D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN &lt; Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa&lt;Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-5.png\" alt=\"\" width=\"590\" height=\"73\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M10=1\u3001R20 &lt; R22 or M11=1, the output status of Y2 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-6.png\" alt=\"Example 2\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p151-7.png\" alt=\"\" width=\"596\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612 \u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-1.png\" alt=\"FUN173 D &lt; &gt;\" width=\"82\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>NOT EQUAL TO COMPARE<\/p>\n<h4>FUN173 D \uff08Compare whether Sa is not equal to Sb\uff09<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-2.png\" alt=\"173D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN &lt;&gt; Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa\u2260Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-5.png\" alt=\"\" width=\"597\" height=\"83\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M10=1\u3001R20\u2260R22 or M11=1, the output status of Y2 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-6.png\" alt=\"Example 2\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p152-7.png\" alt=\"\" width=\"596\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612\u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-1.png\" alt=\"FUN174 D &gt;=\" width=\"85\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>GREATER THAN OR EQUAL TO COMPARE<\/p>\n<p>FUN174 D<\/p>\n<p>\uff08Compare whether Sa is greater than or equal to Sb\uff09<\/p>\n<p>&gt;=<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-2.png\" alt=\"174D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN &gt;= Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa\u2267Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-5.png\" alt=\"\" width=\"597\" height=\"76\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M10=1\u3001R20\u2267R22 or M11=1, the output status of Y2 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-6.png\" alt=\"Example 2\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p153-7.png\" alt=\"\" width=\"596\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612 \u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-1.png\" alt=\"FUN175 D =&lt;\" width=\"82\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>LESS THAN OR EQUAL TO COMPARE<\/p>\n<p>FUN175 D<\/p>\n<p>\uff08Compare whether Sa is less than or equal to Sb\uff09<\/p>\n<p>=&lt;<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-2.png\" alt=\"175D. Sa Sa\uff1aOperand A or the starting address of Sa Sb\uff1aOperand B or the starting address of Sb Execution EN =&lt; Sb Sa\u3001Sb may combine with V\u3001Z\u3001P0\uff5eP9 for indirect addressing application \uff0aThis instruction can be supported in PLC OS firmware V4.60 or later\" width=\"653\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-3.png\" alt=\"WX WY WM WS TMR CTR HR SR ROR DR K XR Range Operand WX0 WY0 WM0 WS0 T0 C0 R0 R3804 R5000 D0 16\/ 32 bit V\u3001Z \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 \u2223 +\/- number P0~P9 WX240 WY240 WM1896 WS984 T255 C255 R3839 R4167 R8071 D3999 Sa \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb \u25cb\" width=\"506\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf When execution input \u301dEN\u301e=1, this instruction will be executed in signed number to compare Sa with Sb. If Sa\u2266Sb, the output is 1; otherwise the output is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-4.png\" alt=\"Example 1\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-5.png\" alt=\"\" width=\"599\" height=\"76\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M10=1\u3001R20\u2266R22 or M11=1, the output status of Y2 is 1; otherwise it is 0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-6.png\" alt=\"Example 2\uff1a\" width=\"93\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p154-7.png\" alt=\"\" width=\"596\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When DR600=DR602 or DR604&gt;DR606, after them DR608&lt;DR610 and DR616\u2267DR618, or DR612 \u2260DR614 and DR620\u2266DR622, or M200=1and M201=1, and then M100=1, the output status of Y10 is 1; otherwise it is 0.<\/p>\n<h4>FUN190 STAT READ SYSTEM STATUS<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p155-1.png\" alt=\"190.STAT Gp : Specified status group Execution EN Gp : 0 : Get information of I\/O expansion 1~3 : Reserved D :\" width=\"495\" height=\"72\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Starting address of register to store the system status D+0 : Quantity of status<\/p>\n<p>D+1 : Status 1<\/p>\n<p>\u2026<\/p>\n<p>D+N: Status N<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p155-2.png\" alt=\"K HR ROR DR Range Operand R0 R5000 D0 \u2223 \u2223 \u2223 R3839 R8071 D3999 Gp 0~3 D \u25cb \u25cb* \u25cb\" width=\"179\" height=\"97\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\uff0a This instruction can be supported in PLC OS<\/p>\n<p>firmware V4.62 or later<\/p>\n<p>\u25cf When execution \u301dEN\u301e=1, this instruction being executed, and if Gp=0, it means to get the information of I\/O expansion modules; total quantity of I\/O expansion modules will be stored in D register, code of I\/O expansion module will be stored in D+1~D+N registers in order. Gp=1~3, reserved for future.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p155-3.png\" alt=\"Code of I\/O Name of I\/O Code of I\/O Name of I\/O Expansion Expansion Module Expansion Expansion Module Module Module 1 FBs-8XYR 21 FBs-6TC 2 FBs-8X 22 FBs-6RTD 3 FBs-8 YR 23 FBs-16TC 4 FBs-16XYR 24 FBs-16RTD 5 FBs-20X 25 FBs-2TC 6 FBs-16YR 26 FBs-2A4TC 7 FBs-24X 27 FBs-2A4RTD 8 FBs-24Y 28 FBs-6NTC 9 \" width=\"535\" height=\"472\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p156-1.png\" alt=\"FUN190 FUN190 READ SYSTEM STATUS STAT STAT Example\uff1aThere are two I\/O expansion modules FBs-2DA + FBs-6AD installed in one system\" width=\"655\" height=\"209\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p156-2.png\" alt=\"\" width=\"418\" height=\"124\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Description: When M500=1, this instruction being executed, register D200 is used to store the total quantity of I\/O expansion modules, register D201 is used to store the code (17=FBs-2DA) of first I\/O expansion module, register D202 is used to store the code (16=FBs-6AD) of second I\/O expansion module.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-1.png\" alt=\"FUN200 D P I\u25cfF\" width=\"95\" height=\"56\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-2.png\" alt=\"FUN200 D P I\u25cfF\" width=\"91\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>CONVERSION OF INTEGER TO FLOATING POINT NUMBER<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-3.png\" alt=\"\" width=\"242\" height=\"129\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S : Starting register of Integer to be converted<\/p>\n<p>D : Starting register to store the result of conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-4.png\" alt=\"Range HR ROR DR K XR 16\/32 V\u3001Z R0 R5000 D0 bit \u2223 \u2223 \u2223 R3839 R8071 D4095 Integer P0\uff5eP9 Operand S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"652\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System)\u2026page 5-9.<\/p>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert the integer data from S register into D~D+1 32-bits register( floating point number data)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-5.png\" alt=\"200P.I F X0 EN S : R0 D0 D :\" width=\"177\" height=\"76\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-6.png\" alt=\"\u203b R0 = 200 ( 0000000011001000) Integer To Floating DD0 = 43480000H\" width=\"254\" height=\"107\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p157-7.png\" alt=\"0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 R0 : b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 I F 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 00\u20260 0 DD0 : b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 ~ b1 b0 s e e e e e e e e m m m m m m m m mm\u2026m m\" width=\"490\" height=\"140\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-1.png\" alt=\"FUN201 D P F\u25cfI\" width=\"95\" height=\"56\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-2.png\" alt=\"FUN201 D P F\u25cfI\" width=\"91\" height=\"42\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>CONVERSION OF FLOATING POINT NUMBER TO INTEGER<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-3.png\" alt=\"\" width=\"329\" height=\"123\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>S : Starting register of Integer to be converted<\/p>\n<p>D : Starting register to store the result of conversion<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-4.png\" alt=\"Range HR ROR DR XR R0 R5000 D0 V\u3001Z \u2223 \u2223 \u2223 R3839 R8071 D4095 P0\uff5eP9 Operand S \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System)\u2026page 5-9.<\/p>\n<p>\u25cf When conversion control &#8220;EN&#8221; = 1 or has a transition from 0 to 1 ( P instruction), will convert the floating point data from S~S+1 32bits register into D register( integer data ).<\/p>\n<p>\u25cf If the value exceeds the valid range of destination, then do not carry out this instruction, and set the range-error flag \u201cERR\u201d as 1 and the D register will be intact.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-5.png\" alt=\"\u203b DR20 = 123.45 Normalize 42F6E666H Floating To Integer D10 = 007BH\" width=\"329\" height=\"123\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-6.png\" alt=\"201P.F I X2 EN S : R20 ERR D10 D :\" width=\"213\" height=\"76\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p158-7.png\" alt=\"\" width=\"646\" height=\"187\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN202 P FADD FLOATING POINT NUMBER ADDITION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p159-2.png\" alt=\"Sa: Augend Sb: Addend D : Destination register to store the results of the addition Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing Range HR ROR DR K XR Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand Sa \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"652\" height=\"323\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System)\u2026page 5-9.<\/p>\n<p>\u25cf Performs the addition of the data specified at Sa and Sb and writes the results to a specified register D when the add control input &#8220;EN&#8221; =1 or from 0 to 1 ( P instruction). If the result exceed the range that the floating point number can be expressed(\u00b13.4*10 3 8) then the error flag FO0 will be set to 1 and the D register will be intact.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p159-3.png\" alt=\"202P.FADD X0 Sa : R0 ERR Sb : R10 D : R20\" width=\"219\" height=\"93\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p159-4.png\" alt=\"\" width=\"498\" height=\"153\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN203 P FSUB FLOATING POINT NUMBER SUBTRACTION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p160-2.png\" alt=\"Ladder symbol 203P.FSUB Sa: Minuend Sa : Subtraction control EN ERR Ranger Error (FO0) Sb: Subtrahend Sb : D : Destination register to store the results D : of the subtraction Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing\" width=\"618\" height=\"171\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p160-3.png\" alt=\"Range HR ROR DR K XR Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand Sa \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"148\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System)\u2026page 5-9.<\/p>\n<p>\u25cf Performs the subtraction of the data specified at Sa and Sb and writes the results to a specified register D when the subtract control input &#8220;EN&#8221; =1 or from 0 to 1 ( P instruction). If the result exceed the range that the floating point number can be expressed(\u00b13.4*10 3 8) then the error flag FO0 will be set to 1 and the D register will be intact.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p160-4.png\" alt=\"203P.FSUB X0 EN Sa : R0 ERR Sb : R4 D : R10\" width=\"214\" height=\"90\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p160-5.png\" alt=\"Floating Point Number : DR0 DR0 2 0 0 4 3 4 8 0 0 0 0 H\" width=\"497\" height=\"33\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p160-6.png\" alt=\"Floating Point Number : DR4 4 3 F A 0 0 0 0 H\" width=\"383\" height=\"60\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>DR4 5 0 0<\/p>\n<p>DR10 C 3 9 6 0 0 0 0 H<\/p>\n<h4>FUN204 P FMUL FLOATING POINT NUMBER MULTIPLICATION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p161-2.png\" alt=\"204P.FMUL Sa: Multiplicand Sa : Multiplication control EN ERR Ranger Error (FO0) Sb: Multiplier Sb : D : Destination register to store the results D : of the multiplication Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing\" width=\"631\" height=\"147\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p161-3.png\" alt=\"Range HR ROR DR K XR Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand Sa \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"652\" height=\"148\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System)\u2026page 5-9.<\/p>\n<p>\u25cf Performs the multiplication of the data specified at Sa and Sb and writes the results to a specified register D when the multiplication control input &#8220;EN&#8221; =1 or from 0 to 1 ( P instruction). If the result exceed the range that the floating point number can be expressed(\u00b13.4*10 3 8) then the error flag FO0 will be set to 1 and the D register will be intact.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p161-4.png\" alt=\"204P.FMUL M10 EN Sa : R10 ERR Sb : R12 D : R14\" width=\"211\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Floating Point Number : DR10 4 2 F 6 E 6 6 6 H<\/p>\n<p>DR10 1 2 3 . 4 5<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p161-5.png\" alt=\"Floating Point Number : DR12 4 4 2 9 A 2 8 F H\" width=\"358\" height=\"50\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>DR12 6 7 8 . 5 4<\/p>\n<p>DR14 4 7 A 3 9 A E 2 H<\/p>\n<h4>FUN205 P FDIV FLOATING POINT NUMBER DIVISION<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p162-2.png\" alt=\"\" width=\"351\" height=\"167\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Sa: Dividend<\/p>\n<p>Sb: Divisor<\/p>\n<p>D : Destination register to store the results of the division<\/p>\n<p>Sa, Sb, D may combine with V, Z, P0~P9 to serve indirect addressing<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p162-3.png\" alt=\"HR ROR DR K XR Range Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand Sa \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"148\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf Performs the division of the data specified at Sa and Sb and writes the result to the registers specified by register D when the division control input &#8220;EN&#8221; =1 or from 0 to 1 ( P instruction). If the result exceed the range that the floating point number can be expressed(\u00b13.4*10 3 8) then the error flag FO0 will be set to 1 and the D register will be intact.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p162-4.png\" alt=\"205P.FDIV X5 Sa : R0 ERR EN Sb : R2 D : R4\" width=\"209\" height=\"89\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p162-5.png\" alt=\"\" width=\"527\" height=\"154\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN206 P FCMP FLOATING POINT NUMBER COMPARE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p163-2.png\" alt=\"Sa: The register to be compared Sb: The register to be compared Sa, Sb may combine with V, Z, P0~P9 to serve indirect addressing. HR ROR DR K XR Range Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand Sa \u25cb \u25cb \u25cb \u25cb \u25cb Sb \u25cb \u25cb \u25cb \u25cb \u25cb Description\" width=\"652\" height=\"314\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf Compares the data of Sa and Sb when the compare control input &#8220;EN&#8221; =1 or from 0 to 1 ( P instruction). If the data of Sa is equal to Sb, then set FO0 to 1. If the data of Sa&gt;Sb, then set FO1 to 1. If the data of Sa&lt;Sb, then set FO2 to 1. If the data of Sa &lt; Sb, then set the FO2 to 1.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p163-3.png\" alt=\"206P.FCMP X0 a=b Sa : R0 EN Sb : R2 a&gt;b Y0 a&lt;b\" width=\"242\" height=\"95\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<div class=\"fatek-tw fatek-box\">\n<table>\n<tr>\n<td>\n<p>DR0 2 0 0 . 1<\/p>\n<p>Floating Point Number : DR0 4 3 4 8 1 9 9 A H<\/p>\n<p>DR2 2 0 0 . 2<\/p>\n<p>Floating Point Number : DR2 4 3 4 8 3 3 3 3 H<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u25cf From the above example, we first assume the data of DR0 is 200.1 and DR2 is 200.2, and then compare the data by executing the CMP instruction. The FO0 and FO1 are set to 0 and FO2 (a&lt;b) is set to 1 since a&lt;b.<\/p>\n<p>\u25cf If you want to have the compound results, such as\u2267\u3001\u2266\u3001&lt; &gt; etc., please send =\u3001&lt; and &gt; results to relay first and then combine the result from the relays.<\/p>\n<h4>FUN207 P FZCP FLOATING POINT NUMBER ZONE COMPARE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p164-2.png\" alt=\"S : Register for zone comparison SU : The upper limit value SL : The lower limit value S, SU, SL may combine with V, Z, P0~P9 to serve indirect address application Range HR ROR DR K XR Floating V\u3001Z R0 R5000 D0 point \u2223 \u2223 \u2223 R3839 R8071 D4095 number P0\uff5eP9 Operand S \u25cb \u25cb \u25cb \u25cb \u25cb Su \u25cb \u25cb \u25cb \u25cb \u25cb SL \u25cb \u25cb \u25cb \u25cb \u25cb D\" width=\"655\" height=\"322\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When compare control &#8220;EN&#8221; = 1 or changes from 0 to 1 ( P instruction), compares S with upper limit SU and lower limit SL. If S is between the upper limit and the lower limit (SL\u2266S\u2266SU), then set the inside zone flag &#8220;INZ&#8221; to 1. If the value of S is greater than the upper limit SU, then set the higher than upper limit flag &#8220;S&gt;U&#8221; to 1. If the value of S is smaller then the lower limit SL, then set the lower than lower limit flag &#8220;S&lt;L&#8221; as 1.<\/p>\n<p>\u25cf The upper limit SU should be greater than the lower limit SL. If SU&lt;SL, then the limit value error flag &#8220;ERR&#8221; will set to 1, and this instruction will not carry out.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p164-3.png\" alt=\"207P.FZCP Y0 X0 INZ EN S : R10 S&gt;U Su : R12 SL : R14 S&lt;L ERR\" width=\"255\" height=\"117\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left compares the value of DR10 with the upper and lower limit zones formed by DR12 and DR14. If the values of DR10~DR14 are as shown in the diagram at bottom left, then the result can then be obtained as at the right of this diagram.<\/p>\n<p>\u25cf If want to get the status of out side the zone, then OUT NOT Y0 may be used, or an OR operation between the two outputs S&gt;U and S&lt;L may be carried out, and move the result to Y0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p165-1.png\" alt=\"FUN 207 P FUN 207 P FLOATING POINT NUMBER ZONE COMPARE FZCP FZCP\" width=\"652\" height=\"62\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p165-2.png\" alt=\"S DR10 Floating Point Number : DR10 4 4 F A 0 6 6 6 H 2 0 0 0 . 2 Su DR12 3 0 0 0 . 3 Floating Point Number : DR12 4 5 3 B 8 4 C D H ( Upper limit value ) S DR14 1 0 0 0 . 1 Floating Point Number : DR14 4 4 7 A 0 6 6 6 H ( Lower limit value ) L Before-execution\" width=\"635\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p165-3.png\" alt=\"X0\uff1d\u21b1 \u25cf FLOATING ZONE COMPARE \u25cf Y0 = 1\" width=\"315\" height=\"38\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>Results of execution<\/p>\n<h4>FUN208 P FSQR S : Source register to be taken square root<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p166-2.png\" alt=\"\" width=\"348\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Register for storing result<\/p>\n<p>(square root value)<\/p>\n<p>S, D may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p166-3.png\" alt=\"HR ROR DR K XR Range Floating V\u3001Z R0 R5000 D0 Ope- point \u2223 \u2223 \u2223 rand R3839 R8071 D4095 number P0\uff5eP9 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb\" width=\"248\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p166-4.png\" alt=\"Description\" width=\"655\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1( P instruction), take the square root of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf If the value of S is negative, then the error flag &#8220;ERR&#8221; will be set to 1, and do not execute the operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p166-5.png\" alt=\"208P.FSQR X0 EN S : 2520.04 ERR D : D0\" width=\"206\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p166-6.png\" alt=\"\" width=\"574\" height=\"166\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN209 P FSIN S : Source register to be taken SIN<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-2.png\" alt=\"Ladder symbol 209P.FSIN S : Operation control EN ERR S range error D :\" width=\"344\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Register for storing result<\/p>\n<p>(SIN value)<\/p>\n<p>S, D may combine with V, Z, P0~P9 to serve indirect address application.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-3.png\" alt=\"HR ROR DR K XR Range Integer V\u3001Z R0 R5000 D0 Ope- 16 Bit \u2223 \u2223 \u2223 rand R3839 R8071 D4095 number P0\uff5eP9 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb\" width=\"248\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-4.png\" alt=\"Description\" width=\"652\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), take the SIN value of the angle data specified by the S register and store the result into the register D~D+1 in floating point number format. The valid range of the angle is from \u201318000 to +18000, unit in 0.01 degree.<\/p>\n<p>\u25cf If the S value is not within the valid range, then the S value error flag &#8220;ERR&#8221; will be set to 1, and do not<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-5.png\" alt=\"execute the operation. 209P.FSIN X0 EN S : 3000 ERR R100 D :\" width=\"232\" height=\"118\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf At left, the example program gets the SIN value of 30, and stores the results the register DR100.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-6.png\" alt=\"\" width=\"331\" height=\"100\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p167-7.png\" alt=\"\" width=\"206\" height=\"86\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN210 P FCOS S : Source register to be taken COS<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p168-2.png\" alt=\"Ladder symbol 210P.FCOS S : Operation control EN ERR S range error D :\" width=\"344\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Register for storing result<\/p>\n<p>(COS value)<\/p>\n<p>S, D may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p168-3.png\" alt=\"HR ROR DR K XR Range Integer V\u3001Z R0 R5000 D0 Ope- 16 Bit \u2223 \u2223 \u2223 rand R3839 R8071 D4095 number P0\uff5eP9 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb\" width=\"248\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p168-4.png\" alt=\"Description\" width=\"655\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), take the COS value of the angle data specified by the S register and store the result into the register D~D+1 in floating point number format. The valid range of the angle is from \u201318000 to +18000, unit in 0.01 degree.<\/p>\n<p>\u25cf If the S value is not within the valid range, then the S value error flag &#8220;ERR&#8221; will be set to 1, and do not execute the operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p168-5.png\" alt=\"210P.FCOS X0 EN S : R0 ERR R200 D :\" width=\"206\" height=\"74\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf At left, the example program gets the COS value of 60, and stores the results the register DR200.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p168-6.png\" alt=\"\" width=\"552\" height=\"203\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN211 P FTAN S : Source register to be taken TAN<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-2.png\" alt=\"Ladder symbol 211P.FTAN S : Operation control EN ERR S range error D :\" width=\"346\" height=\"103\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>D : Register for storing result<\/p>\n<p>(TAN value)<\/p>\n<p>S, D may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-3.png\" alt=\"HR ROR DR K XR Range Integer V\u3001Z R0 R5000 D0 Ope- 16 Bit \u2223 \u2223 \u2223 rand R3839 R8071 D4095 number P0\uff5eP9 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb\" width=\"248\" height=\"99\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-4.png\" alt=\"Description\" width=\"652\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), take the COS value of the angle data specified by the S register and store the result into the register D~D+1 in floating point number format. The valid range of the angle is from \u201318000 to +18000, unit in 0.01 degree.<\/p>\n<p>\u25cf If the S value is not within the valid range, then the S value error flag &#8220;ERR&#8221; will be set to 1, and do not execute the operation.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-5.png\" alt=\"211P.FTAN M0 \u25cf At left, the example program gets the TAN value of 45, EN S : R0 ERR and stores the results the register DD50. D50 D :\" width=\"542\" height=\"74\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-6.png\" alt=\"\" width=\"332\" height=\"100\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p169-7.png\" alt=\"\" width=\"206\" height=\"135\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN212 P FNEG CHANGE SIGN OF THE FLOATING POINT NUMBER<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p170-2.png\" alt=\"D : Register to be changed sign D may combine with V, Z, P0~P9 to serve indirect address application HR ROR DR XR Range R0 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 rand R3839 R8071 D4095 P0\uff5eP9 D \u25cb \u25cb* \u25cb \u25cb\" width=\"604\" height=\"192\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p170-3.png\" alt=\"Description\" width=\"655\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), the sign of the floating point number register specified by D will be toogled.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p170-4.png\" alt=\"Programming Example\" width=\"182\" height=\"25\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p170-5.png\" alt=\"X0 212P. EN FNEG R0\" width=\"182\" height=\"47\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left negates the value of the DR0 register, and stores it back to DR0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p170-6.png\" alt=\"\" width=\"508\" height=\"104\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN213 P FABS FLOATING POINT NUMBER ABSOLUTE VALUE<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p171-2.png\" alt=\"D : Register to be taken absolute value D may combine with V, Z, P0~P9 to serve indirect address application HR ROR DR XR Range R0 R5000 D0 V\u3001Z Ope- \u2223 \u2223 \u2223 rand R3839 R8071 D4095 P0\uff5eP9 D \u25cb \u25cb* \u25cb \u25cb\" width=\"604\" height=\"192\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p171-3.png\" alt=\"Description\" width=\"652\" height=\"28\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard. For detail explanation of the format please refer to 5.3 (Numbering System) page 5-9.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the absolute value of the floating point number register specified by D, and write it back into the original D register.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p171-4.png\" alt=\"Programming Example\" width=\"131\" height=\"23\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p171-5.png\" alt=\"X0 213P. EN FABS R0\" width=\"183\" height=\"47\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The instruction at left calculates the absolute value of the DR0 register, and stores it back in DR0.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p171-6.png\" alt=\"\" width=\"499\" height=\"105\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p172-1.png\" alt=\"FUN 214 P FLN\" width=\"86\" height=\"61\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>FUN 214 P<\/p>\n<p>FLOATING POINT NAPIERIAN LOGARITHM, logex or ln(x)<\/p>\n<p>FLN<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p172-2.png\" alt=\"S : Source data or register to be calculated Napierian logarithm value F214P.FLN Operation S : Control EN ERR D : Register for storing the result D : S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"619\" height=\"134\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p172-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), take the Napierian logarithm of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf If the value of S is negative or equal to 0\u3001 invalid indirect addressing\u3001 or over range of the result , the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p172-4.png\" alt=\"Example\" width=\"632\" height=\"144\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M214=1, calculate the Napierian logarithm value, it is DD246 = ln (DD46)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p172-5.png\" alt=\"\" width=\"461\" height=\"167\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN215 P FEXP FLOATING POINT NATURE POWER FUNCTION, ex<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p173-2.png\" alt=\"S : Source data or register to be calculated power F215P.FEXP Operation function of nature number Control EN S : ERR D : D : Register for storing the result S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"623\" height=\"114\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p173-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calaulate the nature power function of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf If the value of S is out of range\u3001 invalid indirect addressing\u3001 or over range of the result , the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p173-4.png\" alt=\"Example\" width=\"618\" height=\"143\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M215=1, calculate the nature power function, it is DD248 = e D D 4 8<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p173-5.png\" alt=\"\" width=\"462\" height=\"167\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN216 P FLOG FLOATING POINT LOGARITHM, log10x or log(x)<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p174-2.png\" alt=\"S : Source data or register to be calculated logarithm F216P.FLOG Operation value S : Control EN ERR D : D : Register for storing the result S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"624\" height=\"114\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p174-3.png\" alt=\"HR ROR DR K XR Range R0 R5000 D0 V\u3001Z Floating \u2223 \u2223 \u2223 Ope- number P0\uff5eP9 R3839 R8071 D3999 rand S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"142\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the logarithm value of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf If the value of S is negative or equal to 0\u3001 invalid indirect addressing\u3001 or over range of the result , the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p174-4.png\" alt=\"Example\" width=\"615\" height=\"143\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M216=1, calculate the logarithm value, it is DD250 = log (DD50)<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p174-5.png\" alt=\"\" width=\"461\" height=\"167\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN217 P FPOW Sy: Source data or register of exponential<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p175-2.png\" alt=\"F217P.FPOW Operation Control EN Sy : ERR Sx : D :\" width=\"284\" height=\"106\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>SX: Source data or register of base\u3002<\/p>\n<p>D : Register for storing the result<\/p>\n<p>Sy, Sx, D may combine with V, Z, P0~P9 to serve indirect address application<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p175-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 Sy \u25cb \u25cb \u25cb \u25cb \u25cb Sx \u25cb \u25cb* \u25cb \u25cb \u25cb D \u25cb \u25cb \u25cb \u25cb Description\" width=\"655\" height=\"147\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the power function of the exponential data specified by the Sy\u3001base data specified by the Sx, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf If it exists invalid indirect addressing\u3001or over range of the result , the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p175-4.png\" alt=\"Example\" width=\"613\" height=\"142\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M217=1, calculate the power function, it is DD252 = DD54 D D 5 2<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p175-5.png\" alt=\"\" width=\"460\" height=\"126\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN218 P FASIN FLOATING POINT ARC SINE FUNCTION, sin-1<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p176-2.png\" alt=\"S : Source data or register to be calculated the arc sine F218P.FASIN Operation value S : Control EN ERR D : D : Register for storing the result S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"624\" height=\"115\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p176-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the arc sine value of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf Range of S data : -1~ +1 ; range of D value : -\u03c0\/2 ~ \u03c0\/2 (Unit in radian)<\/p>\n<p>\u25cf If the value of S is out of range\u3001or invalid indirect addressing, the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p176-4.png\" alt=\"Example\" width=\"613\" height=\"233\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M218=1, calculate the arc sine value, it is DD256 = sin &#8211; 1 DD56;<\/p>\n<p>DD256(Unit in radian) \u00d7 57.295788(180\/\u03c0 ) to acquire the degree value<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p176-5.png\" alt=\"\" width=\"460\" height=\"126\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN219 P FACOS FLOATING POINT ARC COSINE FUNCTION, cos-1<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p177-2.png\" alt=\"S : Source data or register to be calculated the arc F219P.FACOS Operation cosine value S : Control EN ERR D : D : Register for storing the result S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"624\" height=\"115\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p177-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1( P instruction), calculate the arc cosine value of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf Range of S data : -1~ +1 ; range of D value : 0 ~ \u03c0(Unit in radian)<\/p>\n<p>\u25cf If the value of S is out of range\u3001or invalid indirect addressing, the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p177-4.png\" alt=\"Example\" width=\"614\" height=\"230\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M219=1, calculate the arc cosine value, it is DD258 = cos &#8211; 1 DD58;<\/p>\n<p>DD258(Unit in radian) \u00d7 57.295788(180\/\u03c0 ) to acquire the degree value<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p177-5.png\" alt=\"\" width=\"459\" height=\"126\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h4>FUN220 P FATAN FLOATING POINT ARC TANGENT FUNCTION, tan-1<\/h4>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p178-2.png\" alt=\"S : Source data or register to be calculated the arc F220P.FATAN Operation tangent value S : Control EN ERR D : D : Register for storing the result S, D may combine with V, Z, P0~P9 to serve indirect address application\" width=\"624\" height=\"115\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p178-3.png\" alt=\"HR ROR DR K XR Range V\u3001Z R0 R5000 D0 Floating Ope- \u2223 \u2223 \u2223 number P0\uff5eP9 rand R3839 R8071 D3999 S \u25cb \u25cb \u25cb \u25cb \u25cb D \u25cb \u25cb* \u25cb \u25cb Description\" width=\"655\" height=\"131\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u25cf The format of floating point number of Fatek-PLC follows the IEEE-754 standard of 32-bit.<\/p>\n<p>\u25cf When operation control &#8220;EN&#8221; = 1 or from 0 to 1 ( P instruction), calculate the arc tangent value of the data specified by the S value or S~S+1 register, and store the result into the register specified by D~D+1.<\/p>\n<p>\u25cf S data is any number ; range of D value : -\u03c0\/2 ~ \u03c0\/2 (Unit in radian)<\/p>\n<p>\u25cf If it exists invalid indirect addressing, the error flag &#8220;ERR&#8221; will be set to 1, and not update the value of D~D+1.<\/p>\n<p>\u25cf All floating point instructions can\u2019t be executed in interrupt service routine.<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p178-4.png\" alt=\"Example\" width=\"614\" height=\"239\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>\u2024 When M220=1, calculate the arc tangent value, it is DD260 = tan &#8211; 1 DD60;<\/p>\n<p>DD260(Unit in radian) \u00d7 57.295788(180\/\u03c0 ) to acquire the degree value<\/p>\n<p><img src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/fbs-ins-en-007-v2\/fbs-ins-en-007-p178-5.png\" alt=\"\" width=\"459\" height=\"125\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25cf Flow Control Instructions I (FUN22) &#8230;&#8230;&#038;#8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-3434","post","type-post","status-publish","format-standard","hentry","category-en-fbs-ins"],"_links":{"self":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/comments?post=3434"}],"version-history":[{"count":0,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3434\/revisions"}],"wp:attachment":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/media?parent=3434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/categories?post=3434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/tags?post=3434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}