Home

NAiS FP0/FP1/FP M Manual

image

Contents

1. stet R08 P EN END IF DF start THEN F105 BSR data END IF 283 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F106_BSL Matsushita Instructions F1 06_BS L 4 bits of 16 bit data Left shift of one hexadecimal digit Description Shifts one hexadecimal digit 4 bits of the 16 bit area specified by d to the left to the higher digit position if the trigger EN is in the ON state When one hexadecimal digit 4 bits is shifted to the left hexadecimal digit position 3 bit position 12 to 15 of the data specified by d is shifted out and is transferred to the lower digit bit position 0 to 3 of spe cial data register DT9014 DT90014 for FP10 10S 9 hexadecimal digit position 0 bit position 0 to 3 of the 16 bit area specified by d becomes 0 This instruction is useful when the hexadecimal or BCD data is treated PLC types FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F106 X X X X X x available not available Data types Variable Data type Function d INT WORD 16 bit area to be shifted to the left Operan
2. In this example the input variable input value is declared However you can write constant directly at the input contact of the function instead Body When the variable start is set to TRUE the function is carried out start EN ENO tI value s d output _ value ST IF start THEN F338 DEG input value output value END IF 375 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F338 DEG Matsushita Instructions 376 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Chapter 21 Bit Manipulation Instructions CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F130 BTS Matsushita Instructions 1 30 BTS 16 bit data bit set Description Turns ON the bit specified by the bit position at n of the 16 bit data specified by if the trigger EN is in the ON state Bits other than the bit specified do not change The range of n is 0 to 15 PLC types t FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F130 x x X X x a
3. 4 If enable is set TRUE the comparison_value is compared with the variable reference value If the comparison value is less than or equal to the reference value TRUE will be written in result otherwise FALSE This example uses variables You may also use constants for the input variables enable H ae 5 result comparison value a Numhk L reference value a CE LO enable E LE comparison reference value result 131 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E LT IEC Instructions E LT Less than Description The content of the accumulator is compared with the operand defined in the operand field If the accumulator is less than the reference value TRUE is stored in the accumulator otherwise FALSE For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function LT as standard opera tor in the Online Help gt The number of input contacts lies the range of 2 to 28 Data types Data type Vo Function all data types 1st input value for comparison all data types 2nd input reference value BOOL output result TRUE if 2nd input value is less
4. PLC types m FPO FP1 Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F183 X x available not available Data types Variable Data type Function DINT DWORD set value range 0 to 2147483647 d DINT DWORD elapsed value range 0 to 2147483647 Operands Relay T C Register Constant or DWX DWR DWL DSV DEV DDT DLD DFL dec or hex 5 X X X X X X X d X X x x x x available not available Example In this example the function F183_DSTM is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment ol VAR 4 Start BOOL Fi FALSE 3 VAR ElapsedValue DINT fO Body This example uses a variable at the input contact You may also use a constant LD Sie 5o 183 DSTM c s Temer Output EN ENO i i SetValue 5 d ElapsedValue 403 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F183 DSTM Matsushita Instructions IL i1 LD _ Start F183 DSTM Set alue ElapsedValue ST Timer Output 404 CTi Automation Phone 800 894 041
5. di lt d2 PLC types NI FPO FP1 Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F11 X X X X X x available not available Data types Variable Data type Function INT WORD source 16 bit area di INT WORD starting 16 bit area destination d2 INT WORD ending 16 bit area destination The variables s d1 and d2 have to be of the same data type Operands 2 T C Register Constant or WX WY WR WL SV EV DT LD FL dec or hex X X X X X X X X X X di d2 x x x x x x x x x available not available 191 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net 11_ Matsushita Instructions Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment activates the function 3 5 7 3 11 13 sult after a 0 21 leading dge from start i Body When the variable start is set to TRUE the function is executed 777 start a 11 t asta svi data array ST IF start THEN
6. PLC types TEES FPO FP1 Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F65 X X X X x x available not available Data types Variable Data type Function 51 INT WORD 16 bit equivalent constant 16 bit area 52 INT WORD 16 bit equivalent constant or 16 bit area d INT WORD 16 bit area for storing AND operation result The variables 61 62 and d have to be of the same data type Operands q Relay T C Register Constant or WX WY WR WL SV EV DT LD FL dec or hex s1 s2 x x x x x x x x x x d x x x x x x x x x available not available 270 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Logic Operation Instructions F65 WAN Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment E v 0000000011001100 VAR iresult after a 0 gt 1 leading edge 3 ifrom start i PCR 4880000000000000000 amp Body When the variable start is set to TRUE the function is executed LD oe Be Boe 3
7. _ DataBlock2 ARRAY 0 5 OF INT 6 1234 Body When the variable start is set to TRUE the function is executed ENO Control Code 51 DataBlock1 0 s2 2 DataBlock2 0 s3 ST IF start THEN F64 51 1 ControlCode 52 Start DataBlock1 0 53 Start DataBlock2 0 ll END_IF 267 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F64 BCMP Matsushita Instructions 268 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Chapter 18 Logic Operation Instructions CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F65 WAN Matsushita Instructions F65 WAN 16 bit data AND Steps 7 Description Executes AND operation of each bit in 16 bit equivalent constant 16 bit data specified by s1 and s2 if the trigger EN is in the ON state The AND operation result is stored in the 16 bit area specified by d When 16 bit equivalent constant is specified by s1 or s2 the AND operation is performed internally converting it to 16 bit binary expression You can use this instruction to turn OFF certain bits of the 16 bit data
8. BOOL FH FALSE This example uses variables You may also use a constants for the input variables The Boolean value of the data type BOOL is converted into a DOUBLE INTEGER value The converted value is written into DINT value Boolean value gt gt gt BOOLTTOJBINT a_Bool DINT value gt IF Boolean value THEN DINT value BOOL TO DINT Boolean value END IF CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net 27 E_ BOOL_TO_WORD IEC Instructions amp 1 981192198 to WORD Description TO WORD converts a value of the data type BOOL into a value of the data type WORD For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function with enable in the Online Help Data types Data type I O Function BOOL input input data type WORD output conversion result Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifie
9. Operands Register Constant WX WY WR WL SV EV DT LD FL dec or hex 5 X z n X X X X X X X X X X x available not available Error flags No IEC address Set If R9007 lt 0 900 7 permanently the number of bytes specified by n exceeds the source data area range R9008 Mx0 900 8 for an instant Preparation of transmission and reception 1 Setting the use of COM port System register 412 gt F144 is only executed system register 412 is set to general purpose With the programming software Set system register 412 for serial transmission general purpose port With the PLC program To switch between computer link communication and serial data communica tion general purpose port execute an F144_TRNS instruction Set n the num ber of transmission bytes to 16 8000 and then execute the instruction When executed when computer link is selected the setting will change to gener al purpose port When executed when general purpose port is selected the setting will change to computer link R9032 is the COM port selection flag This flag turns on when General purpose port is selected 201 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F144 TRNS Matsushita Instructions Exam
10. OQ V ao F15 XCH i EN ENO ILE LEE di 1 92 2 IF start THEN F15 XCH value 1 END IF value 2 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net 197 F16 DXCH Matsushita Instructions F1 6 DXCH 32 bit data exchange Description Two 32 bit data specified by d1 and d2 are exchanged if the trigger EN is in the ON state PLC types ENS FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F16 X X X X X x available not available Data types Variable Data type Function di DINT DWORD 32 bit area to be exchanged with d2 d2 DINT DWORD 32 bit area to be exchanged with d1 The variables d1 and d2 have to be of the same data type Operands T C Register Constant Or DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex di d2 x x x x x x x x x available not available Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header p
11. This example uses variables You may also use a constant for the input variable DWORD value of the data type DOUBLE WORD is converted into a Boolean value 1 bit the converted value is written in Boolean value 455 Mam DWORD_TO_BOOL Beolean value DWORD walue a O Boolean value DWORD TO BOOL DWORD value If the variable DWORD value has the value 0 16200000000 the conversion result will be FALSE in any other case it will be TRUE 53 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E DWORD TO INT IEC Instructions DOUBLE WORD to INTEGER Description DWORD INT converts a value of the data type DWORD into a value of the data type INT For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function with enable in the Online Help Data types Data type I O Function DWORD input input data type INT output conversion result Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header program
12. veg Pis 457 F143 IORF Partial update 458 F148 ERR Self diagnostic error set 460 F149 MSG Message display 462 Appendix A High Speed Counter Pulse and PWM Output High Speed Counter Pulse and PWM Output 464 A 1 1 High speed counter function 464 A 1 2 Pulse output function 1 464 A 1 3 PWM OUTPUETUNCHON ates need den UIIEI 4e EOD atc 464 A 2 Specifications and Restricted Items 466 A 2 1 Sp amp cificatioris wey gee re tk eer Neue 466 A 2 2 Functions and 467 High Speed Counter Function 469 A 3 1 Types of Input Modes 469 A 3 2 VOAllocation conse d peus 470 A 4 Pulse Output 471 A 4 1 SDT Variables zr a aac alberta e 471 A 4 2 Positioning Function F168 471 A 4 3 Pulse Output Function F169 472 A 4 4 High Speed Count
13. 311 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net 72_ 2 Matsushita Instructions Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment 3j FALSE 1694443 168424 1 1624443 CD ASCII i 1684241 AB ASCII t Result ABCD i Upper and lower byte i data interchanged S M Body When the variable Start is set to TRUE the function is executed In this example the value for s2 i e the number of bytes to be converted from ASCII code to hexadecimal code is entered directly at the contact pin i B EN ENO E Pw E 0 1684443 51 HexOutput 1SHABCD 4 IDEEN ST IF start THEN 72 A2HEX 51 Start AscInput 0 s2 Number 4 d Start HexOutput 312 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Data Conversion Instructions F73 BCD2A 2 BCD
14. 422 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net High Speed Counter Special Instructions F166_HC1S Data types Operands Error flags Example GVL POU header LD Variable Data type Function n DINT DWORD the channel no of the high speed counter that corresponds to the matching output n 0 to 3 DINT DWORD the high speed counter target value data or the starting address of the area that contains the data d BOOL the output coil that is turned on when the values match Yn n 0 to 7 Relay T C Register Constant or DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex n 5 x x x x x X Y R L T DT LD FL dec or hex d X x available not available IEC address If index is too high 0 900 7 parameter 5 exceeds the valid range MX0 900 8 In this example the function F166_HC1S is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages In the Global Variable List you define variables that can be accessed by all POUs in the project Identifier 0 Address QX0 0 Comment output YO of PLC Initial FALSE Type BOOL In the POU header all input and output variabl
15. stored in d PLC types d FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F42 x X X x available not available Data types Variable Data type Function s1 WORD augend 16 bit area for 4 digit BCD data or equivalent constant 52 WORD addend 16 bit area for 4 digit BCD data or equivalent constant d WORD sum 16 bit area for 4 digit BCD data Operands Register Constant or WX WY WR WL SV EV DT LD FL dec or hex 51 52 x x x x x x x x x x d m x x x x x X X X x available not available Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment stor activates the function 11 VAR summand_1 first summand _2 VAR summand 2 second summand u 3 VAR output value iresult after a 0 21 leading edge from start 1645555 Body When the variable start changes from FALSE to TRUE the function is executed LD sat gt F42 BADD2 er EN ENO summand 1 21 d output value summand 2 s2 AIME MEM ST IF start THEN F42 BADD2 summand 1 summand 2 output
16. The variables s and d have to be of the same data type Operands Relay T C Register Constant WX WY WR WL SV Ev DT LD FL dec or hex For X X X X X X X X X X d x x X x x x x x available not available Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help x POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment a FALSE activates the function icontains the source value ithe area where the source i iyalue will be copied to iresult after a 0 21 leading i edge from start 137 Body When the variable start is set to TRUE the function is executed LD input value d output value ST IF start THEN FO MV input value output value END IF 180 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Data Transfer Instructions F1_ DMV F1 _DMV 32 bit data move Steps 7 Description 32 bit data or 32 bit equivalent constant specified by s is copied to the 32 bit area specified
17. Higher 16 bit area Lower 16 bit area Data types Variable Data type Function DINT DWORD binary data source range 0 to 99 999 999 d DWORD 32 bit area for 8 digit BCD code destination Operands E Relay T C Register Constant or DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex 5 x x x x x x x x x x d X X X X X X X X x available not available Error flags No IEC address Set If R9007 MX0 900 7 permanently 32 bit data specified by s outside the range of 0 1640 R9008 9 MX0 900 8 oran instant to 99999999 16 5F5E0FF is converted 335 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F82_DBCD Matsushita Instructions Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment Fi FALSE 172811730 VAR 4 Enable Body When the variable Enable is set to TRUE the function is executed The decimal value in DINT_input is converted to a BCD hexadecimal value and stored in the variable BCD_output You may also assign a decimal binary pre
18. AR ado tima SJ SEEN 2 VAR result here T amp 5s0 00ms i Body The value of variable input time is divided by the value of the variable input real The result is written in div result In this example the input variables have been declared in the POU header However you may enter constants directly at the contact pins of the function DIV TIMEREAL cc 00 input time Time iv result input res jReal d ccr cre ST div result DIV TIME REAL input time input real 105 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E_ DIV_TIME_REAL IEC Instructions 106 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Chapter 6 Bitshift Functions CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E_ SHL IEC Instructions E_ SHL Shift bits to the left Description SHL shifts a bit value by a defined number of positions N to the left and fills the vacant positions with zeros source register N 4 bits E Dp wm 1 target register 1397 these 4 bits are filled up with zeros For the difference between the normal IEC function and the function with an enable input see
19. Relay T C Register Constant no WX WY WR WL SV EV DT LD FL dec or hex x x x x x x x x x x available not available 348 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Data Conversion Instructions F92 ENCO Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function i activates the function var var pecify n specifies the encodation VAR valie result after a 0 21 leading 3 i edge from start ad ss LL 42 0000000000000110 Body When the variable start is set to TRUE the function is executed LD ey stat gt gt E82 ENCO EN ENO H input value d utput value gt specify n n JE EC LOT ET ST IF start THEN F92 ENCO s input value specify n d output value END IF 349 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F93_UNIT Matsushita Instructions Description PLC types Data types
20. 1640002 Inputparametersi E Input parameter s2 E Body The interval for executing INT 24 program is specified as 100 ms 10ms time base selected when the leading edge of start is detected LD mm Var 1 51 Var 2 52 IL LD start Load value of EN input DF Leading edge detection Var_1 Var_2 Execute 454 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Chapter 28 Special Instructions CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F140 STC Matsushita Instructions F1 40 STC Carry flag set Description Special internal relay R9009 carry flag goes ON if the trigger EN is in the ON state This instruction can be used to control data using carry flag R9009 e g F122 RCR and F123 RCL instructions PLC types FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F140 X X x X X x available not available Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header
21. Data type y o Function INT 1st input selects channel for 2nd or 3rd input value to be written to all data types 2ndinput value 1 all data types 3rd input value 2 all data types outputas result 2nd and 3rd input The 2nd and 3rd input variables must be of the same data type In this example the function MUX is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages In the POU header all input and output variables are declared that are used for programming this function Class Identifier COG var ab channel_select pas eere T i SvAR 4 output 0 0 i value O to n Initial Comment all types allowed i 123 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E_ MUX IEC Instructions In this example the input variables channel select channel 0 and channel 1 have been declared Instead you may enter a constant directly at the input contact of a function Body In channel select you find the integer value 0 1 n for the selection of channel 0 or channel 1 The result will be written in output LD M channel select alnt output channel 0 aNumN 7 18
22. x x n x x x x x X x x x X x available not available In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help In the POU header all input and output variables are declared that are used for programming this function Class Identifier Type Initial Comment far 4 start iBooL TiFALSE activates the function VAR 4 data DF start 100_5 d gt data 4 END_IF 281 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F101_SHL Matsushita Instructions F1 01 _SH L Left shift of 16 bit data in bit units Description Shifts n bits of 16 bit data area specified at d to the left to the higher bit position if the trigger EN is in the ON state When n bits are shifted to the left the data in the nth bit is transferred to special internal relay R9009 carry flag and n bits starting with bit position O are filled with Os PLC types FPO FP1 Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F101 X X X X X x available not available Data types Variable Datatype Function d INT WORD 1
23. Elapsed Reset operation cannot value be performed 0 gt Time Reset Trigger for high speed counter X0 off Reset i eset input oft Bit position 2 of 0 1 DT9052 DT90052 Reset operation Reset operation enabled disabled 4 Control of high speed counter instructions bit position 3 of DT9052 DT90052 The control operations of the F162 HCOS F163 HCOR F164 SPDO and F165 CAMO instructions are stopped and cleared when 1 is set to bit position 3 of DT9052 DT90052 Example In this example the function FO MV is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages GVL In the Global Variable List you define variables that can be accessed by all POUs in the project Global Variables Class Identifier Matsus IEC_Address Type Initial Evan a HighSpeedCnirl 078052 4 VAR_GLOBED 1 B e 416 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net High Speed Counter Special Instructions FO_MV POU In the POU header all input and output variables are declared that are used for header programming this function Class Comment Body The elapsed value of the high speed counter is reset to zero 16 1 the first time FO MV is executed and counting
24. Data table3 jb A 4 4 High Speed Counter Control Instruction MV The function MV is used for two different tasks MV is known as a MOVE function that copies values and memory contents In addition FO MV is used to control the high speed counter e g for positioning a stepping motor In this respect MV offers the following functionality This instruction is used for resetting the built in high speed counter stopping the pulse outputs and setting and resetting the home proximity input 473 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net High Speed Counter Pulse and PWM Output FPWIN Pro Programming Specify this instruction together with special data register MW0 905 2 079052 MWO0 9005 2 with the FPO T32CP Once this instruction is executed the settings will be retained until this instruction is executed again Example 1i The home proximity speed is the starting speed of the ramp The switching is enabled by assigning the value 4 to the high speed counter special register MW0 905 2 079052 or MW0 9005 2 with the FPO T32CP 0 is entered just after that to perform the preset operations Start X3 e 1580000 Example 2 1680000 HSCO Ctrl Reg A 4 5 Elapsed Value Change and Read Instruction F1 DMV In these examples HSCO elapsedval is assigned to the ad
25. Description The function rounds off the decimal part of the real number data and returns it at output d If the first post decimal digit is between 0 4 the pre decimal value is rounded down If the first post decimal digit is between 5 9 the pre decimal value is rounded up PLC types TES FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F334 x available available Data types Variable Data type Function REAL source d REAL destination Operands Relay T C Register Constant or DWX DWY DWR DWL DSV DEV DDT DLD DFL floating pt 5 X X X X X X X X X X d x x x x x x available not available Error flags No IEC address Set If R9007 lt 0 900 7 permanently the value at input s is not a REAL number R9008 Mx0 900 8 for an instant R900B MX0 900 11 to TRUE the result is 0 R9009 900 9 for an instant the result causes an overflow Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment BOOL F FALSE activates the function Sioupu value REAL 700 __ result here 1236 00 368 CTi
26. gt One of the two inputs s1 or s2 has to be assigned a constant number value Operands Relay Register Constant DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex s1 s2 x x x x x x x WX WY WR WL SV EV DT LD FL dec or hex d x 8 x available not available 193 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F12 EPRD Matsushita Instructions information PLC type FPO 2 7k FPO 5k C32 FPO 10k C10 C14 C16 T32CP Block size 1 block 64 words 64 x 64 words 64 x 64 words 64 x 16 bit 16 bit 16 bit Number of blocks to be read 1102 1108 written each execution Write duration Additional scan 20 ms each 5 ms each block time block Read duration Additional scan Less than 1 ms Less than 1ms time each block each block 100 000 10 000 Example In this example the function F12 EPRD is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages POU In the POU header all input and output variables are declared that are used for header programming this function i i ARRAY 0 63 OF INT Class Identifier Initial Comment FALSE i activates the function 4 01 data field to be uploaded data from EEPROM i Body When the variab
27. High speed counter mode Input contact of FP Ms and FP1s X0 X1 X2 High speed counter function not used 2 phase input 2 phase input Reset input Up input l Internal connection Up input Reset input setting for pulse Down input output Down input Reset input 1 C56 C72 Up Down input only Up input X1 Down input Up Down input Reset input X0 Up input X1 Down input Pulse output internal connection Internally not connected H1 Internally connected gt When system registers 400 402 403 and 404 are set at the same time their priorities are 1st 400 high speed counter mode settings 2nd 402 pulse catch input function settings 3rd 403 interrupt trigger settings last 404 input time filtering settings 533 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net System Registers FPWIN Pro Programming Address Default Description value Input Not used setting Pulse catch input FP1 C14 C16 X0 to X3 function settings FP1 C24 C40 C56 C72 0 to X7 FP M C20 C32T to X7 System register 402 Bit position 15 1211 87 43 0 Corresponding x7 xX x5 xa X3 X2 X1 XO input 0 Standard input 1 Pulse catch input In the FP programmer II enter the above setting in hexa decimal Example If the pulse catch functi
28. address range The Matsushita timer functions TM 1s TM 100ms 10ms and TM 1s use the same NUM address area as the Matsushita timer func tion blocks TM 1s FB TM 100ms FB TM 10ms FB and TM 1s FB For the timer function blocks the compiler automatically assigns a NUM address to every timer instance The addresses are assigned counting downwards starting at the highest possible address In or 396 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Timer Instructions TM_100ms der to avoid errors address conflicts these timer functions and func tion blocks should not be used together in a project Example Below is an example of an instruction list IL body for the instruction LD start EN start Starting signal for the TM_100ms function 16 32123 Num 16 Address of the timer TM 100ms SV 32123 Time corresponding 3212 3 sec ST Var 0 Var 0 The variable Var 0 turns ON when the EV becomes 0 397 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net TM_10ms Matsushita Instructions 1 Oms Timer for 10ms intervals Steps 3 4 Description The TM 10ms instruction sets the ON delay timer for 0 015 units 0 to 327 675 The areas used for the instruction are e Preset Set value area SV Coun
29. the number of bytes for ASCII characters in s2 is more than 16 8 317 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F74_A2BCD Matsushita Instructions Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Initial art OL B LSE Body When the variable start is set to TRUE the function is executed For the variable at s1 you never need define an ARRAY with more than four elements because 8 ASCII characters require 8 bytes of memory and the function cannot convert more than 8 bytes In this example the value for s2 is entered directly at the contact pin LD 74 Structure start 281 at 0 4 15 ASCInput Structure 0 10 at SoMW5 189 1 32 at 5 130 Set to display ASCII characters BCD Output Structure 0 1643210 at MW5 193 1 1647654 at YoMWw5 194 ST IF start THEN 74 A2BCD 51 Start ASCInput 0 s2 Number 1648 d Start BCDOutput 0 END IF 318 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email
30. 418 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net High Speed Counter Special Instructions F163_HCOR F1 63 H COR High speed counter output reset Steps 7 Description Sets the value specified by s as target value of the high speed counter if the trigger EN is in the ON state When the elapsed value DT9045 and DT9044 of the high speed counter agrees with the target value DT9047 and DT9046 the external output relay specified by d turns OFF You can use 8 external output relays YO to Y7 When the F163 HCOR instruction is executed the target value is stored in special data registers DT9047 and DT9046 and it is cleared when the elapsed value of the high speed counter agrees with the target value Use 24 bit binary data with sign data for the target value of HSC FF800000 hex to 007FFFFF hex 8 388 608 to 8 388 607 Once the F163 HCOR instruction is executed special internal relay R903A turns ON and stays ON It is cleared when the elapsed value of the high speed counter agrees the target value Even if the reset operation of the high speed counter is performed after executing the F163 HCOR instruction the target value setting is not cleared until the elapsed value of the high speed counter agrees with the target value You can use the same external output relay specified by the F163 HCOR instruction in other parts of program It is not considered duplic
31. PLC types on FPO FP1 FP M Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F23 X X X X X x available not available Data types Variable Data type Function s1 DINT DWORD augend s2 DINT DWORD addend d DINT DWORD result The variables s1 s2 and d have to be of the same data type Operands T C Register Constant or WX WY WR WL SV EV DT LD FL dec or hex s1 s2 x x x x x x x x x x d x x x x x X X X x available not available Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment start BOOL i FALSE ctivates the function 2 g YAR value_out DINT Fo Body When the variable start is set to TRUE the function is executed F23_DADD2 EN ENO value in1 s1 d value out value in2 52 ST IF start THEN 23 DADD2 value in1 value in2 value out END IF 215 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F40_BADD Matsushita Instructions F40_BADD 4 digit BCD addit
32. This example uses variables You may also use a constant for the input variable Body The bits of input value are inversed 0 is inversed to 1 and vice versa The inversed result is written in negation This example uses variables You may also use constants for the input variables ID d Wcar ake ANA NL 2 o input value Bit negation IL LL input value NOT ST 117 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net E_ NOT IEC Instructions 118 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Chapter 8 Selection Functions CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net _ IEC Instructions E_ MAX Maximum value Description MAX determines the input variable with the highest value For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function with enable in the Online Help gt The number of input contacts a_NumN lies in the range of 2 to 28 Data types Data type I O Function allexcept ist input value 1 STRING except 2ndinput value 2 STRING allexcept outputas result whichever input variable s value
33. a Real j output value ST output value ATAN input value 90 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Arithmetic Functions E_ LN E LN Natural logarithm Description Data types Error flags Example POU header Body LN calculates the logarithm of the input variable value gt 0 0 to the base e Euler s number 2 7182818 and writes the result into the output variable This function is the reverse of the EXP function For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function with enable in the Online Help This function is only available for the FPO Data type I O Function REAL input input value REAL output natural logarithm of input value input IEC address Set If 0 900 7 Permanently input variable does not have the data type REAL or input variable is not gt 0 0 MX0 900 8 for an instant MX0 900 11 Permanently output variable is zero MX0 900 9 for an instant Mosq result overflows the output variable In this example the function LN is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages In the POU header all input and output variables are declared
34. i activates the fuction dividend result after a 0 gt 1 leading from E 3 Body When the variable start is set to TRUE the function is executed at stat F33 DDIV EN ENO d dividend s1 utput value s divisor ST IF start THEN F33_DDIV dividend divisor output value END IF 241 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F52_BDIV Matsushita Instructions 4 digit BCD division destination Fo2_B DIV can be specified Steps 7 Description The 4 digit BCD equivalent constant or the 16 bit area for 4 digit BCD data specified by s1 is divided by the 4 digit BCD equivalent constant or the 16 bit area for 4 digit BCD data specified by s2 if the trigger EN is the ON state The quotient is stored in the area specified by d and the remainder is stored in special data register DT9015 DT90015 PLC types 1 Availability 2 7k 5k 10k 0 9k 2 7k 5k 0 9k 2 7k 5k F52 X X X X x available not available Data types Variable Data type Function 51 WORD dividend 16 bit area for BCD data or 4 digit BCD equivalent constant s2 WORD divisor 16 bit area for BCD data or 4 digit BCD equivalent constant d WORD quotient 16 bit area for BCD data remainder stored in spe
35. start F94 DIST data input 4 output distrib 0 LD utput distrib WORD TO INT POL Monitor Header F94awl P i ST int result 0 integer 29456 at VaM W5 730 LD output distrib 1 data input 1647310 at YaMW5 731 WORD TO INT start 241 at YaMXO 20 0 ST int result 1 output distrib Structure int result 00 at 5 796 LD output distrib 2 int result 11 at YoeMW5 797 WORD TO INT int result 23 at MW5 798 ST int result 2 int result 37 at YaMW5 739 LD output distrib 3 WORD TO INT ST _ int_result_3 354 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Data Conversion Instructions F95 ASC F95 A Character ASCII transfer Description Converts the character constants specified by s to ASCII code The converted ASCII code is stored 6 words starting from the 16 bit area specified by d s Character constants ABC1230 DEF d gt If the number of character constants specified by s is less than 12 the ASCII code 16220 SPACE is stored in the extra destination area e g s 12345 d 0 3231 d 1 3433 d 2 2034 d 3 d 5 2020 PLC types NT FPO FP1 FP M Availability 2 7k 5k 10k 0
36. 199 F144 TRNS Serial communication RS232C 200 F147 PR Parallel printout 208 Chapter16 Arithmetic Instructions F20 ADD 16 bit addition 212 F21 DADD 32 bit addition 213 F22 ADD2 16 bit addition destination can be specified 214 F23 DADD2 32 bit addition destination can be specified 215 40 BADD 4 digit BCD addition 216 F41 DBADD 8 digit BCD addition 217 F42 BADD2 4 digit BCD addition destination can be specified 218 FA3 DBADD2 8 digit BCD addition destination can be specified 219 vi CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net FPWIN Pro Programming Table of Contents F157_CADD F25 SUB F26 DSUB F27 SUB2 F28 DSUB2 F45 BSUB F46 DBSUB F47 BSUB2 F48 DBSUB2 F158 CSUB F30 MUL F31 DMUL F50 BMUL F51 DBMUL F32 DIV F33 DDIV F52 BDIV F53 DBDIV F35 INC F36 DINC F55 BINC F56 DBINC F37 DEC F38 DDEC F57 BDEC F58 DBDEC F87 ABS F88 DABS Time addition x oie iiber E Red 220 16 bit subtraction 222 32 bit subtraction 223 16 bit subtraction destination can be specified
37. Area used for storing received data Ax the circled numbers indicate the order of reception Each time data is received the amount of data received number of bytes is stored as acount in the leading address of the reception buffer The initial value is zero The data received is stored in order in the reception data storage area beginning from the lower byte of the second word of the area 205 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net F144 TRNS Matsushita Instructions Example In this example the function F144 is programmed in ladder diagram LD POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment VAR 4 Start BOOL EUR LAND bcr eo me 1 Body In this example the eight characters A B C D E F G and H 8 bytes of data are received from an external device System register settings for this example are as follows System register 417 200 System register 418 4 51200 8 Each time data is received the number of bytes received is stored DT201 1624241 DT202 16 4443 D C The reception data is stored DT203 16 4645 in order from the lower byte F E DT204 16 4847 H G E
38. IL LO enable E Ea comparison value reference value res ult 130 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Comparison Functions E LE E LE Description er Data types Example POU header Body LD Less than or equal to The content of the accumulator is compared to the operand defined in the operand field If the accumulator is less than or equal to the reference value TRUE is stored in the accumulator otherwise FALSE For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function LE as standard oper ator in the Online Help The number of input contacts lies in the range of 2 to 28 Data type y o Function all data types 1st input value for comparison all data types 2nd input reference value BOOL output result TRUE if 2nd input value is less than or equal to the refer ence value The variables that are compared to each other must be of the same data type In this example the function E LE is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages In the POU header all input and output variables are declared that are used for programming this function Class Identifier Type Initial Comment VAR enable iBOOL Hi FALSE
39. 1 Y3 CW CCW A 1 3 PWM output function By using the appropriate instruction the PWM output function enables a pulse output of the desired duty ratio 464 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net FPWIN Pro Programming A 1 High Speed Counter Pulse and PWM Output When you increase the pulse width IU UL heating increases When you decrease it heating decrea ses 465 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net High Speed Counter Pulse and PWM Output FPWIN Pro Programming A 2 Specifications and Restricted Items 2 1 Specifications High Speed Counter Input output contact number being Performance used eed specifications Built in Input high contact speed Min Related ON OFF Count number counter Contro Elapsed Target input Maximum instructions output value channel I flag value value pulse counting parenthe no area area width speed sis is reset input DT9044 DT9046 X2 CHO R903A to to DT9045 DT9047 DT905 50 1 DT9048 0 10 2 gt 2 CH1 R903B to to Specify DT9049 DT905 the Incremental 1 Total of desired input 4 CH with output Decrement ui 0 max from Y
40. For the difference between the normal IEC function and the function with an enable input see page 24 You can find an example for the function with enable in the Online Help 0527 The accuracy of the calculation decreases as the angle data specified in the input variable increases Therefore we recommend to enter angle data in radians gt 2x lt 2 This function is only available for the FPO Data types Data type I O Function REAL input input value angle data in radians REAL outputas cosine of input value input Error flags 3 IEC address Set If 0 900 7 permanently input variable does not have the data type REAL or input variable is gt 52707176 MX0 900 8 for an instant MX0 900 11 Permanently output variable is zero 0 900 9 for instant result overflows the output variable Example In this example the function COS is programmed in ladder diagram LD and instruction list IL The same POU header is used for both programming languages POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment Input value oo _ angle data in radians value REAL T00 jeosine sss This example uses variables You may also use a constant for the input variable Bod
41. Online Help Data types Data type I O Function TIME 1st input augend TIME 2nd input addend TIME output sum Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment Oo VAR time_vwalue_1 TIME F Tas RT _2 In this example the input variables time_value_1 and time_value_2 have been declared Instead you may enter constants directly at the input contacts of a func tion Body time_value_1 and time_value_2 are added The result is written in time_value_3 EE OPENS 0 2 time value 1 Timet value 3 time value 2 Time2 ST time value 3 ADD TIME time value 1 time value 2 98 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Process Data Type Functions E_ SUB_TIME E_ SUB_TIME Subtract TIME SUB_TIME subtracts the value of the second input variable from the value of the first and writes the result into the output variable Description Data types Example POU header Body LD ST For the difference between the normal IEC function and the f
42. Reception buffer when reception is completed When reception of data from an external device has been completed the reception completed flag R9038 goes on and further reception of data is not allowed To receive more data an F144 TRNS instruction must be executed to turn off the reception completed flag R9038 and clear the byte number to zero LD umm 1 i oo i i To repeat reception set to 0 at n R3038 will also go off when the number of transmission bytes is set and transmission is carried out Operation When the reception completed flag 9038 is off and data is sent from an external device operation will proceed as follows After RUN R9038 is off during the first scan 1 The data received is stored in order in the reception data storage area of reception buffer beginning from the lower byte of the second word of the area Start and end codes will not be stored With each one byte received the value in the leading address of the reception buffer is incremented by 1 206 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Data Transfer Instructions F144 TRNS Reception operation start Reopening Received data T U V Number of bytes 0 1 2 20 0 1 2 received on R9038 aff Execution condition on trigger Start off lt Y F144 TRNS Reception
43. Relay T C Register WX WY WR WL SV EV DT LD FL Constant dec or hex n x x available not available 460 CTi Automation Phone 800 894 0412 Fax 208 368 0415 Web www ctiautomation net Email info ctiautomation net Special Instructions F148 ERR Example In this example the function is programmed in ladder diagram LD and structured text ST The same POU header is used for both programming languages You can find an instruction list IL example in the online help POU In the POU header all input and output variables are declared that are used for header programming this function Class Identifier Type Initial Comment BOOL FALSE activates