background image

String instructions 

 

 

 
 

276 

Part II 

 

IE

C Instructions 

INSERT 

Insert characters 

 

 

To add an enable input and enable output to the instruction, select [With EN/ENO] from the 
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the 
context menu or press <Ctrl>+<Shift>+<v> in the programming window. 

 

 

PLC types 

Availability of 

INSERT

 (see page 

1327

 

 

If the strings are longer than the length defined for the input variables 
(input_string_1 and input_string_2) in the field "Type", an error occurs 
(see Special Internal Relays for Error Handling). 

 

The number of steps may vary depending on the PLC and parameters 
used, see also Table of Code Intensive Instructions in the online help. 
(up to 200 steps) 

 

 

 

Data type 

I/O 

Function 

STRING 

1st input 

input string 

STRING 

2nd input 

string to be inserted into input string 

INT 

3rd input 

position at which string is inserted 

STRING output 

  result 

string 

 

No. 

IEC address 

Set 

If 

R9007 

%MX0.900.7 permanently 

R9008 

%MX0.900.8   

for an instant 

  input strings are longer than the length 

defined for the input variables in the field 
"Type" 

 

 

 

 

 

Description 

INSERT inserts the string 

IN2

 into the string 

IN1

 beginning after the character position 

P

, where 0 

denotes the beginning of the string, 1 the position after the first string character, etc. The result is 
written into the output variable. 

Data types 

Error flags 

Example 

In this example, the same POU header is used for all programming languages. For an example 
using IL (instruction list), please refer to the online help. 

POU header 

All input and output variables used for programming this function have been declared in the POU 
header. 

Содержание FP Series

Страница 1: ...ric Works Nordic AB Sjöängsvägen 10 19272 Sollentuna Sweden Tel 46 859476680 Fax 46 859476690 www panasonic electric works se PEW Fire Security Technology Europe AB Jungmansgatan 12 21119 Malmö Tel 46 40697 7000 Fax 46 40697 7099 www panasonic fire security com Poland Panasonic Electric Works Polska sp z o o Al Krakowska 4 6 02 284 Warszawa Tel 48 0 22 338 11 33 Fax 48 0 22 338 12 00 www panasonic...

Страница 2: ...t or its documentation even if advised of the possibility of such damages We invite your comments on this manual Please e mail us at techdoc peweu eu panasonic com Please direct support matters and technical questions to your local Panasonic representative LIMITED WARRANTY If physical defects caused by distribution are found PEWEU will replace repair the product free of charge Exceptions include W...

Страница 3: ...cal injury CAUTION Indicates that you should proceed with caution Failure to do so may result in injury or significant damage to instruments or their contents e g data NOTE Contains important additional information EXAMPLE Contains an illustrative example of the previous text section 1 2 3 Procedure Indicates that a step by step procedure follows REFERENCE Indicates where you can find additional i...

Страница 4: ...s L LD 29 1 2 Addresses 30 1 2 1 FP Addresses 30 1 2 2 IEC Addresses 31 1 2 3 Specifying Relay Addresses 33 1 2 4 Timer Contacts T and Counter Contacts C 34 1 2 5 Error alarm relays 34 1 2 5 1 Restrictions of error alarm relays 36 1 2 6 Pulse relays P 36 1 2 6 1 Restrictions of pulse relay P 37 1 2 7 External input X and output relays Y 37 1 2 8 Word representation of relays WX WY WR and WL 37 1 3...

Страница 5: ...es 50 1 4 3 DUT 51 1 4 3 1 Creating DUTs 51 1 4 3 2 Using DUTs in the global variable list 51 1 4 3 3 Using DUTs in a POU header 52 1 4 3 4 DUTs with non overlapping elements 52 1 4 3 5 DUTs with overlapping elements 53 1 4 4 Array 53 1 4 5 Special data types only available in conversion functions 55 1 4 5 1 BOOL16 55 1 4 5 2 BOOL32 55 1 4 5 3 BCD_WORD 56 1 4 5 4 WORD_BCD 56 1 4 5 5 BCD_DWORD 56 1...

Страница 6: ...nput Data 70 ASIN Arcsine 71 COS Cosine 72 ACOS Arccosine 73 TAN Tangent 75 ATAN Arctangent 76 ATAN2_YX Returns the angle of the Cartesian coordinates x y 77 LN Natural logarithm 79 LOG Logarithm to the Base 10 80 EXP Exponent of input variable to base e 81 EXPT Raises 1st input variable by the power of the 2nd input variable 82 CRC16 Cyclic Redundancy Check 84 LIMIT Limit value for input variable...

Страница 7: ...GER into BOOL 118 UDINT_TO_BOOL Unsigned DOUBLE INTEGER into BOOL 119 BOOL_TO_WORD BOOL into WORD 120 BOOL16_TO_WORD BOOL16 to WORD 121 BOOLS_TO_WORD 16 Variables of the data type BOOL to WORD 122 DWORD_TO_WORD DOUBLE WORD in WORD 124 INT_TO_WORD INTEGER into WORD 125 DINT_TO_WORD DOUBLE INTEGER into WORD 126 UINT_TO_WORD Unsigned INTEGER into WORD 127 UDINT_TO_WORD Unsigned DOUBLE INTEGER into WO...

Страница 8: ...ght justified to INTEGER 156 BOOL_TO_UINT BOOL into Unsigned INTEGER 157 WORD_TO_UINT WORD to Unisgned INTEGER 158 WORD_BCD_TO_UINT Binary coded WORD value in Unsigned INTEGER 159 DWORD_TO_UINT DOUBLE WORD into Unsigned INTEGER 160 INT_TO_UINT INTEGER to Unsigned INTEGER 161 DINT_TO_UINT DOUBLE INTEGER into Unsigned INTEGER 162 UDINT_TO_UINT Unsigned DOUBLE INTEGER into Unsigned INTEGER 163 REAL_T...

Страница 9: ...IME into Unsigned DOUBLE INTEGER 191 TOD_TO_UDINT TIME_OF_DAY into Unsigned DOUBLE INTEGER 192 DWORD_TO_REAL DWORD into REAL 193 INT_TO_REAL INTEGER into REAL 194 DINT_TO_REAL DOUBLE INTEGER into REAL 195 UINT_TO_REAL Unsigned INTEGER into REAL 196 UDINT_TO_REAL Unsigned DOUBLE INTEGER into REAL 197 TIME_TO_REAL TIME into REAL 198 STRING_TO_REAL STRING to REAL 199 WORD_TO_TIME WORD in TIME 200 DWO...

Страница 10: ...16 variables of the data type BOOL 240 DWORD_TO_BOOLS DOUBLE WORD to 32 variables of the data type BOOL 242 INT_TO_BCD_WORD INTEGER into BCD value of WORD 244 DINT_TO_BCD_DWORD DOUBLE INTEGER into BCD DOUBLE WORD 245 UINT_TO_BCD_WORD Unsigned INTEGER into BCD value of WORD 246 UDINT_TO_BCD_DWORD Unsigned DOUBLE INTEGER into BCD DOUBLE WORD 247 STRING_TO_IPADDR STRING to IP Address 248 STRING_TO_IP...

Страница 11: ...DATE_INT Check whether a DATE is valid 291 IS_VALID_DT_INT Check whether DATE_AND_TIME is valid 292 IS_VALID_TOD_INT Check whether the TIME_OF_DAY is valid 294 SET_RTC_DT Set the Real Time Clock 295 SPLIT_DATE_INT Split a date into INTEGER values 296 SPLIT_DT_INT Split a date and time into INTEGER values 297 SPLIT_TOD_INT Split the time of day into INT values 299 SUB_DATE_DATE Subtracts a date fro...

Страница 12: ...tic instructions 341 F20_ADD 16 bit addition 342 F21_DADD 32 bit addition 344 F22_ADD2 16 bit addition destination can be specified 346 F23_DADD2 32 bit addition destination can be specified 348 F40_BADD 4 digit BCD addition 350 F41_DBADD 8 digit BCD addition 352 F42_BADD2 4 digit BCD addition destination can be specified 354 F43_DBADD2 8 digit BCD addition destination can be specified 356 F35_INC...

Страница 13: ...on 417 F301_BCOS BCD type Cosine operation 419 F302_BTAN BCD type Tangent operation 421 F303_BASIN BCD type Arcsine operation 423 F304_BACOS BCD type Arccosine operation 425 F305_BATAN BCD type Arctangent operation 427 F87_ABS 16 bit data absolute value 429 F88_DABS 32 bit data absolute value 431 F287_BAND 16 bit data deadband control 433 F288_DBAND 32 bit data deadband control 435 F348_FBAND Floa...

Страница 14: ... larger number order 501 F278_DSORT Sort data in 32 bit data table in smaller or larger number order 503 F353_FSORT Sort data in real number data table floating point data table 505 16 Bistable instructions 507 KEEP Serves as a relay with set and reset inputs 508 SET SET RESET 509 17 Bitwise Boolean instructions 511 F5_BTM Bit data move 512 F6_DGT Digit data move 514 F65_WAN 16 bit data AND 518 F6...

Страница 15: ...range 574 F111_WSHL Left shift of one word 16 bits of 16 bit data range 576 F112_WBSR Right shift of one hex digit 4 bits of 16 bit 5 data range 578 F113_WBSL Left shift of one hex digit 4 bits of 16 bit data range 580 F119_LRSR LEFT RIGHT shift register 582 F120_ROR 16 bit data right rotate 586 F121_ROL 16 bit data left rotate 588 F122_RCR 16 bit data right rotate with carry flag data 590 F123_RC...

Страница 16: ... 665 F236_DGRY 32 bit data 32 bit Gray code 666 F237_GBIN 16 bit Gray code 16 bit binary data 667 F238_DGBIN 32 bit Gray code 32 bit binary data 668 F240_COLM Bit line to bit column conversion 669 F241_LINE Bit column to bit line conversion 671 F250_BTOA Binary ASCII conversion 673 F251_ATOB ASCII Binary conversion 677 F252_ACHK ASCII data check 682 F325_FLT 16 Bit Integer Data to Floating Point D...

Страница 17: ...Controlled Evaluates the program controlled flag 726 22 3 3 Checking for MEWTOCOL COM master slave mode 726 F161_MRD_PARA Getting the communication modes in RUN mode from MCU s COM port 728 F161_MRD_STATUS Getting the statuses in RUN mode from MCU s COM port 730 22 3 3 1 Getting the communication modes and statuses via the input X flags from the MCU s COM ports in RUN mode 732 22 4 Data transfer i...

Страница 18: ...781 Is145F146NotActive for all ports via a general function 782 IsF145F146Error Returns the value of the F145F146 Error flag 783 23 Data transfer via network 785 23 1 Data transfer via MEWNET link 786 F145_SEND Data send MEWNET link 787 F146_RECV Data receive MEWNET link 789 23 2 Data transfer via shared memory of a MEWNET F Slave station 791 F152_RMRD Data read from the slave station 792 F153_RMW...

Страница 19: ...ree 32 bit data move 856 F309_FMV Floating Point Data Move 858 24 1 Data transfer to and from special data registers 859 24 2 Transferring data to and from file register banks 1 or 2 860 ReadDataFromFileRegisterBank Read Data from File Register Bank 1 or 2 861 WriteDataToFileRegisterBank Write Data to File Register Bank 1 or 2 863 25 Date and time instructions 865 F138_TIMEBCD_TO_SECBCD h min s s ...

Страница 20: ...ctions 913 TM_1ms_FB Timer for 1ms intervals 0 to 32 767s 914 TM_10ms_FB Timer for 10ms intervals 0 to 327 67s 917 TM_100ms_FB Timer for 100ms intervals 0 to 3276 7s 920 TM_1s_FB Timer for 1s intervals 0 to 32767s 923 TM_1ms Timer for 1ms intervals 0 to 32 767s 926 TM_10ms Timer for 10ms intervals 0 to 327 67s 928 TM_100ms Timer for 100ms intervals 0 to 3276 7s 930 TM_1s Timer for 1s intervals 0 t...

Страница 21: ...uctions 979 SYS1 Change PLC system setting 980 SYS2 Change System Register Settings for PC Link Area 994 33 Special instructions 997 F140_STC Carry flag set 998 F141_CLC Carry flag reset 999 F142_WDT Watchdog timer update 1000 F148_ERR Self diagnostic error set reset 1001 F149_MSG Message display 1003 F155_SMPL Transfer sampling data 1004 F156_STRG Set sampling trigger 1005 34 Program execution co...

Страница 22: ...ear interpolation 1073 F176_PulseOutput_Center Circular interpolation center position 1078 F176_PulseOutput_Pass Circular interpolation pass position 1082 F177_PulseOutput_Home Home Return 1086 Part IV Tool instructions 36 Analog unit instructions 1091 Unit_AnalogInOut_FP0_A21 Reads data from the FP0 A21 unit 1092 Unit_AnalogInput_FP0_A80 Reads data from the FP0 A80 unit 1097 Unit_AnalogInput_FP0_...

Страница 23: ...ons 1155 HscInfo_GetControlCode Returns control code of high speed counter channel 1156 HscInfo_GetCurrentSpeed Returns current speed of high speed counter channel 1157 HscInfo_IsActive Checks if high speed counter is active 1158 HscInfo_IsChannelEnabled Checks if high speed counter channel is enabled 1159 HscInfo_IsCountingDisabled Checks if counting is disabled 1160 HscInfo_IsElapsedValueReset C...

Страница 24: ...utput channel 1217 Pulse_TargetValueMatchClear Clears target value match control 1219 39 4 Pulse information instructions 1220 PulseInfo_GetControlCode Returns control code of pulse output channel 1221 PulseInfo_GetCurrentSpeed Returns current speed on pulse output channel 1222 PulseInfo_IsActive Check if pulse output is active 1224 PulseInfo_IsChannelEnabled Checks if pulse output channel is enab...

Страница 25: ...al to binary BCD gray code table 1253 40 6 Special data registers 1254 40 7 Relays and memory areas 1255 40 7 1 Relays and memory areas for FP0 1255 40 7 2 Relays and memory areas for FP0R 1257 40 7 3 Relays and memory areas for FP Sigma 1259 40 7 4 Relays and memory areas for FP X 1261 40 7 5 Relays and memory areas for FP e 1263 40 7 6 Relays and memory areas for FP2 1265 40 7 7 Relays and memor...

Страница 26: ... 40 9 3 Table of communication check error 1311 40 10 Error codes 1312 40 10 1 Error Codes E1 to E8 1312 40 10 2 Self Diagnostic Error Codes 1312 40 10 3 MEWTOCOL COM Error Codes 1313 40 11 MEWTOCOL COM Communication Commands 1315 40 12 Hexadecimal Binary BCD 1316 40 13 ASCII Codes 1317 40 14 Availability of all instructions on all PLC types 1318 Index 1335 Record of changes ...

Страница 27: ...Chapter 1 Basics ...

Страница 28: ...olding which means their contents will be lost e g after a power failure 1 1 2 Internal Relays Internal Relays are memory areas where you can store interim results Internal relays are treated like internal outputs In system register no 7 you define which internal relays are supposed to be holding non holding Holding means that its values will be retained even after a power failure The number of av...

Страница 29: ...to the timer counter area there is a memory area reserved for the set value SV and the elapsed value EV of each timer counter contact The size of both areas is 16 bits WORD In the SV and EV area one INTEGER value from 0 to 32 767 can be stored Timer Counter No SV EV Relay TM0 SV0 EV0 T0 TM99 SV99 EV99 T99 CT100 SV100 EV100 C100 While a timer or counter is being processed the respective acual value...

Страница 30: ...P DT90044 and DT90045 control flag of the high speed counter DT9052 DT90053 for FP0 T32CP real time clock FP2 FP2SH DT90054 to DT90058 FP0 T32CP DT90054 to DT90058 See also Data Transfer to and from Special Data Registers see page 859 1 1 7 File Registers FL Some PLC types see hardware description provide additional data registers which can be used to increase the number of data registers File reg...

Страница 31: ... and IEC addresses are composed 1 2 1 FP Addresses An address represents the hardware address of an in output register or counter For example the hardware address of the 1st input and the 4th output of a PLC is X0 X input 0 first relay Y3 Y output 3 fourth relay Use the following address abbreviations for the memory areas You find the register numbers in your hardware description Memory Area Abbr ...

Страница 32: ...the word and bit address Example IEC address for an input The per cent sign is the indicator of a physical address I means input X means data type BOOL The first zero represents the word address slot no and the second one the bit address Note that counting starts with zero and that counting word and bit addresses differs among the PLC types Each PLC provides internal memory areas M to store interi...

Страница 33: ...er 3 402823466 E38 1 175494351 E 38 0 0 1 175494351 E 38 3 402823466 E38 32 bits 0 0 T 0s T 327 67s 16 bits 1 TIME Duration T 0s T 21474836 47s 32 bits 1 T 0s DATE_AND_TIME Date and time DT 2001 01 01 00 00 00 DT 2099 12 31 23 59 59 32 bits DT 2001 01 01 00 00 00 DATE Date D 2001 01 01 D 2099 12 31 32 bits D 2001 01 01 TIME_OF_DAY Time of day TOD 00 00 00 TOD 23 59 59 32 bits TOD 00 00 00 STRING V...

Страница 34: ...4 7 12 11 10 13 16 15 14 17 B E D C F 1A 19 18 1B 1E 1D 1C 1F Output module Input module This shows how the hexadecimal counting of 0 F for 0 15 is converted The address assignment can be found in your hardware description Find the tables with all memory areas in your hardware description When using timers counters set elapsed values and data registers the bit address does not have to be indicated...

Страница 35: ... relays are designed to facilitate the analysis of error conditions and to record errors Therefore in the special data registers a buffer has been defined so that the user has access to information about errors and their occurrence including the actual number of error relays in the TRUE state the order they were set to TRUE and the time at which the first error relay was set to TRUE When an error ...

Страница 36: ... DT90401 DT90419 Error alarm relays stored in the order they were set to TRUE 3 Error alarm E15 is set to TRUE 4 Time at which the first error alarm relay was set to TRUE DT90420 Second and minute data DT90421 Hour and day data DT90422 Month and year data R9040 TRUE when one of the error alarm relays E0 E2047 is TRUE Because in Control FPWIN Pro all write operations on error relays are internally ...

Страница 37: ... affected special data registers are held To reset the error relays and the special data registers you have to press up the initialize test switch in PROG mode However in system register 4 bit 10 Error alarm relay can be set to Clear not to ensure that no error alarm relays are turned OFF when the initialize test switch is pressed up Then only the next download of the program will reset the error ...

Страница 38: ... output can be used for turning ON or OFF external devices The other external output relays can be used in the same way as internal relays I O allocation is based on the combination of I O and intelligent modules installed For FP10SH and FP2SH 8 192 points can be used including both input and output For FP2 and FP3 2048 points can be used Example 0 1 2 3 4 Slot No Power supply unit CPU Input unit ...

Страница 39: ...ut relay WX XFXEXDXCXBXAX9X8X7 X6 X5X4 X3X2X1 X0 WX0 X1FX1EX1D X12X11X10 WX1 X12FX12EX12D X122X121X120 WX12 Since the contents of the word relay correspond to the state of its relays components if some relays are turned ON the contents of the word change ...

Страница 40: ...y numbers including character bit and are processed as such Simply enter the decimal number in your program 1 3 2 Hexadecimal Constants Hexadecimal constants occupy fewer digit positions than binary data 16 bit constants can be represented by 4 digit 32 bit constants by 8 digit hecadecimal constants Range 16 bit 8000 to 7FFF Range 32 bit 80000000 to 7FFFFFFFF Enter e g 16 7FFF for the hexadecimal ...

Страница 41: ...23 59 59 32 bits DT 2001 01 01 00 00 00 DATE Date D 2001 01 01 D 2099 12 31 32 bits D 2001 01 01 TIME_OF_DAY Time of day TOD 00 00 00 TOD 23 59 59 32 bits TOD 00 00 00 STRING Variable length character string 1 32767 bytes ASCII depending on PLC memory size 2 words for the head n 1 2 words for the characters 1 Depending on PLC type 1 4 1 1 BOOL Variables of the data type BOOL are binary variables T...

Страница 42: ...47 The default initial value of a variable of this data type is 0 Numbers can be entered in decimal hexadecimal or binary format Decimal number Hexadecimal number Binary number 123456789 16 75BCD15 2 111010110111100110100010101 123456789 16 F8A432EB 2 1111100010100100001100101110 1 4 1 5 UDINT Variable values of the data type unsigned DOUBLE INTEGER are numerical numbers without decimal places The...

Страница 43: ...11010010 64302 16 FB2E 2 1111101100101110 1 4 1 8 DWORD A variable of the data type DOUBLE WORD consists of 32 binary states The switching states of 32 inputs outputs can be combined as a unity in one DOUBLE WORD The default initial value of a variable of this data type is 0 Numbers can be entered in decimal hexadecimal or binary format Decimal number Hexadecimal number Binary number 123456789 16 ...

Страница 44: ... 1 10 DATE_AND_TIME Variable values of the data type DATE_AND_TIME are date and time literals The range of values for DATE_AND_TIME values is from DT 2001 01 01 00 00 00 DT 2099 12 31 23 59 59 Description Examples Short prefix DT 2010 06 07 15 36 55 dt 2010 06 07 15 36 55 Long prefix DATE_AND_TIME 2010 06 07 15 36 55 date_and_time 2010 06 07 15 36 55 Internal representation Seconds after DT 2001 0...

Страница 45: ... and local time Building automation Holidays e g Easter holidays daylight saving time 1 4 1 12 TIME_OF_DAY Variable values of the data type TIME_OF_DAY are time of day literals The range of values for TIME_OF_DAY values is from TOD 00 00 00 TOD 23 59 59 Description Examples Short prefix TOD 15 36 55 tod 15 36 55 Long prefix TIME_OF_DAY 15 36 55 time_of_day 15 36 55 Internal representation Seconds ...

Страница 46: ...rve a certain memory area for the string specify the string length using the following formula Memory size 2 words header n 1 2 words characters The memory is organized in word units Therefore word numbers are always rounded up to the next whole number Word x Number of characters reserved for string Word x 1 Actual number of characters in string Word x 2 Character 2 Character 1 Word x 3 Character ...

Страница 47: ...nsferred only as many characters that fit into the target string are transferred Please refer to the following examples in the online help under the keyword STRING 1 Copy a source string to a target string which is shorter 2 Copy a constant character string to another which is shorter 3 Generate a message using a string function NOTE The conversion functions INT_TO_STRING see page 217 DINT_TO_STRI...

Страница 48: ...e output of the overall result EXAMPLE This arrangement is not possible This arrangement is possible Instruction list IL STRING instructions with EN ENO may be connected to each other in IL Nevertheless in order to avoid intermediate variables it is recommended that you use a conditional jump instead of connecting a series of functions with EN ENO EXAMPLE Program with dummy string ...

Страница 49: ...th conditional jump The difficulty of programming with a dummy string lies in correctly choosing its length When connecting unconditional string instructions in series the length is calculated automatically 2 MakeMessage2 ...

Страница 50: ...Basics 49 From these commands one gets the following address occupation Another use with functions from the FP TOOL Library Adr_OfVarOffs ...

Страница 51: ...selected in user defined POUs Generic data types are identified by the prefix ANY NOTE Generic data types are not available in user defined POUs Hierarchy of generic data types ANY_NUM REAL ANY_INT ANY_INT INT DINT UINT UDINT ANY16 WORD INT UINT ANY32 DWORD DINT UDINT DATE TOD DT ANY_BIT BOOL WORD DWORD ANY ANY_DATE DATE TOD DT ...

Страница 52: ...ess The first element of the DUT determines the address type for BOOL type elements assign a 1 bit address e g R10 for other data types assign a 16 bit address e g WR1 If you assign an address DUTs with non overlapping elements must consist entirely of BOOL type elements or entirely of non BOOL type elements 6 Under Type select to open the Type selection dialog 7 Under Type Class select Data Unit ...

Страница 53: ... for one single variable not for the DUT 10 Change initial value for the desired variable if necessary 11 OK 12 Under Comment enter a text if desired 13 Object Save Now the DUT or a single variable of the DUT can be used in the POU body The DUT can be assigned with the help of the Variables pane F2 NOTE A DUT defined in the global variable list can be used in a POU body only when copied into the h...

Страница 54: ...on no initialization is allowed The following default initializations are executed BOOL FALSE WORD INT DWORD DINT 0 REAL 0 0 STRING i e the address occupied by the maximum string length is initialized with the maximum length of the string that is greater or equal to zero The rest of the string is initialized with zeros Also all element variables of the data type STRING must be located at the end o...

Страница 55: ...nsion an array can have several fields Element indexes are positive or negative integers The first element must be smaller than the last element NOTE An array cannot be used as a variable by another array When accessing an index of an array Control FPWIN Pro does not check the index against the bounds of the array Make sure the index lies within the range defined in the POU header Example ARRAY 1 ...

Страница 56: ...n functions NOTE Valid data types are BOOL16 BOOL32 BOOLS SDT SDDT BCD IPADDR ETLANADDR These data types are valid for conversion functions to special data types see page 1335 only These data types cannot be declared in POU headers 1 4 5 1 BOOL16 Allowed are Arrays with exactly 16 elements of the data type BOOL Note These types can lie in the areas X Y R L T and C For failure to make an assignment...

Страница 57: ...s DINT_TO_BCD_DWORD see page 244 and UDINT_TO_BCD_DWORD see page 246 These conversion functions use variables of the type DWORD which are interpreted as BCD numbers e g the decimal number 654 is interpreted as the hexadecimal number 16 0654 1 4 5 6 DWORD_BCD The data type DWORD_BCD binary coded decimal only occurs in the conversion functions DWORD_BCD_TO_DINT see page 169 and DWORD_BCD_TO_UDINT se...

Страница 58: ...consists of four octal numbers with or without leading zeros seperated by periods in direct order i e the highest octal number in the ETLANADDR number will be the highest octal number in the string Example Value Conversion function Result ETLANADDR_TO_STRING 001 002 003 004 16 01020304 ETLANADDR_TO_STRING_ NO_LEADING_ZEROS 1 2 3 4 NOTE If you want an interpretation of the DWORD in inverse order us...

Страница 59: ...al variables they are automatically placed in R by the compiler All DUTs with a number of simple BOOL variables divisible by 16 remain Note These are automatically placed by the compiler in area R 1 4 5 10 ANY_SIMPLE_NOT_BOOL Allowed are Data types INT DINT WORD DWORD REAL STRING TIME but not BOOL These data types can lie in the following areas WX DWX WY DWY WR DWR WL DWL SV DSV EV DEV DT DDT LD D...

Страница 60: ...Chapter 2 Data transfer instructions ...

Страница 61: ...p Upgrade Problems with Data Type STRING Data type I O Function all data types input source all data types output as input destination In this example the input variable input_value has been declared Instead you may enter a constant directly at the input contact of a function Description MOVE assigns the unchanged value of the input variable to the output variable Data types Example In this exampl...

Страница 62: ...Chapter 3 Arithmetic instructions ...

Страница 63: ...L 2nd input addend INT DINT REAL output as input sum In this example the input variables summand_1 summand_2 and enable have been declared Instead you may enter constants directly into the function enable input e g for tests Description This function adds the input variables IN1 IN2 and writes the addition result into the output variable Data types Example In this example the same POU header is us...

Страница 64: ...AL 2nd input subtrahend INT DINT REAL output as input result In this example the input variables minuend subtrahend and enable have been declared Instead you may enter constants directly into the function enable input e g for tests Description The content of the accumulator is subtracted from the operand defined in the operand field The result is transferred to the accumulator Data types Example I...

Страница 65: ...ction INT DINT REAL 1st input multiplicand INT DINT REAL 2nd input multiplicator INT DINT REAL output as input result In this example the input variables multiplicand multiplicator and enable have been declared Instead you may enter constants directly into the function enable input e g for tests Description MUL multiplies the values of the input variables with each other and writes the result into...

Страница 66: ... types Availability of DIV see page 1335 Input and output variables must be of one of the noted data types All operands must be of the same data type The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help Data type I O Function INT DINT REAL 1st input dividend INT DINT REAL 2nd input divisor INT DINT REAL output as inp...

Страница 67: ...online help POU header All input and output variables which are required for programming the function are declared in the POU header In this example the input variables dividend divisor and enable have been declared Instead you may enter constants directly into the function enable input e g for tests Body If enable is set TRUE dividend is divided by divisor The result is written into result LD ...

Страница 68: ...n also use a constant for the input variable Description ABS calculates the value in the accumulator into an absolute value The result is saved in the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this...

Страница 69: ...escription MOD divides the value of the first input variable by the value of the second The rest of the integral division 5 2 2 rest 1 is written into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming ...

Страница 70: ...does not have the data type REAL or input variable is not 0 0 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variable Description SQRT calculates the square root of an input variable of the data type REAL value 0 0 The result is written into the...

Страница 71: ...output as input SINE of input value No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input variable does not have the data type REAL or input variable 52707176 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variab...

Страница 72: ... not have the data type REAL or input variable is not 1 0 and 1 0 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variable Description ASIN calculates the arcsine of the input variable and writes the angle data in radians into the output variable...

Страница 73: ...t If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input variable does not have the data type REAL or input variable 52707176 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variable Description COS calculates the cosine of the input...

Страница 74: ...MX0 900 8 for an instant input variable does not have the data type REAL or input variable is not 1 0 and 1 0 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variable Description ACOS calculates the arccosine of the input variable and writes the ...

Страница 75: ...Arithmetic instructions 74 Part II IEC Instructions When programming with structured text enter the following output_value ACOS input_value ...

Страница 76: ...ent of input value No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input variable does not have the data type REAL or input variable 52707176 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable Description TAN calculates the tangent of the input variable and writes the result into the o...

Страница 77: ...ave the data type REAL or input variable 52707176 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help This example uses variables You can also use a constant for the input v...

Страница 78: ... 270 φ Define ATAN2_YX as follows ATAN2_YX y x x y x 0 y 0 x 0 y 0 y 0 y 0 0 x 0 y 0 To add an enable input and enable output to the instruction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of ATAN2_YX see page 1318 Description ATAN2_YX retu...

Страница 79: ...sed for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following Angle value of point in quadrant 2 rPhi1Rad ATAN2_YX y 10 0 x 10 0 Result 2 3561947 rPhi1Degree rPhi1Rad DEGR_OF_RAD Result 135 00002 Angle value of point in quadrant 4 rPhi2Rad ATAN2_YX y...

Страница 80: ...t variable is not 0 0 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable This example uses variables You can also use a constant for the input variable Description LN calculates the logarithm of the input variable value 0 0 to the base e Euler s number 2 7182818 and writes the result into the output variable This func...

Страница 81: ...le does not have the data type REAL or input variable is not 0 0 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable Description LOG calculates the logarithm of the input variable value 0 0 to the base 10 and writes the result into the output variable Data types Error flags Example In this example the same POU header i...

Страница 82: ...le is not 87 33 and 88 72 R900B MX0 900 11 permanently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable Description EXP calculates the power of the input variable to the base e Euler s number 2 7182818 and writes the result into the output variable The input variable has to be greater than 87 33 and smaller than 88 72 This function is the rever...

Страница 83: ...manently output variable is zero R9009 MX0 900 9 for an instant processing result overflows the output variable Description EXPT raises the first input variable to the power of the second input variable OUT IN1IN2 and writes the result into the output variable Input variables have to be within the range 1 70141 x 10 E38 to 1 70141 x 10 E38 Data types Error flags Example In this example the same PO...

Страница 84: ...Arithmetic instructions 83 Part II IEC Instructions When programming with structured text enter the following output_value input_value_1 input_value_2 ...

Страница 85: ...ternal table is built During this time no check sum is calculated and the output IsValid remains FALSE Starting with the fifth scan the check sum is calculated and the output IsValid is set to TRUE StartAddress requires an address in the DT or FL area The number of steps can increase up to approx 200 when CRC16 is used as a sub program When programming please be aware that a certain amount of time...

Страница 86: ...indicating whether the calculated check sum is valid or not For PLCs which do not support the instruction F70_BCC see page 411 with CRC16 calculation FP0 FP5 FP10 the CRC is not valid during the first eight execution scans when an internal table is built if the address area of the variable StartAddress is not in the DT or FL area For PLCs that support the instruction F70_BCC with CRC16 calculation...

Страница 87: ...f it is above this limit the upper limit value will be transferred if it is below this limit the lower limit value will be transferred Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in ...

Страница 88: ...Chapter 4 Bitwise Boolean instructions ...

Страница 89: ... 2nd input element compared to input 1 BOOL WORD DWORD output as input result Input 1 Input 2 Output 0 0 0 0 1 0 1 0 0 Signal 1 1 1 Description The content of the accumulator is connected with the operand defined in the operand field by a logical AND operation The result is transferred to the accumulator Data types Truth table Example In this example the same POU header is used for all programming...

Страница 90: ... input 1 BOOL WORD DWORD output as input result Input 1 Input 2 Output 0 0 0 1 0 1 0 1 1 Signal 1 1 1 Description The content of the accumulator is connected with the operand defined in the operand field by a logical OR operation The result is transferred to the accumulator Data types Truth table Example In this example the same POU header is used for all programming languages For an example using...

Страница 91: ...2nd input element compared to input 1 BOOL WORD DWORD output as input result Input 1 Input 2 Output 0 0 0 1 0 1 0 1 1 Signal 1 1 0 Description The content of the accumulator is connected with the operand defined in the operand field by a logical XOR operation The result is transferred to the accumulator Data types Truth table Example In this example the same POU header is used for all programming ...

Страница 92: ...as input result This example uses variables You can also use a constant for the input variable Description NOT performs a bit inversion of input variables The result will be written into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and ou...

Страница 93: ......

Страница 94: ...Chapter 5 Bit shift instructions ...

Страница 95: ...d input number of bits by which the input value is shifted to the right ANY_BIT output as input result If the second input variable N the number of bits to be shifted is of the data type DWORD then only the lower 16 bits are taken into account The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help Description SHR shift...

Страница 96: ...ft instructions 95 Part II IEC Instructions Body The last N bits here 4 of source_register are right shifted The vacant positions on the left are filled with zeros The result is written into target_register LD ...

Страница 97: ...bits by which the input value is shifted to the left ANY_BIT output as input result If the second input variable N the number of bits to be shifted is of the data type DWORD then only the lower 16 bits are taken into account The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help Description SHL shifts a bit value by a ...

Страница 98: ...t instructions 97 Part II IEC Instructions Body The first N bits here 4 of source_register are left shifted the vacant positions on the right are filled with zeros The result is written into target_register LD ...

Страница 99: ...input number of bits by which the input value is rotated to the right ANY_BIT output as input result The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help Description ROR rotates a defined number N of bits to the right Data types Example In this example the same POU header is used for all programming languages For an ...

Страница 100: ...Bit shift instructions 99 Part II IEC Instructions LD ...

Страница 101: ... 2nd input number of bits by which the input value is rotated to the left ANY_BIT output as input result The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help Description ROL rotates a defined number N of bits to the left Data types Example In this example the same POU header is used for all programming languages For ...

Страница 102: ...Bit shift instructions 101 Part II IEC Instructions LD ...

Страница 103: ......

Страница 104: ...Chapter 6 Comparison instructions ...

Страница 105: ...n using more inputs the first input is compared with the second the second input is compared with the third input etc If the first value is greater than the second value AND the second value greater than third etc TRUE will be written into result otherwise FALSE In this example the input variables comparison_value reference_value and enable have been declared Instead you may enter constants direct...

Страница 106: ...Comparison instructions 105 Part II IEC Instructions LD ...

Страница 107: ...the first input is compared with the second the second input is compared with the third input etc If the first value is greater than or equal to the second value AND the second value is greater than or equal to the third value etc TRUE will be written into result otherwise FALSE In this example the input variables comparison_value reference_value and enable have been declared Instead you may enter...

Страница 108: ...Comparison instructions 107 Part II IEC Instructions LD ...

Страница 109: ...n using more inputs the first input is compared with the second the second input is compared with the third input etc If the first value is equal to the second value AND the second value is equal to the third value etc TRUE will be written into result otherwise FALSE In this example the input variables comparison_value reference_value and enable have been declared Instead you may enter constants d...

Страница 110: ...s the first input is compared with the second the second input is compared with the third input etc If the first value is less than or equal to the second value AND the second value is less than or equal to the third value etc TRUE will be written into result otherwise FALSE In this example the input variables comparison_value reference_value and enable have been declared Instead you may enter con...

Страница 111: ...ing more inputs the first input is compared with the second the second input is compared with the third input etc If the first value is less than the second value AND the second value is less than the third value etc TRUE will be written into result otherwise FALSE Description The content of the accumulator is compared with the operand defined in the operand field If the accumulator is less than t...

Страница 112: ...using more inputs the first input is compared with the second the second input is compared with the third input etc If the first value is not equal to the second value AND the second value is not equal to the third value etc TRUE will be written into result otherwise FALSE In this example the input variables comparison_value reference_value and enable have been declared Instead you may enter const...

Страница 113: ...he lower and upper limits Description This instruction evaluates whether the value at the input IN is within the limits set at minimum MN and maximum MX Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function ...

Страница 114: ...Chapter 7 Conversion instructions ...

Страница 115: ...ype BOOL output conversion result Description WORD_TO_BOOL converts a value of the data type WORD into a value of the data type BOOL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in th...

Страница 116: ... BOOL output conversion result Description DWORD_TO_BOOL converts a value of the data type DOUBLE WORD into a value of the data type BOOL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared ...

Страница 117: ...ue has the value 0 the conversion result will be 0 FALSE in any other case it will be 1 TRUE Description INT_TO_BOOL converts a value of the data type INT into a value of the data type BOOL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables us...

Страница 118: ...conversion result is FALSE in any other case TRUE Description DINT_TO_BOOL converts a value of the data type DINT into a value of the data type BOOL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have bee...

Страница 119: ...ee page 1332 If the input value 0 16 0000 the conversion result will be 0 FALSE in any other case it will be 1 TRUE Data type I O Function UINT Input input data type BOOL Output conversion result Description UINT_TO_BOOL converts a value of the data type Unsigned INTEGER into a value of the data type BOOL Data types Example In this example the function has been programmed in ladder diagram LD and ...

Страница 120: ...e 0 16 0000 the conversion result will be 0 FALSE in any other case it will be 1 TRUE Data type I O Function UDINT Input input data type BOOL Output conversion result Description UDINT_TO_BOOL converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type BOOL Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST PO...

Страница 121: ...nstead you may enter a constant directly at the input contact of a function Description BOOL_TO_WORD converts a value of the data type BOOL into a value of the data type WORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programm...

Страница 122: ...ext menu or press Ctrl Shift v in the programming window PLC types Availability of BOOL16_TO_WORD see page 1318 Data type Comment ARRAY of BOOL ARRAY with 16 elements WORD output variable POU header Body with and without EN ENO Description This function copies a variable of the special data type BOOL16 see page 55 an array with 16 elements of the data type BOOL or a DUT of 16 members of the data t...

Страница 123: ... any input allocated with the constants TRUE or FALSE Program code is only generated for inputs to which a variable is allocated To add an enable input and enable output to the instruction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of BOOL...

Страница 124: ...rsion instructions 123 Part II IEC Instructions Variable Data type Function BOOL0 BOOL15 BOOL 16 input variables of the data type BOOL WORD output variable POU header Body with and without EN ENO Data types ...

Страница 125: ...on result Description DWORD_TO_WORD converts a value of the data type DOUBLE WORD into a value of the data type WORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Thi...

Страница 126: ...RD output conversion result Description INT_TO_WORD converts a value of the data type INT into a value of the data type WORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU he...

Страница 127: ...version result Description DINT_TO_WORD converts a value of the data type DINT into a value of the data type WORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This e...

Страница 128: ... UINT_TO_WORD see page 1332 The first 16 bits of the input variable are assigned to the output variable Data type I O Function UINT Input input data type WORD Output conversion result Description UINT_TO_WORD converts a value of the data type Unsigned INTEGER into a value of the data type WORD Data types Example In this example the function has been programmed in ladder diagram LD and structured t...

Страница 129: ...e first 16 bits of the input variable are assigned to the output variable Data type I O Function UDINT Input input data type WORD Output conversion result Description UDINT_TO_WORD converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type WORD Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All...

Страница 130: ...0s 16 0064 Description TIME_TO_WORD converts a value of the data type TIME into a value of the data type WORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This examp...

Страница 131: ...ions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Example with and without EN ENO Permissible format Space Hexadecimal numbers Space e g afFE Permissible characters Space All characters except for plus minus and all hexadecimal numbers Hexadecimal numbers Hexadecimal numbers in the ranges 0 9 A F or a f ...

Страница 132: ... output to the instruction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Data type Comment STRING Input variable WORD Output variable Acceptable Format for STRING 4 Hex1Hex2Hex3Hex4 e g perhaps AFFE Acceptable characters Hex1 to Hex4 Hexadecimal numbers in the rang...

Страница 133: ...ead you may enter a constant directly at the input contact of a function Description BOOL_TO_DWORD converts a value of the data type BOOL into a value of the data type DWORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programmi...

Страница 134: ...ontext menu or press Ctrl Shift v in the programming window PLC types Availability of BOOL32_TO_DWORD see page 1318 Data type Comment ARRAY of BOOL ARRAY with 32 elements DWORD output variable POU header Body with and without EN ENO Description This function copies a variable of the special data type BOOL32 see page 55 an array with 32 elements of the data type BOOL or a DUT of 32 members of the d...

Страница 135: ...ly generated for inputs to which a variable is allocated To add an enable input and enable output to the instruction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of BOOLS_TO_DWORD see page 1318 Variable Data type Function BOOL0 BOOL31 BOOL 3...

Страница 136: ...Conversion instructions 135 Part II IEC Instructions Body with and without EN ENO ...

Страница 137: ...ersion result Description WORD_TO_DWORD converts a value of the data type WORD into a value of the data type DWORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This ...

Страница 138: ..._TO_DWORD converts a value of the data type INT into a value of the data type DWORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example uses variables You can ...

Страница 139: ...ut conversion result Description DINT_TO_DWORD converts a value of the data type DINT into a value of the data type DWORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU heade...

Страница 140: ...amming window PLC types Availability of UINT_TO_DWORD see page 1332 Data type I O Function UINT Input input data type DWORD Output conversion result Description UINT_TO_DWORD converts a value of the data type Unsigned INTEGER into a value of the data type DWORD Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and o...

Страница 141: ...ility of UDINT_TO_DWORD see page 1332 Data type I O Function UDINT Input input data type DWORD Output conversion result Description UDINT_TO_DWORD converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type DWORD Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used ...

Страница 142: ... page 1330 Data type I O Function REAL Input input data type DWORD Output conversion result Description REAL_TO_DWORD moves bitset information of a REAL variable to a DWORD variable The same functionality can be obtained using DWORD_OVERLAPPING_DUT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variabl...

Страница 143: ...into a value of the data type DWORD The time 10ms corresponds to the value 1 e g an input value of T 1s is converted to the value 100 16 64 Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declare...

Страница 144: ... pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window See also STRING_TO_DWORD_STEPSAVER Example with and without EN ENO Acceptable Format _ Space Hexadecimal number Space e g perhaps afFE Acceptable characters Space Space Signs Plus and minus Hexadecimal numbers Hexadecimal numbers in the range 0 9 or A F or a ...

Страница 145: ...t to the instruction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Data type Comment STRING Input variable DWORD Output variable Acceptable Format for STRING 8 Hex1Hex2Hex3Hex4Hex5Hex6Hex7Hex8 e g perhaps 001AAFFE Acceptable characters Hex1 to Hex8 Hexadecimal numb...

Страница 146: ...Instead you may enter a constant directly at the input contact of a function Description BOOL_TO_INT converts a value of the data type BOOL into a value of the data type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programmi...

Страница 147: ...conversion result Description WORD_TO_INT converts a value of the data type WORD into a value of the data type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This ...

Страница 148: ...r the input variable BCD constants can be expressed in Control FPWIN Pro as follows 2 0001100110010101 or 16 1995 Description WORD_BCD_TO_INT converts a binary coded BCD value of WORD into binary values of type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All inpu...

Страница 149: ...n DWORD_TO_INT converts a value of the data type DWORD into a value of the data type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the input varia...

Страница 150: ...ion result Description DINT_TO_INT converts a value of the data type DINT into a value of the data type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example...

Страница 151: ... programming window PLC types Availability of UINT_TO_INT see page 1332 Data type I O Function UINT Input input data type INT Output conversion result Description UINT_TO_INT converts a value of the data type Unsigned INTEGER into a value of the data type INT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and out...

Страница 152: ...lability of UDINT_TO_INT see page 1332 Data type I O Function UDINT Input input data type INT Output conversion result Description UDINT_TO_INT converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type INT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for p...

Страница 153: ...s variables You can also use a constant for the input variable Description REAL_TO_INT converts a value of the data type REAL into a value of the data type INTEGER Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this fu...

Страница 154: ...EC address Set If R9007 MX0 900 7 permanently input variable does not have the data type REAL R9008 MX0 900 8 for an instant output variable is greater than a 16 bit INTEGER R9009 MX0 900 9 for an instant output variable is zero Description TRUNC_TO_INT cuts off the decimal digits of a REAL number and delivers an output variable of the data type INTEGER Data types Error flags Example In this examp...

Страница 155: ... converts a value of the data type TIME into a value of the data type INT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example uses variables You can also use a...

Страница 156: ... EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Permissible format Space Sign Decimal numbers Space e g 123456 Permissible characters Space All characters except for plus minus and all decimal numbers Sign plus minus Decimal numbers Decimal numbers 0 9 The analysis ends with th...

Страница 157: ...ction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Acceptable Format Space Sign Decimal number e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal Number Decimal numbers 0 9 PLC types Availability of STRING_TO_INT_STEPSAVER see page 1331 Data...

Страница 158: ...ing window PLC types Availability of BOOL_TO_UINT see page 1318 Data type I O Function BOOL Input input data type UINT Output conversion result Description BOOL_TO_UINT converts a value of the data type BOOL into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output v...

Страница 159: ...press Ctrl Shift v in the programming window PLC types Availability of WORD_TO_UINT see page 1333 Data type I O Function WORD Input input data type UDINT Output conversion result Description WORD_TO_UINT converts a value of the data type WORD into a value of the data type Unsigned INTEGER Data types Example In this example the function is programmed in ladder diagram LD POU header All input and ou...

Страница 160: ...ress Ctrl Shift v in the programming window PLC types Availability of WORD_BCD_TO_UINT see page 1333 Data type I O Function WORD_BCD Input input data type UINT Output conversion result Description WORD_BCD_TO_UINT converts a binary coded value of the data type WORD into a value of the data type Unsigned INTEGER Data types Example In this example the function is programmed in ladder diagram LD POU ...

Страница 161: ...amming window PLC types Availability of DWORD_TO_UINT see page 1319 Data type I O Function DWORD Input input data type UINT Output conversion result Description DWORD_TO_UINT converts a value of the data type DWORD into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and o...

Страница 162: ...gramming window PLC types Availability of INT_TO_UINT see page 1327 Data type I O Function INT Input input data type UINT Output conversion result Description INT_TO_UINT converts a value of the data type INT into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output ...

Страница 163: ...rogramming window PLC types Availability of DINT_TO_UINT see page 1319 Data type I O Function DINT Input input data type UINT Output conversion result Description DINT_TO_UINT converts a value of the data type DINT into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and o...

Страница 164: ...ing window PLC types Availability of UDINT_TO_UINT see page 1332 Data type I O Function UDINT Input input data type UINT Output conversion result Description UDINT_TO_UINT converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header ...

Страница 165: ...lso TRUNC_TO_UINT see page 164 PLC types Availability of REAL_TO_UINT see page 1330 Data type I O Function REAL Input input data type UINT Output conversion result Description REAL_TO_UINT converts a value of the data type REAL into a value of the data type Unsigned INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header Al...

Страница 166: ...d towards zero Data type I O Function REAL Input input data type INT Output conversion result No IEC address Set If R9007 MX0 900 7 permanently the input variable is not of the data type REAL R9008 MX0 900 8 for an instant the output variable is greater than a 16 bit INTEGER R9009 MX0 900 9 for an instant the output variable is zero Description TRUNC_TO_UINT cuts off any digits following the decim...

Страница 167: ... instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Acceptable Format Space Sign Decimal number Space e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal numbers Decimal numbers 0 9 The analysis ends with the first non decimal number PLC types Availability of STRING_TO_UINT see page 1331 Data type Comment STRING Input UINT O...

Страница 168: ...the context menu or press Ctrl Shift v in the programming window Acceptable Format Space Sign Decimal number e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal Number Decimal numbers 0 9 PLC types Availability of STRING_TO_UINT_STEPSAVER see page 1331 Data type Comment STRING Input UINT Output Description STRING_TO_UINT_STEPSAVER converts a right justifed decimal number in a...

Страница 169: ...clared Instead you may enter a constant directly at the input contact of a function Description BOOL_TO_DINT converts a value of the data type BOOL into a value of the data type DINT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for ...

Страница 170: ...WORD_TO_DINT converts a value of the data type WORD into a value of the data type DINT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example uses variables You c...

Страница 171: ...icated in Control FPWIN Pro as follows 2 00011001100101010001100110010101 or 16 19951995 Description DWORD_BCD_TO_DINT converts a binary coded value of the data type DWORD into a binary value of the data type DINT in order to be able to process a BCD value in double word format Data types Example In this example the same POU header is used for all programming languages For an example using IL inst...

Страница 172: ...ut conversion result Description DWORD_TO_DINT converts a value of the data type DOUBLE WORD into a value of the data type DOUBLE INTEGER Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared ...

Страница 173: ...NT_TO_DINT converts a value of the data type INT into a value of the data type DINT Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example uses variables You can ...

Страница 174: ...rogramming window PLC types Availability of UINT_TO_DINT see page 1332 Data type I O Function UINT Input input data type DINT Output conversion result Description UINT_TO_DINT converts a value of the data type Unsigned INTEGER into a value of the data type DINT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and o...

Страница 175: ...ilability of UDINT_TO_DINT see page 1332 Data type I O Function UDINT Input input data type DINT Output conversion result Description UDINT_TO_DINT converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type DINT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used ...

Страница 176: ...iption REAL_TO_DINT converts a value of the data type REAL into a value of the data type DOUBLE INTEGER The result is rounded off to the nearest whole number for the conversion Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for progra...

Страница 177: ...t No IEC address Set If R9007 MX0 900 7 permanently input variable does not have the data type REAL R9008 MX0 900 8 for an instant output variable is greater than a 32 bit DOUBLE INTEGER R9009 MX0 900 9 for an instant output variable is zero Description TRUNC_TO_DINT cuts off the decimal digits of a REAL number and delivers an output variable of the data type DOUBLE INTEGER Data types Error flags ...

Страница 178: ... value of the data type DINT The time 10ms corresponds to the value 1 e g an input value of T 1m0s is converted to the value 6000 Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the P...

Страница 179: ...n select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Example with and without EN ENO Acceptable Format Space Sign Decimal number Space e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal Numbers Decimal numbers 0 9 The analysis ends with the first ...

Страница 180: ...truction select With EN ENO from the Instructions pane LD FBD or IL editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Acceptable Format Space Sign Decimal number e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal Numbers Decimal numbers 0 9 PLC types Availability of STRING_TO_DINT_STEPSAVER see page 1331...

Страница 181: ...ty of BOOL_TO_UDINT see page 1318 Data type I O Function BOOL Input input data type UDINT Output conversion result Description BOOL_TO_UDINT converts a value of the data type BOOL into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for pro...

Страница 182: ...ity of WORD_TO_UDINT see page 1333 Data type I O Function WORD Input input data type UDINT Output conversion result Description WORD_TO_UDINT converts a value of the data type WORD into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for pr...

Страница 183: ...lity of DWORD_TO_UDINT see page 1319 Data type I O Function DWORD Input input data type UDINT Output conversion result Description DWORD_TO_UDINT converts a value of the data type DWORD into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used f...

Страница 184: ...ress Ctrl Shift v in the programming window PLC types Availability of DWORD_BCD_TO_UDINT see page 1319 Data type I O Function DWORD_BCD Input input data type UDINT Output conversion result Description DWORD_BCD_TO_UDINT converts a binary value of the data type DWORD into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function is programmed in ladder diagram...

Страница 185: ...lability of INT_TO_UDINT see page 1327 Data type I O Function INT Input input data type UDINT Output conversion result Description INT_TO_UDINT converts a value of the data type INT into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for p...

Страница 186: ...ng window PLC types Availability of UINT_TO_UDINT see page 1332 Data type I O Function UINT Input input data type UDINT Output conversion result Description UINT_TO_UDINT converts a value of the data type Unsigned INTEGER into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header A...

Страница 187: ...ilability of DINT_TO_UDINT see page 1319 Data type I O Function DINT Input input data type UDINT Output conversion result Description DINT_TO_UDINT converts a value of the data type DINT into a value of the data type Unsigned DOUBLE INTEGER Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used ...

Страница 188: ...olution of about 7 digits information for large numbers will be lost Data type I O Function REAL Input input data type UDINT Output conversion result Description REAL_TO_UDINT converts a value of the data type REAL into a value of the data type Unsigned DOUBLE INTEGER The result is rounded off to the nearest whole number for the conversion Data types Example In this example the function has been p...

Страница 189: ...n for large numbers will be lost Data type I O Function REAL Input input data type UDINT Output conversion result No IEC address Set If R9007 MX0 900 7 permanently the input variable is not of the data type REAL R9008 MX0 900 8 for an instant the output variable is greater than a 32 bit DOUBLE INTEGER R9009 MX0 900 9 for an instant the output variable is zero Description TRUNC_TO_UDINT cuts off th...

Страница 190: ...nu or press Ctrl Shift v in the programming window Acceptable Format Space Sign Decimal number Space e g 123456 Acceptable characters Space Space Signs Plus and minus Decimal numbers Decimal numbers 0 9 The analysis ends with the first non decimal number PLC types Availability of STRING_TO_UDINT see page 1331 Data type Comment STRING Input UDINT Output Description STRING_TO_UDINT converts a string...

Страница 191: ...ta type I O Function DATE Input input data type UDINT Output conversion result Description DATE_TO_UDINT converts a value of the data type DATE into a value of the data type Unsigned DOUBLE INTEGER according to its internal format which is seconds elapsed since 2001 01 01 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All ...

Страница 192: ... type I O Function DT Input input data type UDINT Output conversion result Description DT_TO_UDINT converts a value of the data type DATE_AND_TIME into a value of the data type Unsigned DOUBLE INTEGER according to its internal format which is seconds elapsed since 2001 01 01 00 00 00 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU...

Страница 193: ...Data type I O Function TOD Input input data type UDINT Output conversion result Description TOD_TO_UDINT converts a value of the data type TIME_OF_DAY into a value of the data type Unsigned DOUBLE INTEGER according to its internal format which is seconds elapsed since 00 00 00 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header...

Страница 194: ... 1319 Data type I O Function DWORD Input input data type REAL Output conversion result Description DWORD_TO_REAL moves the bitset information of a DWORD variable to a REAL variable The same functionality can be obtained using DWORD_OVERLAPPING_DUT Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variable...

Страница 195: ...e data type INTEGER into a value of the data type REAL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the input variable INT_value has been declared In...

Страница 196: ...REAL converts a value of the data type DOUBLE INTEGER into a value of the data type REAL Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example uses variables You...

Страница 197: ...see page 1332 Since REAL numbers only have a resolution of about 7 digits information for large numbers will be lost Data type I O Function UINT Input input data type REAL Output conversion result Description UINT_TO_REAL converts a value of the data type Unsigned INTEGER into a value of the data type REAL Data types Example In this example the function has been programmed in ladder diagram LD and...

Страница 198: ...rs only have a resolution of about 7 digits information for large numbers will be lost Data type I O Function UDINT Input input data type REAL Output conversion result Description UDINT_TO_REAL converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type REAL Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST P...

Страница 199: ...O_REAL converts a value of the data type TIME to a value of the data type REAL 10ms of the data type TIME correspond to 1 0 REAL unit e g when TIME 10ms REAL 1 0 when TIME 1s REAL 100 0 The resolution amounts to 10ms Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All in...

Страница 200: ...n instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Example with and without EN ENO Permissible format Space Sign Decimal numbers Decimal numbers Space e g 123 456 Permissible characters Space All characters except for plus minus and all decimal numbers Decimal numbers Decimal numbers 0 9 The analysis ends with the first non decimal number PLC t...

Страница 201: ...00ms Description WORD_TO_TIME converts a value of the data type WORD into a value of the data type TIME Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This example use...

Страница 202: ...he data type TIME A value of 1 corresponds to a time of 10ms e g the input value 12345 16 3039 is converted to a TIME T 2m3s450 00ms Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in th...

Страница 203: ...T into a value of the data type TIME The resolution is 10ms e g when the INT value 350 the TIME value 3s500ms Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header This examp...

Страница 204: ...alue of the data type TIME A value of 1 corresponds to a time of 10ms e g an input value of 123 is converted to a TIME T 1s230 00ms Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the...

Страница 205: ... 0 TIME 10ms when REAL 100 0 TIME 1s The value of the data type real is rounded off to the nearest whole number for the conversion Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help Since constants are entered directly at the function s input contact pins only the output variable need...

Страница 206: ...ty of UDINT_TO_DT see page 1332 Data type I O Function UDINT Input input data type DATE_AND_TIME Output conversion result Description UDINT_TO_DT converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type DATE_AND_TIME Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variable...

Страница 207: ...Availability of DT_TO_DATE see page 1319 Data type I O Function DATE_AND_TIME input date and time DATE output date Description DT_TO_DATE converts a value of the data type DATE_AND_TIME to a value of the data type DATE Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for programming this f...

Страница 208: ...lity of UDINT_TO_DATE see page 1332 Data type I O Function UDINT Input input data type DATE Output conversion result Description UDINT_TO_DATE converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type DATE Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for p...

Страница 209: ...ty of DT_TO_TOD see page 1319 Data type I O Function DATE_AND_TIME input input data type TIME_OF_DAY output conversion result Description DT_TO_TOD converts a value of the data type DATE_AND_TIME to a value of the data type TIME_OF_DAY Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for p...

Страница 210: ...ty of UDINT_TO_TOD see page 1332 Data type I O Function UDINT Input input data type TIME_OF_DAY Output conversion result Description UDINT_TO_TOD converts a value of the data type Unsigned DOUBLE INTEGER into a value of the data type TIME_OF_DAY Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables ...

Страница 211: ...can store a maximum of two characters You can declare a character string that has more than one character e g STRING 5 From the 5 characters reserved only 2 are used Instead of using the variable input_value you can write the constants TRUE or FALSE directly to the function s input contact in the body Description The function BOOL_TO_STRING converts a value of the data type BOOL to a value of the ...

Страница 212: ... example illustrates how you create a STRING 5 that contains the characters TRUE or FALSE from an input value of the data type BOOL The same POU header is used for all programming languages POU header Body In order to realize the intended operation the standard function MOVE is used It assigns the value of its input to its output unchanged At the input the STRING constant TRUE or FALSE is attached...

Страница 213: ...tion refer to the online help Upgrade Problems with Data Type STRING Data type I O Function WORD input input data type STRING output conversion result Description The function WORD_TO_STRING converts a value of the data type WORD to a value of the data type STRING Explanation Data types Example 1 In this example the same POU header is used for all programming languages For an example using IL inst...

Страница 214: ...n input variable input_value of the data type WORD and an output variable result_string of the data type STRING 4 are declared Body In carrying out the operation in question the standard function RIGHT is attached to the function WORD_TO_STRING RIGHT creates a right justified character string of length L In the example the output string of WORD_TO_STRING function is added at the input of the RIGHT...

Страница 215: ... information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function DWORD input input data type STRING output conversion result Description The function DWORD_TO_STRING converts a value of the data type DWORD to a value of the data type STRING Explanation Data types Example 1 In this example the same POU header is used for all programming languages For an example us...

Страница 216: ...e data type STRING 10 are declared Body In carrying out the operation in question the standard function REPLACE is attached to the function DWORD_TO_STRING REPLACE replaces one section of a character string with another In the example the output string of DWORD_TO_STRING function is added at input IN1 of the REPLACE function At input IN2 the STRING constant 0x is added as the replacement STRING At...

Страница 217: ... of DATE_TO_STRING see page 1319 All character spaces in the result string will be filled Data type I O Function DATE input input data type STRING output conversion result STRING 10 Description DATE_TO_STRING converts a value of the data type DATE into a value of the data type STRING 10 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST ...

Страница 218: ...lability of DT_TO_STRING see page 1319 All character spaces in the result string will be filled Data type I O Function DATE_AND_TIME input input data type STRING output conversion result STRING 19 Description DT_TO_STRING converts a value of the data type DATE_AND_TIME into a value of the data type STRING 19 Data types Example In this example the function has been programmed in ladder diagram LD a...

Страница 219: ... FP0 make sure that the length of the result string is equal to or greater than the length of the source string For further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function INT input input data type STRING output conversion result Description The function INT_TO_STRING converts a value of the data type INT to a value of the data type STRING Explana...

Страница 220: ...data type INT POU header In this example both an input variable INT_value of the data type INT and an output variable result_string of the data type STRING 2 are declared Body In carrying out the operation in question the standard function RIGHT see page 265 is attached to the function INT_TO_STRING RIGHT creates a right justified character string with the length L In the example the variable INT_...

Страница 221: ...a type STRING output conversion result Function used String1 defined as Result STRING 1 5 STRING 2 25 STRING 3 025 STRING 4 0025 STRING 5 00025 STRING 6 000025 STRING 7 0000025 STRING 8 00000025 String1 INT_TO_STRING 25 and so on PLC types Availability of INT_TO_STRING_LEADING_ZEROS see page 1327 When using the data type STRING with small PLCs like FP e or FP0 make sure that the length of the resu...

Страница 222: ...make sure that the length of the result string is equal to or greater than the length of the source string For further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function DINT input input data type STRING output conversion result Description The function DINT_TO_STRING converts a value of the data type DINT to a value of the data type STRING Explanati...

Страница 223: ... example both an input variable input_value of the data type DINT and an output variable result_string of the data type STRING 14 are declared Body In carrying out the operation in question three standard functions INSERT are attached successively to the function DINT_TO_STRING Each INSERT function inserts the attached character string at input IN2 into the character string at input IN1 The positi...

Страница 224: ...that the length of the result string is equal to or greater than the length of the source string For further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function UDINT Input Input data type STRING Output Conversion result Description The function UDINT_TO_STRING converts a value of the data type UDINT to a value of the data type STRING Explanation Data...

Страница 225: ...e of the data type DINT is converted into STRING 11 The converted value is written to result_string When the variable input_value 12345678 result_string shows 12345678 LD ST When programming with structured text enter the following result_string UDINT_TO_STRING input_value ...

Страница 226: ...indow PLC types Availability of DINT_TO_STRING_LEADING_ZEROS see page 1319 When using the data type STRING with small PLCs like FP e or FP0 make sure that the length of the result string is equal to or greater than the length of the source string For further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function DINT input input data type STRING output c...

Страница 227: ...ng window PLC types Availability of UDINT_TO_STRING_LEADING_ZEROS see page 1319 When using the data type STRING with small PLCs like FP e or FP0 make sure that the length of the result string is equal to or greater than the length of the source string For further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function UDINT input input data type STRING ou...

Страница 228: ...nu or press Ctrl Shift v in the programming window PLC types Availability of UINT_TO_STRING see page 1332 The result is not specified when the range of the input values does not match the range of the output values Data type I O Function UINT Input input data type STRING Output conversion result Description UINT_TO_STRING converts a value of the data type Unsigned INTEGER into a value of the data ...

Страница 229: ... in the programming window PLC types Availability of UINT_TO_STRING_LEADING_ZEROS see page 1332 The result is not specified when the range of the input values does not match the range of the output values Data type I O Function UINT Input input data type STRING Output conversion result Description UINT_TO_STRING_LEADING_ZEROS converts a value of the data type Unsigned INTEGER into a value of the d...

Страница 230: ...converts a value from the data type REAL into a value of the data type STRING 15 which has 7 spaces both before and after the decimal point The resulting string is right justified within the range 999999 0000000 to 9999999 0000000 The plus sign is omitted in the positive range Leading zeros are filled with empty spaces e g out of 12 0 the STRING 12 0 Data types Example In this example the same POU...

Страница 231: ...TRING 7 are declared Body In carrying out the operation in question the standard function MID is attached to the function REAL_TO_STRING MID creates a central sector in the character string from position P INT value with L INT value characters In the example the INT constant 7 is entered at the L input of MID which determines the length of the result string The INT constant 4 at input P determines...

Страница 232: ...t time prefix and without underlines Possible values for the result string s range are from T 000d00h00m00s000ms to T 248d13h13m56s470ms Data types Example 1 In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header In the POU header input and output variables are declared that are used in the funct...

Страница 233: ...pe STRING 9 are declared Body In carrying out the operation in question the standard function MID is attached to the function TIME_TO_STRING MID creates a central sector in the character string from position P INT value with L INT value characters In the example the INT constant 9 is entered at the L input of MID which determines the length of the result string The INT constant 7 at input P determ...

Страница 234: ... without leading zeros in the range 0 255 The conversion is such that the highest byte of the ET LAN address represents the fourth octet and lowest byte of the IP address the first octet The format of the IP address corresponds to the standard format as used in Standard Socket Application Interfaces for example Description This function converts a binary IP address of the data type DWORD into a ST...

Страница 235: ...ositions without leading zeros in the range 0 255 The conversion is such that the highest byte of the ET LAN address represents the fourth octet and lowest byte of the IP address the first octet The format of the IP address corresponds to the standard format as used in Standard Socket Application Interfaces for example Description This function converts a binary IP address of the data type DWORD i...

Страница 236: ...w Permissible format Octet1 Octet2 Octet3 Octet4 e g 192 168 206 004 Permissible characters Octets 1 4 Decimal numbers 0 9 maximal 3 positions with leading zeros in the range 0 255 The conversion is such that the highest byte of the ET LAN address represents the first octet and lowest byte of the IP address the fourth octet This format for ET LAN addresses is used for example by the FP Serie s ET ...

Страница 237: ...ng window Permissible format Octet1 Octet2 Octet3 Octet4 e g 192 168 206 4 Permissible characters Octets 1 4 Decimal numbers 0 9 maximal 3 positions without leading zeros in the range 0 255 The conversion is such that the highest byte of the ET LAN address represents the first octet and lowest byte of the IP address the fourth octet This format for ET LAN addresses is used for example by the FP Se...

Страница 238: ...tly used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of TOD_TO_STRING see page 1332 All character spaces in the result string will be filled Data type I O Function TIME_OF_DAY input input data type STRING output conversion result STRING 8 Description Data types Example In this example the function has been programmed in ladder diagram LD and structu...

Страница 239: ... instruction select Recently used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of WORD_TO_BOOL16 see page 1333 Data type Comment WORD input variable ARRAY of BOOL ARRAY with 16 elements POU header Body with and without EN ENO Description This function copies data of the data type WORD at the input to an array with 16 elements of the data type BOOL at...

Страница 240: ...an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window PLC types Availability of DWORD_TO_BOOL32 see page 1319 Data type Comment DWORD input variable ARRAY of BOOL ARRAY with 32 elements POU header Body with and without EN ENO Description This function copies data of the data type DWORD at the input to an array with 32 elements of the data type BO...

Страница 241: ...ft v in the programming window The outputs Bool0 to Bool15 need not be allocated in LD or FBD or used explicitly in the ST editor s formal list of parameters Program code is only generated for those outputs that are truly used PLC types Availability of WORD_TO_BOOLS see page 1333 Variable Data type Function In WORD input variable BOOL0 BOOL15 BOOL 16 output variables of the data type BOOL Descript...

Страница 242: ...Conversion instructions 241 Part II IEC Instructions Body ...

Страница 243: ...in the programming window The outputs Bool0 to Bool31 need not be allocated in LD or FBD or used explicitly in the ST editor s formal list of parameters Program code is only generated for those outputs that are truly used PLC types Availability of DWORD_TO_BOOLS see page 1319 Variable Data type Function In DWORD input variable BOOL0 BOOL31 BOOL 32 output variables of the data type BOOL POU header ...

Страница 244: ...Conversion instructions 243 Part II IEC Instructions Body ...

Страница 245: ... Output conversion result Description INT_TO_BCD_WORD converts a binary value of the data type INT into a binary coded decimal integer BCD value of the type WORD in order to be able to output BCD values in word format Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All i...

Страница 246: ...ersion result Description DINT_TO_BCD_DWORD converts a value of the data type DINT into a BCD value of the data type DWORD Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU head...

Страница 247: ...g window PLC types Availability of UINT_TO_BCD_WORD see page 1332 Data type I O Function UINT Input input data type BCD_WORD Output conversion result Description UINT_TO_BCD_WORD converts a value of the data type Unsigned INTEGER into a BCD value of the data type WORD Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All inpu...

Страница 248: ... UDINT_TO_BCD_DWORD see page 1332 Data type I O Function UDINT Input input data type BCD_DWORD Output conversion result Description UDINT_TO_BCD_DWORD converts a value of the data type Unsigned DOUBLE INTEGER into a BCD value of the data type D WORD Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variab...

Страница 249: ...pace Octet1 Octet2 Octet3 Octet4 Space e g 192 168 206 4 Permissible characters Space All characters except for decimal numbers Octets 1 4 Decimal numbers 0 9 maximal 3 positions with or without leading zeros in the range 0 255 PLC types Availability of STRING_TO_IPADDR see page 1331 The analysis ends with the first non decimal number after the 4th octet or in case of a format error If the format ...

Страница 250: ... Shift v in the programming window Example Permissible format Octet1 Octet2 Octet3 Octet4 Space e g 192 168 206 4 Permissible characters Octets 1 4 Decimal numbers 0 9 maximal 3 positions with or without leading zeros in the range 0 255 PLC types Availability of STRING_TO_IPADDR_STEPSAVER see page 1331 If the format is wrong the result is 0 The conversion is such that the first octet represents th...

Страница 251: ...ndow See also STRING_TO_ETLANADDR_STEPSAVER Example with and without EN ENO Permissible format Space Octet1 Octet2 Octet3 Octet4 Space e g 192 168 206 4 Permissible characters Space All characters except for decimal numbers Octets 1 4 Decimal numbers 0 9 maximal 3 positions with or without leading zeros in the range 0 255 The analysis ends with the first non decimal number after the 4th octet or i...

Страница 252: ...L editor To reuse an instruction select Recently used from the context menu or press Ctrl Shift v in the programming window Example Permissible format Octet1 Octet2 Octet3 Octet4 Space e g 192 168 206 4 Permissible characters Octets 1 4 Decimal numbers 0 9 maximal 3 positions with or without leading zeros in the range 0 255 If the format is wrong the result is 0 The conversion is such that the hig...

Страница 253: ......

Страница 254: ...Chapter 8 Selection instructions ...

Страница 255: ...er input variable s value is greater In this example the input variables value_1 and value_2 have been declared Instead you may enter a constant directly at the input contact of a function Description MAX determines the input variable with the highest value Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please r...

Страница 256: ...whichever input variable s value is smallest In this example the input variables value_1 and value_2 have been declared Instead you may enter a constant directly at the input contact of a function Description MIN detects the input variable with the lowest value Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list plea...

Страница 257: ...put contacts lies in the range of 2 to 28 Data type I O Function INT 1st input selects channel for 2nd or 3rd input value to be written to all data types 2nd input value 1 all data types 3rd input value 2 all data types output as 2nd and 3rd input result The 2nd and 3rd input variables must be of the same data type In this example the input variables channel_select channel_0 and channel_1 have bee...

Страница 258: ...dy 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 into output LD ST When programming with structured text enter the following output MUX K channel_select IN0 channel_0 IN1 channel_1 ...

Страница 259: ...s with MUX Data type I O Function BOOL G selects between input value IN0 or IN1 all data types IN0 value is written into the output variable if G FALSE all data types IN1 value is written into the output variable if G TRUE all data types output result value as IN0 or IN1 In this example the input variables channel_select channel_0 and channel_1 have been declared Instead you may enter a constant d...

Страница 260: ...Selection instructions 259 Part II IEC Instructions LD ST When programming with structured text enter the following output SEL G channel_select IN0 channel_0 IN1 channel_1 ...

Страница 261: ......

Страница 262: ...Chapter 9 String instructions ...

Страница 263: ...r further information refer to the online help Upgrade Problems with Data Type STRING Data type I O Function STRING input input data type INT output length of string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input string is longer than the length defined for the input variable in the field Type Description LEN calculates the length of the input string and wri...

Страница 264: ...String instructions 263 Part II IEC Instructions LD ST When programming with structured text enter the following output_value LEN input_value ...

Страница 265: ...d see also Table of Code Intensive Instructions in the online help Data type I O Function STRING 1st input input string INT 2nd input number of input string s characters that are copied from the left STRING output copied string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input string is longer than the length defined for the input variable in the field Type R90...

Страница 266: ...and the number of characters to be delivered directly into the function The string has to be put in inverted commas both in the POU header and in the function Body Starting from the left character_number 5 of input_string Ideas for life is copied to output_string Ideas LD ST When programming with structured text enter the following output_string LEFT IN input_string L character_number ...

Страница 267: ...able of Code Intensive Instructions in the online help up to 200 steps Data type I O Function STRING 1st input input string INT 2nd input number of input string s characters that are copied from the right STRING output copied string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input string is longer than the length defined for the input variable in the field Typ...

Страница 268: ... declared Instead you may enter the string Ideas for life and the number of characters to be delivered directly into the function The string has to be put in inverted commas both in the POU header and in the function Body Starting from the right character_number 4 of input_string Ideas for life is copied to output_string life LD ...

Страница 269: ... R9009 MX0 900 9 is set The number of steps may vary depending on the PLC and parameters used see also Table of Code Intensive Instructions in the online help up to 200 steps Data type I O Function STRING 1st input input string INT 2nd input number of input string s characters that are copied INT 3rd input position where copying begins STRING output copied string No IEC address Set If R9007 MX0 90...

Страница 270: ...d you may enter the string Ideas for life the number of characters to be delivered and the start position directly into the function The string has to be put in inverted commas both in the POU header and in the function Body Starting from start_position 7 character_number 8 of input_string Ideas for life is copied to output_string for life LD ST When programming with structured text enter the foll...

Страница 271: ...permanently R9008 MX0 900 8 for an instant input string is longer than the length defined for the input variable in the field Type R9009 MX0 900 9 for an instant output string is longer than the length defined for the output variable in the field Type In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help I...

Страница 272: ...String instructions 271 Part II IEC Instructions LD ST When programming with structured text enter the following output_string CONCAT input_string1 input_string2 input_string3 ...

Страница 273: ...put string s characters that are deleted INT 3rd input position where deletion begins STRING output resulting string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input string is longer than the length defined for the input variable in the field Type R9009 MX0 900 9 for an instant output string is longer than the length defined for the output variable in the fiel...

Страница 274: ...rted commas both in the POU header and in the function Body Starting from start_position 6 character_number 8 is deleted from input_string Ideas for life The resulting string Ideas is written into output_string LD ST When programming with structured text enter the following output_string DELETE input_string character_number start_position ...

Страница 275: ...Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input strings are longer than the length defined for the input variables in the field Type Description FIND returns the position at which the second input string first occurs in the first input string The result is written into the output variable If the second input string does not occur in the first input string the value ZERO is ...

Страница 276: ...String instructions 275 Part II IEC Instructions LD ST When programming with structured text enter the following output_value FIND input_string_1 input_string_2 ...

Страница 277: ...ps Data type I O Function STRING 1st input input string STRING 2nd input string to be inserted into input string INT 3rd input position at which string is inserted STRING output result string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input strings are longer than the length defined for the input variables in the field Type Description INSERT inserts the strin...

Страница 278: ...have to be put in inverted commas both in the POU header and at the contact pins input_string2 for is inserted into input_string1 Ideas life after character position 6 The result Ideas for life is returned at output_value In the LD example Monitoring icon was activated while in online mode hence you can see the results immediately LD ST When programming with structured text enter the following out...

Страница 279: ...racters begin to be replaced STRING output resulting string No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant input strings are longer than the length defined for the input variables in the field Type Description REPLACE replaces the characters in the string IN1 with P denoting the first position to be replaced and L denoting the number of characters to be replaced w...

Страница 280: ...String instructions 279 Part II IEC Instructions LD ...

Страница 281: ......

Страница 282: ...Chapter 10 Date and time instructions ...

Страница 283: ...D_TIME 1st input augend TIME 2nd input addend DATE_AND_TIME output sum Description ADD_DT_TIME adds the value of a variable of the data type TIME to the date and time stored in the variable of the data type DATE_AND_TIME The result is stored in a variable of the data type DATE_AND_TIME Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST P...

Страница 284: ... 1318 Data type I O Function TIME_OF_DAY 1st input augend TIME 2nd input addend TIME_OF_DAY output sum Description ADD_TOD_TIME adds a variable of the data type TIME to the time of day The result is stored in a variable of the data type TIME_OF_DAY Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variabl...

Страница 285: ...ay DATE output result BOOL output The Boolean output ERROR is set if the input values are invalid date or time values DATE_value CONCAT_DATE_INT YEAR YEAR_value MONTH MONTH_value DAY DAY_value ERROR ERROR Description CONCAT_DATE_INT concatenates the INTEGER values of year month and day The result is stored in the output variable of the data type DATE The Boolean output ERROR is set if the input va...

Страница 286: ...e I O Function DATE 1st input date TIME_OF_DAY 2nd input time of day DATE_AND_TIME output result Description CONCAT_DATE_TOD concatenates a value of the data type DATE with a value of the data type TIME_OF_DAY The result is stored in the output variable of the data type DATE_AND_TIME Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU...

Страница 287: ... input 4th input 5th input 6th input 7th input year month day hour minute second millisecond DATE_AND_TIME output result BOOL output The Boolean output ERROR is set if the input values are invalid date or time values Description CONCAT_DT_INT concatenates the INT values of year month day hour minute second and millisecond The result is stored in the output variable of the data type DATE_AND_TIME T...

Страница 288: ...Instructions DT_value CONCAT_DT_INT YEAR YEAR_value MONTH MONTH_value DAY DAY_value HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value ERROR ERROR LD ST When programming with structured text enter the following ...

Страница 289: ...tput result BOOL output The Boolean output ERROR is set if the input values are invalid date or time values TOD_value CONCAT_TOD_INT HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value ERROR ERROR Description CONCAT_TOD_INT concatenates the INTEGER values for hour minute second and millisecond The result is stored in the output variable of the data type TIME_OF_DA...

Страница 290: ...Function DATE input date ANY16 output 1 Monday 7 Sunday The value iDAY_OF_WEEK_value 2 corresponds to Tuesday Description DAY_OF_WEEK1 returns the day of the week for any date as an INT The number 1 corresponds to Monday 7 corresponds to Sunday Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables u...

Страница 291: ... Data type I O Function DATE_AND_TIME output date and time Description GET_RTC_DT reads the PLC s real time clock value for the clock calendar function If the PLC has no real time clock or if the real time clock is not functioning the result is an invalid date and time value Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header A...

Страница 292: ...t 2nd input 3rd input year month day BOOL output set to TRUE if the resulting date value is valid VALID IS_VALID_DATE_INT YEAR YEAR_value MONTH MONTH_value DAY DAY_value Description IS_VALID_DATE_INT checks whether the combination of the INT values for the year month and day is a valid DATE value The Boolean output flag is set if the date is valid Data types Example In this example the function ha...

Страница 293: ...1st input 2nd input 3rd input 4th input 5th input 6th input 7th input year month day hour minute second millisecond BOOL output set to TRUE if the resulting date and time value is valid Description IS_VALID_DT checks whether the combination of INT values for year month day hour minute second and millisecond is a valid date and time value The Boolean output flag is set if the date and time value is...

Страница 294: ... II IEC Instructions VALID IS_VALID_DT_INT YEAR YEAR_value MONTH MONTH_value DAY DAY_value HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value ST When programming with structured text enter the following ...

Страница 295: ...econd millisecond BOOL output set to TRUE if the resulting time of day value is valid VALID IS_VALID_TOD_INT HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value Description IS_VALID_TOD_INT checks whether the combination of INT values for hour minute second and millisecond is a valid time of day value The Boolean output flag is set if the time of day value is vali...

Страница 296: ... calendar function If the PLC has no real time clock or if the real time clock is not functioning the result is an invalid date and time value Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with str...

Страница 297: ...Availability of SPLIT_DATE_INT see page 1331 Data type I O Function DATE input date INT 1st output 2nd output 3rd output year month day SPLIT_DATE_INT IN DATE_value YEAR YEAR_value MONTH MONTH_value DAY DAY_value Description SPLIT_DATE_INT splits a value of the data type DATE into INT values for year month and day Data types Example In this example the function has been programmed in ladder diagra...

Страница 298: ...LC types Availability of SPLIT_DT_INT see page 1331 Data type I O Function DATE_AND_TIME input date and time INT 1st output 2nd output 3rd output 4th output 5th output 6th output 7th output year month day hour minute second millisecond Description SPLIT_DT_INT splits a value of the data type DATE_AND_TIME into INT values for year month day hour minute second and millisecond Data types Example In t...

Страница 299: ... IEC Instructions SPLIT_DT_INT IN DT_value YEAR YEAR_value MONTH MONTH_value DAY DAY_value HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value LD ST When programming with structured text enter the following ...

Страница 300: ...a type I O Function TIME_OF_DAY input time of day INT 1st output 2nd output 3rd output 4th output hour minute second millisecond SPLIT_TOD_INT IN TOD_value HOUR HOUR_value MINUTE MINUTE_value SECOND SECOND_value MILLISECOND MILLISECOND_value Description SPLIT_TOD_INT splits a value of the data type TIME_OF_DAY into INT values for hour minute second and millisecond Data types Example In this exampl...

Страница 301: ...l to the maximum TIME duration allowed Otherwise an overflow of the TIME result variable occurs and the CARRY flag is set Data type I O Function DATE 1st input minuend DATE 2nd input subtrahend TIME output result TIME_result SUB_DATE_DATE DATE_value1 DATE_value2 Description SUB_DATE_DATE subtracts a value of the data type DATE from another DATE value The result is stored in the output variable of ...

Страница 302: ...mum TIME duration allowed Otherwise an overflow of the TIME result variable occurs and the CARRY flag is set Data type I O Function DATE_AND_TIME 1st input minuend DATE_AND_TIME 2nd input subtrahend TIME output result Description SUB_DT_DT subtracts a value of the data type DATE_AND_TIME from another DATE_AND_TIME value The result is stored in the output variable of the data type TIME Data types E...

Страница 303: ...O Function DATE_AND_TIME 1st input minuend TIME 2nd input subtrahend DATE_AND_TIME output result Description SUB_DT_TIME subtracts a value of the data type TIME from a value of the data type DATE_AND_TIME The result is stored in the output variable of the data type TIME_OF_DAY Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header...

Страница 304: ...31 Data type I O Function TIME_OF_DAY 1st input minuend TIME 2nd input subtrahend TIME_OF_DAY output result Description SUB_TOD_TIME subtracts a TIME value from a value of the data type TIME_OF_DAY The result is stored in the output variable of the data type TIME_OF_DAY Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All in...

Страница 305: ... type I O Function TIME_OF_DAY 1st input minuend TIME_OF_DAY 2nd input subtrahend TIME output result Description SUB_TOD_TOD subtracts a value of the data type TIME_OF_DAY from another TIME_OF_DAY value The result is stored in the output variable of the data type TIME Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST POU header All inpu...

Страница 306: ...Chapter 11 Bistable instructions ...

Страница 307: ...ignal output is set if a rising edge is detected at SET is reset if a rising edge is detected at RESET if SET is not set The names in brackets are the valid parameter names of the ST editor Q is set if a rising edge is detected at both inputs Set and Reset Upon initialising Q always has the status zero reset Time chart PLC types Availability of SR see page 1331 Data type I O Function 1st input Set...

Страница 308: ...y declaring the FB you create a copy of the original FB This copy is saved under copy_name and a separate data area is reserved Body If set is set status TRUE signal_output will be set If only reset is set the signal_output will be reset status FALSE If both set and reset are set signal_output will be set LD ST When programming with structured text enter the following copy_name SET set RESET reset...

Страница 309: ... at RESET Q Q1 signal output is set if a rising edge is detected at SET and if RESET is not set is reset if a rising edge is detected at RESET The names in brackets are the valid parameter names of the ST editor Q is reset if a rising edge is detected at both inputs Time chart PLC types Availability of RS see page 1330 Data type I O Function 1st input Set 2nd input reset BOOL output set or reset d...

Страница 310: ...g the FB you create a copy of the original FB This copy is saved under copy_name and a separate data area is reserved Body If set is set status TRUE the signal_output will be set If only reset is set the signal_output will be reset status FALSE If both set and reset are set the signal_output will be reset to FALSE LD ST When programming with structured text enter the following copy_name SET set RE...

Страница 311: ......

Страница 312: ...Chapter 12 Edge detection instructions ...

Страница 313: ... and is then reset in the following cycle Data type I O Function input CLK detects rising edge for clock BOOL output Q set when rising edge detected Description The function block R_TRIG rising edge trigger allows you to recognize a rising edge at an input Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please re...

Страница 314: ...n reset in the following cycle Data type I O Function input CLK detects falling edge at input clock BOOL output Q is set if falling edge is detected at input Description The function block F_TRIG falling edge trigger allows you to recognize a falling edge at an input Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction lis...

Страница 315: ......

Страница 316: ...Chapter 13 Counter instructions ...

Страница 317: ... R reset CV is reset to zero for each rising edge at RESET PV set value if PV preset value is reached Q is set Q signal output is set if CV is greater than equal to PV CV current value contains the addition result CV current value The names in brackets are the valid parameter names of the ST editor PLC types Availability of CTU see page 1319 Time chart Data type I O Function input CU detects risin...

Страница 318: ... By declaring the FB you create a copy of the original FB This copy is saved under copy_name A separate data area is reserved for this copy Body If reset is set status TRUE current_value CV will be reset If a rising edge is detected at clock the value 1 will be added to current_value If a rising edge is detected at clock this procedure will be repeated until current_value is greater than equal to ...

Страница 319: ...ted from the current value CV for each rising edge detected at CD except when LOAD is set or CV has reached the value zero LOAD LD Set with LOAD the counter state is reset to PV PV preset value is the value subjected to subtraction during the first counting procedure Q signal output is set if CV zero CV current value contains the current subtraction result CV current value The names in brackets ar...

Страница 320: ... FB itself By declaring the FB you create a copy of the original FB This copy is saved under copy_name and a separate data area is reserved Body If set is set status TRUE the preset_value PV is loaded in the current_value CV The value 1 will be subtracted from the current_value each time a rising edge is detected at clock This procedure will be repeated until the current_value is greater than equa...

Страница 321: ...D is are set and if CU and CD are simultaneously set In the latter case counting will be upwards RESET R reset if RESET is set CV will be reset LOAD LD Set if LOAD is set PV is loaded to CV This however does not apply if RESET is set simultaneously In this case LOAD will be ignored PV preset value defines the preset value which is to be attained with the addition or subtraction PV preset value QU ...

Страница 322: ...current value Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables which are used for programming the function block CTUD are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the...

Страница 323: ...set status TRUE the set_value PV preset value will be loaded in the current_value CV If down_clock is set the value 1 is subtracted from set_value at each clock This procedure is repeated at each clock until the current_value is smaller than equal to zero Then signal_output is set The procedure will not be conducted if reset and or set is are set or if CU and CV are set at the same time In the lat...

Страница 324: ...Chapter 14 Timer instructions ...

Страница 325: ...16 bit value 0 327 27s 32 bit value 0 21 474 836 47s resolution 10ms each the switch off delay is defined here PT preset time Q signal output is reset if PT ET ET elapsed time represents the current value of the elapsed time Time chart t0 t1 PT t2 t5 PT t0 t1 t2 t3 t4 t5 IN Q ET PT t0 t1 t2 t3 t4 t5 1 2 1 Q is switched off with a delay corresponding to the time defined in PT Switching on is carrie...

Страница 326: ...line help POU header All input and output variables which are used for programming the function block TOF are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under copy_name A separate data area is reserved for this copy Body If start is reset this signal is transferred to signal_output with a de...

Страница 327: ...itch on delay 16 bit value 0 327 27s 32 bit value 0 21 474 836 47s resolution 10ms each the switch on delay is defined here PT preset time Q signal output is set if PT ET ET elapsed time indicates the current value of the elapsed time Time chart N I Q ET PT t0 t1 t2 t3 t t 0 0 PT t1 t2 t3 t0 t1 t2 t3 t 1 2 1 Q is set delayed with the time defined in PT Resetting is without any delay 2 If the input...

Страница 328: ...nline help POU header All input and output variables which are used for programming the function block TON are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under copy_name A separate data area is reserved for this copy Body If start is set status TRUE the input signal is transferred to signal_...

Страница 329: ...ed at IN within the pulse period does not cause a new timer see time chart section 2 Q signal output is set for the period of PT as soon as a rising edge is detected at IN ET elapsed time contains the elapsed period of the timer If PT ET Q will be reset FP2 FP2SH and FP10SH use a 32 bit value for PT Time chart t0 t1 PT t2 t3 t4 t4 PT t0 t1 PT t2 t2 PT t4 t4 PT t0 t1 t2 t3 t4 t5 t6 t7 IN Q ET PT 1 ...

Страница 330: ...e online help POU header All input and output variables which are used for programming the function block TP are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under copy_name A separate data area is reserved for this copy Body If start is set status TRUE the clock is emitted at signal_output un...

Страница 331: ...me POU header is used for all programming languages For an example using IL instruction list please refer to the online help 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 function Description ADD_TIME adds the times of the two input variables and writes the sum in the output variable Data typ...

Страница 332: ... milliseconds TIME output result BOOL output The Boolean output ERROR is set if the input values are invalid date or time values TIME_value CONCAT_TIME_INT DAYS DAYS_value HOURS HOURS_value MINUTES MINUTES_value SECONDS SECONDS_value MILLISECONDS MILLISECONDS_value ERROR ERROR Description The highest non zero time unit may be greater than its apparent limit e g T 25h is a valid time value whereas ...

Страница 333: ...ariable by the value of the second input variable and writes the result into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the inp...

Страница 334: ... input variable by the value of the second and writes the result into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header In the POU header all input and output variables are declared that are used for programming this function In this example the input v...

Страница 335: ...iable of the data type REAL The REAL value is rounded off to the nearest whole number The result is written into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in th...

Страница 336: ... the two input variables with each other and writes the result into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the input variab...

Страница 337: ...he values of the input variables and writes the result to the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header In the POU header all input and output variables are declared that are used for programming this function In this example the input variables tim...

Страница 338: ...a type TIME by the value of the second input variable of the data type REAL The REAL value is rounded off to the nearest whole number The result is written into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for pr...

Страница 339: ...nd output 3rd output 4th output 5th output days hours minutes seconds milliseconds SPLIT_TIME_INT IN TIME_value DAYS DAYS_value HOURS HOURS_value MINUTES MINUTES_value SECONDS SECONDS_value MILLISECONDS MILLISECONDS_value Description The highest non zero time unit may be greater than its apparent limit e g T 25h is a valid time value whereas T 1d25h is not Data types Example In this example the fu...

Страница 340: ...variable from the value of the first input variable and writes the result into the output variable Data types Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the i...

Страница 341: ......

Страница 342: ...Chapter 15 Arithmetic instructions ...

Страница 343: ...ss Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction ADD see page 61 Please refer also to Advantages of the IEC instructions in the online help When this instruction is used the area for the augend d is overwritten by the added result If you want to avoid the overwrite we recommend...

Страница 344: ...xceeds the range of 16 bit data overflow or underflow Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the func...

Страница 345: ...itate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction ADD see page 61 Please refer also to Advantages of the IEC instructions in the online help When this instruction is used the area for the augend d...

Страница 346: ...e result exceeds the range of 32 bit data overflow or underflow Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRU...

Страница 347: ...n appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction ADD see page 61 Please refer also to Advantages of the IEC instructions in the online help PLC types Availability of F22_ADD2 see page 1323 Variable Data type Function s1 augend...

Страница 348: ...flow Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F22_ADD2 value_in1...

Страница 349: ...ge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction ADD see page 61 Please refer al...

Страница 350: ...result exceeds the range of 32 bit data overflow or underflow Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the ...

Страница 351: ...ction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements When this instruction is used the area for the augend d is overwritten by the added result If you want to avoid the overwrite we recommend using the instruction F41_DBADD see page 351 PLC types Availability of F40_BA...

Страница 352: ...xceeds the range of 4 digit BCD data overflow Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the func...

Страница 353: ...cuted at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements When this instruction is used the area for the augend d is overwritten by the added result If...

Страница 354: ...ult exceeds the range of 8 digit BCD data overflow Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE...

Страница 355: ...the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F42_BADD2 see page 1325 Variable Data type Function s1 WORD augend 16 bit area for 4 digit BCD data or equivalent constant s2 WORD addend 16 bi...

Страница 356: ...lags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF start THEN F42_BADD2 summand_...

Страница 357: ...also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC typ...

Страница 358: ...e result exceeds the range of 8 digit BCD data overflow Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the functi...

Страница 359: ...ements PLC types Availability of F35_INC see page 1325 Variable Data type Function d ANY16 16 bit area to be increased by 1 For Relay T C Register Constant d WY WR WL SV EV DT LD FL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result exceeds the range of 16 bit data overflow Description Adds 1 to the 16 bit data specified by d ...

Страница 360: ...Arithmetic instructions 359 Part III FP Instructions LD ST IF DF start THEN F35_INC increment_value END_IF ...

Страница 361: ...in the programming area to open the list of recently used elements PLC types Availability of F36_DINC see page 1325 Variable Data type Function d ANY32 32 bit area to be increased by 1 For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result exceeds the range of 32 bi...

Страница 362: ...Arithmetic instructions 361 Part III FP Instructions LD ST IF DF start THEN F36_DINC increment_value END_IF ...

Страница 363: ... programming area to open the list of recently used elements PLC types Availability of F55_BINC see page 1325 Variable Data type Function d WORD 16 bit area for 4 digit BCD data to be increased by 1 For Relay T C Register Constant d WY WR WL SV EV DT LD FL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result exceeds the range of...

Страница 364: ...Arithmetic instructions 363 Part III FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST IF DF start THEN F55_BINC increment_value END_IF ...

Страница 365: ...uction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F56_DBINC see page 1325 Variable Data type Function d DWORD 32 bit area for 8 digit BCD data to be increased by 1 For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL No IEC ad...

Страница 366: ... POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F56_DBINC increment_value END_IF ...

Страница 367: ...tages of the IEC instructions in the online help 15 12 10 8 7 4 3 0 d 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 15 12 10 8 7 4 3 0 s 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 15 12 10 8 7 4 3 0 d 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 Example value 16 Bit Example value 27 Bit Result value 11 if trigger is ON Bit PLC types Availability of F25_SUB see page 1323 Variable Data type Function s subtrahend d ANY16 minuend and resu...

Страница 368: ...r underflow Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F25_SUB value_i...

Страница 369: ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 s 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 d 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 1 Example value 16778109 Bit 32 bit area Example value 524740 Bit Result value 16253369 if trigger is ON Bit PLC types Availability of F...

Страница 370: ...nderflow Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F26_DSUB value...

Страница 371: ...ntages of the IEC instructions in the online help 15 12 10 8 7 4 3 0 d 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 15 12 10 8 7 4 3 0 s 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 15 12 10 8 7 4 3 0 d 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 Example value 27 Bit Example value 16 Bit Result value 11 if trigger is ON Bit PLC types Availability of F27_SUB2 see page 1323 Variable Data type Function s1 minuend s2 subtrahend d ANY16 re...

Страница 372: ...rflow Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F27_SUB2 minuend subt...

Страница 373: ...elp 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 s1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 s2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 d 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 Example value 16809984 Bit Result value 16284672 if trigger is ON B...

Страница 374: ...ult exceeds the range of 32 bit data overflow or underflow Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the...

Страница 375: ...ructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F45_BSUB see page 1325 Variable Data type Function s WORD subtrahend 16 bit area for 4 digit BCD data or equivalent constant d WORD minuend and result ...

Страница 376: ...or flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F45_BSUB su...

Страница 377: ...SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F46_DBSUB see page 1325 Variable Data...

Страница 378: ...r flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F46_DBSUB su...

Страница 379: ...on from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F47_BSUB2 see page 1325 Variable Data type Function s1 WORD minuend 16 bit area for 4 digit BCD data or equivalent constant s2 WORD sub...

Страница 380: ... exceeds the range of 4 digit BCD data overflow Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is ca...

Страница 381: ...on for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F48_DBSUB...

Страница 382: ...result exceeds the range of 8 digit BCD data overflow Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the func...

Страница 383: ...ements PLC types Availability of F37_DEC see page 1325 Variable Data type Function d INT WORD 16 bit area to be decreased by 1 For Relay T C Register Constant d WY WR WL SV EV DT LD FL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result exceeds the range of 16 bit data underflow Description Subtracts 1 from the 16 bit data spec...

Страница 384: ...Arithmetic instructions 383 Part III FP Instructions LD ST IF DF start THEN F37_DEC decrement_value END_IF ...

Страница 385: ...enu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F38_DDEC see page 1325 Variable Data type Function d ANY32 32 bit area to be decreased by 1 For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result...

Страница 386: ...Arithmetic instructions 385 Part III FP Instructions Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F38_DDEC decrement_value END_IF ...

Страница 387: ...mming area to open the list of recently used elements PLC types Availability of F57_BDEC see page 1325 Variable Data type Function d WORD 16 bit area for BCD data to be decreased by 1 For Relay T C Register Constant d WY WR WL SV EV DT LD FL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 R9009 MX0 900 9 for an instant the result exceeds the range of 4 digit BCD da...

Страница 388: ...Arithmetic instructions 387 Part III FP Instructions Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F57_BDEC decrement_value END_IF ...

Страница 389: ...cilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F58_DBDEC see page 1325 Variable Data type Function d DWORD 32 bit area for BCD data to be decreased by 1 For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B M...

Страница 390: ...tions All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F58_DBDEC decrement_value END_IF ...

Страница 391: ...n appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction MUL see page 63 Please refer also to Advantages of the IEC instructions in the online help PLC types Availability of F30_MUL see page 1323 Variable Data type Function s1 multipl...

Страница 392: ...OU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F30_MUL multiplicand multiplicator output_value END_IF ...

Страница 393: ...iable Data type Function s1 multiplicand s2 ANY32 multiplier d ARRAY 0 1 of ANY32 result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Access to the result is possible with output_value 0 and output_value 1 Description Multiplies the 32 bit data or 32 bit equivalent c...

Страница 394: ...Arithmetic instructions 393 Part III FP Instructions ST IF start THEN F31_DMUL multiplicand multiplicator output_value END_IF ...

Страница 395: ...ction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F34_MULW see page 1324 Variable Data type Function s1 multiplicand s2 multiplier d ANY16 result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 ...

Страница 396: ...result calculated is 0 Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F34_...

Страница 397: ...ea to open the list of recently used elements PLC types Availability of F39_DMULD see page 1325 Variable Data type Function s1 multiplicand s2 multiplier d ANY32 result For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the result calculated exceeds t...

Страница 398: ...d Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F39_DMULD input_value_1 input_value_2...

Страница 399: ... under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F50_BMUL see page 1325 Variable Data type Function s1 WORD multiplicand 16 bit area for 4 digit BCD data or equivalent constant s2 WORD multiplier 16 bit area for 4 digit BCD data or equivalent constant d DWORD result 32 bit area for 8 digit BC...

Страница 400: ... For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F50_BMUL multiplicand multiplicator output_value END_IF ...

Страница 401: ... 4 0 0 1 6 0 0 0 0 0 0 2 4 Bit Example value 16 40002 BCD Bit 32 bit area Example value 16 60008 BCD Bit Bit Result value 16 2400440016 BCD if trigger is ON stored in the ARRAY 0 1 of DWORD This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you re...

Страница 402: ... DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the calculated result is 0 Data types Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the ...

Страница 403: ...SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the rel...

Страница 404: ...e minimum value 32768 16 8000 is divided by 1 16 FFFF Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function...

Страница 405: ... 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recom...

Страница 406: ... DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Data types Operands Example In this example the same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F33_DDIV dividend ...

Страница 407: ...0002 Trigger ON Bit Example value 16 0015 BCD Bit Example value 16 0037 BCD This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Pres...

Страница 408: ...WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R900B MX0 900 11 for an instant the result calculated is 0 Data types Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this functi...

Страница 409: ... 0 Remainder 16 00000010 BCD if trigger is ON stored in DT9015 to DT9016 DDT90015 to DDT90016 Bit Bit Result value 16 00000100 BCD if trigger is ON Example value 16 0000011 BCD Bit 32 bit area Bit Example value 16 00001110 BCD This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction...

Страница 410: ...X DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the result calculated is 0 Data types Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used fo...

Страница 411: ...ram Variable Data type Function s1 REAL Real number data for dividend s2 REAL Real number data for divisor d REAL 32 bit area for result destination For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant data other than real number data is specified in s1 and s2 the...

Страница 412: ...the variable Start is set to TRUE the real number entered for the variable RealNumber1 is divided by the real number entered for RealNumber2 and the result stored at the address assigned by the compiler to the variable Result The monitor value icon is activated LD ...

Страница 413: ...e a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Variable Data type Function s1 INT specifies BCC calculation method 0 addition 1 subtraction 2 exclusive OR operation s2 ANY16 starting 16 bit area to calculate BCC s3 INT specifies number of bytes for BC...

Страница 414: ...BIN Code The ASCII BIN code bits of the first two characters are compared with each other to yield an 8 character exclusive OR operation result Sign for comparison ASCII BIN code 00100101 0 00110000 Exclusive OR result 00010101 Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages P...

Страница 415: ...next character i e 1 Sign for comparison ASCII BIN code Exclusive OR result 00010101 1 00110001 Next exclusive OR 00100100 And so on until the final character is reached LD ST IF start THEN F70_BCC s1_Control BCC_Calc_Methode s2_Start Adr_Of_VarOffs Var ASCII_String Offs 2 s3_Number LEN ASCII_String d BCC END_IF ...

Страница 416: ...tion To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Instead of using this FP instruction we recommend using the related IEC instruction SQRT see page 68 Please refer also to Advantages of the IEC instructions in the online help PLC types Availability of F160_DSQR see p...

Страница 417: ...D and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F160_DSQR input_value output_value END_IF ...

Страница 418: ...vailability of F300_BSIN see page 1323 Variable Data type Function s WORD 16 bit area where angle data is stored d ARRAY 0 2 of WORD result stored in 3 words For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the input value for s is not a BCD value or is not between 0 an...

Страница 419: ...t stores the result in the variable output_value If the input_value is between 181 and 359 output_value has a minus sign The function WORD_TO_BOOL sets the variable input_181_to_359 to TRUE With an input_value of 90 or 270 the output_value is 1 which represents the value before the decimal point If this is the case then WORD_TO_BOOL sets the value of the variable input_90_or_270 to TRUE LD ST inpu...

Страница 420: ... used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F301_BCOS see page 1323 Variable Data type Function s WORD area where angle data is stored d ARRAY 0 2 of WORD result stored in 3 words For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R90...

Страница 421: ... header In the POU header all input and output variables are declared that are used for programming this function Body In the body the value 16 45 is assigned to the variable input_value When the variable start is set to TRUE the function is carried out The result at output d isoutput_value 0 0 output_value 1 0 output_value 2 7071 LD ST input_value 16 45 IF start THEN F301_BCOS input_value output_...

Страница 422: ...under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F302_BTAN see page 1324 Variable Data type Function s WORD area where angle data is stored d ARRAY 0 2 of WORD result stored in 3 words For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC addr...

Страница 423: ...used for programming this function Body When the variable start is set to TRUE the function is carried out The input_value was initialized with the value 16 89 89 in the POU header The result is written to the ARRAY output_value Here in the first element of the ARRAY the output_value 16 sign In the second element 16 57 represents the number before the decimal point and 16 2899 comes after the deci...

Страница 424: ...ity of F303_BASIN see page 1324 Variable Data type Function s ARRAY 0 2 of WORD area where angle data is stored d WORD result stored in 3 words For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the input value for s is not a BCD value or is not between 1 0000 and 1 0000 ...

Страница 425: ...ment has 0 as its whole number value and in the third element 16 4500 is written as the value after the decimal point When the variable start is set to TRUE the function is carried out The result for the output_value 16 333 333 LD ST input_value 0 1 input_value 1 0 input_value 2 16 4500 IF start THEN F303_BASIN input_value output_value END_IF ...

Страница 426: ...ility of F304_BACOS see page 1324 Variable Data type Function s ARRAY 0 2 of WORD area where angle data is stored in 3 words d WORD result For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the input value for s is not a BCD value or is not between 1 0000 and 1 0000 R900B...

Страница 427: ...TRUE the function is carried out The input_value 0 sign in the ARRAY s first element 0 represents the whole in the second element and the value after the decimal point is 8660 The function thus calculates the output_value 16 30 30 LD ST IF start THEN F304_BACOS input_value output_value END_IF ...

Страница 428: ... programming area to open the list of recently used elements PLC types Availability of F305_BATAN see page 1324 Variable Data type Function s ARRAY 0 2 of WORD area where angle data is stored in 3 words d WORD result For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the ...

Страница 429: ...or programming this function have been declared in the POU header Body When the variable Start is set to TRUE the Arctangent of the real number entered for the variable TangentofAngle is calculated and the result stored at the address assigned by the compiler to the variable Angle units are radians LD ...

Страница 430: ...ctions in the online help PLC types Availability of F87_ABS see page 1326 Variable Data type Function d ANY16 16 bit area for storing original data and its absolute value For Relay T C Register Constant d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the 16 bit data is the negative minimum value 32768 16 8000 R9009 MX0 900 9 for an instant...

Страница 431: ...Arithmetic instructions 430 Part III FP Instructions LD ST IF start THEN F87_ABS abs_value END_IF ...

Страница 432: ...data and its absolute value For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the 32 bit data is the negative minimum value 2147483648 16 80000000 R9009 MX0 900 9 for an instant the 32 bit data is the negative value in the range from 1 to 2147483647 16 FFFFFFFF to 16 80000001 Description Gets the absol...

Страница 433: ...Arithmetic instructions 432 Part III FP Instructions ST IF start THEN F88_DABS abs_value END_IF ...

Страница 434: ...sert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F287_BAND see page 1323 Variable Data type Function s1 the area where the lower limit is stored or the lower limit data...

Страница 435: ... programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The constant 3 lower limit of the deadband and 10 upper limit of the deadband are assigned to inputs s1 and s2 However...

Страница 436: ...struction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F288_DBAND see page 1323 Variable Data type Function s1 the area where the lower limit is stored or the lower limit data s2 the ...

Страница 437: ...programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The constant 10 lower limit of the deadband and 20 upper limit of the deadband are assigned to inputs s1 and s2 However...

Страница 438: ...ently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F348_FBAND see page 1324 Variable Data type Function s1_Min REAL the area where the lower limit is stored or the lower limit data s2_Max REAL the area where the upper limit is stored or the upper limit data s3_In REAL the area where the input value is st...

Страница 439: ... flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body The constants 3 0 and 10 0 are assigned to the inputs s1_Min lower limit of the deadband and s2_Max upper limit of the ...

Страница 440: ...Arithmetic instructions 439 Part III FP Instructions ST IF start THEN F348_FBAND s1_Min 3 0 s2_Max 10 0 s3_In input_value d output_value END_IF 3 0 lower limit of deadband 10 0 upper limit ...

Страница 441: ...uted at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F289_ZONE see page 1323 Variable Data type Function s1 area where ne...

Страница 442: ...function instead Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It adds the correspon...

Страница 443: ...only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F290_DZONE see page 1323 Variable Data type Function s1 are...

Страница 444: ...xample the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It adds the corresponding positive offset value 2 to the positive input valu...

Страница 445: ...ecuted at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F349_FZONE see page 1324 Variable Data type Function s1 REAL area ...

Страница 446: ...f the function instead Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body The constant 1 23 is assigned to input s1 negative offset and the constant 5 55 is...

Страница 447: ...Arithmetic instructions 446 Part III FP Instructions ST IF start THEN F349_FZONE s1_NegBias 1 23 s2_PosBias 5 55 s3_In input_value d output_value END_IF 1 23 neg offset 5 55 pos offset ...

Страница 448: ... EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F85_NEG see page 1326 Variable Data type Function d ANY16 16 bit area for storing original data an...

Страница 449: ...Arithmetic instructions 448 Part III FP Instructions LD ST IF DF start THEN F85_NEG negotiate_value END_IF ...

Страница 450: ...lso exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC type...

Страница 451: ...Arithmetic instructions 450 Part III FP Instructions Body When the variable start changes from FALSE to TRUE the function is carried out LD ST IF DF start THEN F86_DNEG negotiate_value END_IF ...

Страница 452: ... page 1323 Variable Data type Function s1 starting area of data table s2 ANY16 ending area of data table max INT specifies maximum value pos INT position where maximum value was found For Relay T C Register Const s1 s2 WX WY WR WL SV EV DT LD FL max pos WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the address of the variable at input s1 s...

Страница 453: ...Arithmetic instructions 452 Part III FP Instructions LD ST IF start THEN F270_MAX s1_Start data_field 0 s2_End data_field 4 Max maximum_value Pos position END_IF ...

Страница 454: ...t of recently used elements PLC types Availability of F271_DMAX see page 1323 Variable Data type Function s1 DINT DWORD starting area of data table s2 DINT DWORD ending area of data table max DINT specifies maximum value pos WORD position where maximum value was found For Relay T C Register Const s1 s2 DWX DWY DWF DWL DSV DEV DDT DLD DFL max DWY DWR DWL DSV DEV DDT DLD DFL pos WY WR WL SV EV DT LD...

Страница 455: ...art is set to TRUE the function is carried out It searches for the maximum value and its position in the data_field The result is here maximum_value 222222 and position 2 LD ST IF start THEN F271_DMAX s1_Start data_field 0 s2_End data_field 4 Max maximum_value Pos position END_IF ...

Страница 456: ...n then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F350_FMAX see page 1325 Variable Data type Function s1 REAL starting area of data table s2 REAL ending area of data table max REAL specifies maximum value pos INT position where maximum value was found For Relay T C Register Const...

Страница 457: ...have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It then searches the data_field for a maximum value and its position The result here is max_value 5 44 and position 3 LD ST IF start THEN F350_FMAX s1_Start data_field 0 s2_End data_field 4 Max max_value Pos position END_IF ...

Страница 458: ...gramming area to open the list of recently used elements PLC types Availability of F272_MIN see page 1323 Variable Data type Function s1 starting area of data table s2 ANY16 ending area of data table min INT specifies minimum value pos INT position where minimum value was found For Relay T C Register Const s1 s2 WX WY WR WL SV EV DT LD FL min pos WY WR WL SV EV DT LD FL No IEC address Set If R9007...

Страница 459: ... start is set to TRUE the function is carried out It searches for the minimum value and its position in the data_field The result is here minimum_value 3 and position 3 LD ST IF start THEN F272_MIN s1_Start data_field 0 s2_End data_field 4 Min minimum_value Pos position END_IF ...

Страница 460: ... the list of recently used elements PLC types Availability of F273_DMIN see page 1323 Variable Data type Function s1 starting area of data table s2 ANY32 ending area of data table min DINT specifies minimum value pos INT position where minimum value was found For Relay T C Register Const s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL min DWY DWR DWL DSV DEV DDT DLD DFL pos WY WR WL SV EV DT LD FL No IE...

Страница 461: ...art is set to TRUE the function is carried out It searches for the minimum value and its position in the data_field The result is here minimum_value 333333 and position 3 LD ST IF start THEN F273_DMIN s1_Start data_field 0 s2_End data_field 4 Min minimum_value Pos position END_IF ...

Страница 462: ...ctions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F351_FMIN see page 1325 Variable Data type Function s1 REAL starting area of data table s2 REAL ending area of data table min REAL specifies minimum valu...

Страница 463: ...POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It then searches the data_field for a minimum value and its position The result here is min_value 6 91 and position 2 LD ST IF start THEN F351_FMIN s1_Start data_field 0 s2_End data_field 4 Min min_value Pos positi...

Страница 464: ...MEAN see page 1323 Variable Data type Function s1_Start starting area of data table s2_End ANY16 ending area of data table Mean INT mean of all elements in data table area specified Sum DINT sum of all elements in data table area specified For Relay T C Register Const s1_Start s2_End WX WY WR WL SV EV DT LD FL Mean WY WR WL SV EV DT LD FL Sum DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R...

Страница 465: ...s of the data table sum 4 3 8 2 1 6 8 and writes the result in this case 8 to the variable sum Additionally the function calculates the arithmetic mean of all elements of the data table mean sum 6 4 3 8 2 1 6 6 1 333 and writes the roanded off number in this case 1 to the variable mean LD ST IF start THEN F275_MEAN s1_Start data_field 0 s2_End data_field 4 Sum sum Mean mean END_IF ...

Страница 466: ...open the list of recently used elements PLC types Availability of F276_DMEAN see page 1323 Variable Data type Function s1 starting area of data table s2 ANY32 ending area of data table mean DINT mean of all elements in data table area specified sum ARRAY 0 1 of DINT sum of all elements in data table area specified For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL mean sum D...

Страница 467: ... set to TRUE the function is carried out The function calculates the sum of all elements of ARRAY data_field sum 2 3 222222 333333 1 111105 and transfers the result to the variable sum In addition the function calculates the mean mean sum 5 111105 5 22221 and transfers the result to the variable mean LD ST IF start THEN F276_DMEAN s1_Start data_field 0 s2_End data_field 4 Sum sum Mean mean END_IF ...

Страница 468: ...lability of F352_FMEAN see page 1325 Variable Data type Function s1 REAL starting area of data table s2 REAL ending area of data table mean REAL mean of all elements in data table area specified sum REAL sum of all elements in data table area specified For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL mean sum DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 ...

Страница 469: ...tion have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It calculates the sum 2 0 3 45 6 91 5 44 1 3 5 28 and the mean Sum 5 5 28 5 1 056 of the elements of the data_field LD ST IF start THEN F352_FMEAN s1_Start data_field 0 s2_End data_field 4 Sum sum Mean mean END_IF ...

Страница 470: ...ent of an DUT type variable that contains the xy value pairs y INT Output value y EN BOOL Activation of the function when EN TRUE the function is executed during each PLC cycle ENO BOOL ENO is set to TRUE as soon the function is executed Helpful when cascading function blocks with EN functions For Relay T C Register Constant x WX WY WR WL SV EV DT LD FL dec or hex y WY WR WL SV EV DT LD FL No IEC ...

Страница 471: ...e number of reference points xy value pairs can be set anywhere between 2 100 In the graph eight reference points P1 P8 are used 2 Entry Variable of the data type ARRAY 0 z OF INT that contains the x values Here z represents the place marker for the number of reference points see entry 1 3 Entry Variable of the data type ARRAY 0 z OF INT that contains the y values Here z represents the place marke...

Страница 472: ...le e g Measuredvalues X_Values 1 for x Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help DUT In the DUT Pool the number of reference points and the xy value pairs are declared POU header Body When the variable start is set to TRUE the function is carried out For the input value at position x th...

Страница 473: ...F283_DSCAL see page 1323 Variable Data type Function x DINT Input value x xy_data DUT The first element of a DUT type variable that contains the xy value pairs y DINT Output value y EN BOOL Activation of the function when EN TRUE the function is executed during each PLC cycle ENO BOOL ENO is set to TRUE as soon the function is executed Helpful when cascading function blocks with EN functions For R...

Страница 474: ...ry Variable of the data type INT that contains the number of reference points The number of reference points xy value pairs can be anywhere between 2 100 In the graph eight reference points P1 P8 are used 2 Entry Variable of the data type ARRAY 0 z OF DINT that contains the x values Here z represents the place marker for the number of reference points see entry 1 3 Entry Variable of the data type ...

Страница 475: ...gramming languages For an example using IL instruction list please refer to the online help DUT In the DUT Pool the number of reference points and the xy value pairs are declared POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out For the input value at position x t...

Страница 476: ... WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the area specified using the index modifier exceeds the limit the output time range specified by s3_RiseTime is smaller than 1 or larger than 30000 In this example the input variables iInitialValue iTargetValue and iRiseTime are declared However you can write a constant directly at the input cont...

Страница 477: ...r Time ms Time chart for decreasing the output value Example values iInitialValue 6000 iTargetValue 3000 iRiseTime 1000 1000 ms 2750 1750 1000 0 3000 6000 iInitialValue iTargetValue RiseTime ON OFF Data is initialized when the system detects the trigger s rising edge Time ms bRun Trigger Body When the variable bRun is switched to TRUE the function is carried out and iOutputValue increases from 300...

Страница 478: ...Arithmetic instructions 477 Part III FP Instructions IF bRun THEN F284_RAMP iInitialValue iTargetValue iRiseTime iOutputValue END_IF ...

Страница 479: ..._data INT First element of the data unit type table used for scaling y REAL Output value Y For Relay T C Register Constant x WX WY WR WL SV EV DT LD FL real xy_data WX WY WR WL SV EV DT LD FL y WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the specified address using the index modifier exceeds a limit a non real number value is input into ...

Страница 480: ...facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F96_SRC see page 1326 Variable Data type Function s1 16 bit area or equivalent constant to store the value searched for s2 starting 16 bit area of the block s3 ANY16 ending 16 bit area of the block T...

Страница 481: ...iables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST IF start THEN F96_SRC s1 search_value s2_Start data_array 0 s3_End data_array 3 number_matches DT90037 position_1match DT90038 END_IF ...

Страница 482: ...ly used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F97_DSRC see page 1326 Variable Data type Function s1 32 bit area or equivalent constant to store the value searched for s2 starting 32 bit area of the block s3 ANY32 ending 32 bit area of the block The adresses of the variables at inputs s2 and s3 must be ...

Страница 483: ...e been declared in the POU header Body When the variable start is set to TRUE the function is carried out Instead of using an input variable in this example a constant 44 is assigned to input s1 The result is stored in special data registers DT90037 and DT90038 The two E_MOVE functions copy the results to the two variables number_matches and position_1match LD ST IF start THEN F97_DSRC s1 44 s2_St...

Страница 484: ...f words stored increases by 1 If the data storage area becomes full i e the number of words stored is equal to n 1 further data writing is inhibited Reading data When data is read data is transferred starting from the first data item stored The reading pointer indicates the next area from which data is to be read The number of words stored decreases by 1 An error occurs if an attempt is made to re...

Страница 485: ...ng pointer 0 to 255 16 00 to 16FF When the FIFT instruction is executed the following are stored as default values d1 n the value specified by the FIFT instruction d1 1 0 and d1 2 16 0000 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you requ...

Страница 486: ...nstant n 0 n 256 The area specified by n exceeds the limit Operands Error flags Example This example illustrates the FIFO buffer by incorporating the functions F115_FIFT see page 483 F116_FIFR see page 487 and F117_FIFW see page 491 The function has been programmed in ladder diagram LD and structured text ST DUT POU header All input and output variables used for programming this function have been...

Страница 487: ...een enabled twice and FIFO_Read once When FIFO_Write was activated the first time the value 1 was written into FIFO Data 0 When FIFO_Read was enabled Read_Data then read this value When FIFO_Write was enabled the second time the Writing pointer was incremented by one and the value 2 written into FIFO Data 1 see Entry Data Monitor 1 LD ...

Страница 488: ...er with values Write_Data Write_Data 1 F117_FIFW s Write_Data d1_Start FIFO Size UNTIL FIFO Number FIFO Size END_REPEAT END_IF IF DF FIFO_Write THEN Write value of Write_Data to FIFO buffer at rising edge of FIFO_Write F117_FIFW s Write_Data d1_Start FIFO Size END_IF IF DF FIFO_Read THEN Read value from FIFO buffer at rising edge of FIFO_Read F116_FIFR d1_Start FIFO Size d2 Read_Data END_IF ...

Страница 489: ...te is a decimal value When the reading is executed 1 is subtracted from the number of stored data items and the reading pointer is incremented by 1 or reset to zero if the reading pointer pointed to the final element This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the ...

Страница 490: ...or an instant the size n of the FIFO specified by d1 is n 0 or when n 256 the number of stored data items of the FIFO 0 the number of stored data items of the FIFO FIFO size n the final address of the FIFO based on the FIFO size n exceeds the area the FIFO reading pointer FIFO size n the FIFO reading pointer is 256 16 100 or higher after the data has been read Error flags Example This example illu...

Страница 491: ...een enabled twice and FIFO_Read once When FIFO_Write was activated the first time the value 1 was written into FIFO Data 0 When FIFO_Read was enabled Read_Data then read this value When FIFO_Write was enabled the second time the Writing pointer was incremented by one and the value 2 written into FIFO Data 1 see Entry Data Monitor 1 LD ...

Страница 492: ...er with values Write_Data Write_Data 1 F117_FIFW s Write_Data d1_Start FIFO Size UNTIL FIFO Number FIFO Size END_REPEAT END_IF IF DF FIFO_Write THEN Write value of Write_Data to FIFO buffer at rising edge of FIFO_Write F117_FIFW s Write_Data d1_Start FIFO Size END_IF IF DF FIFO_Read THEN Read value from FIFO buffer at rising edge of FIFO_Read F116_FIFR d1_Start FIFO Size d2 Read_Data END_IF ...

Страница 493: ...value of the writing pointer the value of which only the lower byte is a decimal value When the writing is executed 1 is added to the number of stored data items and the writing pointer is incremented by 1 or reset to zero if the writing pointer pointed to the final element This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising ed...

Страница 494: ...r after the data has been written An error occurs if this is executed when the FIFO buffer is full the number of stored data items the size n of the FIFO defined by the FIFT instruction Writing is inhibited If this is executed when the writing pointer is indicating the final address in the FIFO buffer the n value defined by the FIFT instruction the writing pointer will be set to 0 Operands Error f...

Страница 495: ...een enabled twice and FIFO_Read once When FIFO_Write was activated the first time the value 1 was written into FIFO Data 0 When FIFO_Read was enabled Read_Data then read this value When FIFO_Write was enabled the second time the Writing pointer was incremented by one and the value 2 written into FIFO Data 1 see Entry Data Monitor 1 LD ...

Страница 496: ...er with values Write_Data Write_Data 1 F117_FIFW s Write_Data d1_Start FIFO Size UNTIL FIFO Number FIFO Size END_REPEAT END_IF IF DF FIFO_Write THEN Write value of Write_Data to FIFO buffer at rising edge of FIFO_Write F117_FIFW s Write_Data d1_Start FIFO Size END_IF IF DF FIFO_Read THEN Read value from FIFO buffer at rising edge of FIFO_Read F116_FIFR d1_Start FIFO Size d2 Read_Data END_IF ...

Страница 497: ...o facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F98_CMPR see page 1326 Variable Data type Function d1 starting lowest address of data to be compressed d2 final highest address of data to be compressed data at d2 is shifted out d3 ANY16 receives ...

Страница 498: ...ifted in the direction of the first address so normally the oldest data at that point is stored in the last address of the buffer Example 1 In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header...

Страница 499: ... In Step 2 the F98 function is activated and the value defined in the variable at d3 i e 11 is shifted out LD In Step 1 the F99 function is activated shifting in the value given in the variable ShiftinData at s i e 31 and compressing the rest of the data ...

Страница 500: ...he Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F99_CMPW see page 1326 For an example on how to construct a FIFO buffer using F P99 and F P98 see Example 2 from F P98 Variable Data type Functi...

Страница 501: ...e POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body After the variable Start is set to TRUE the value of the variable ShiftinData i e 32 at the contact s is shifted into the specified area of the data table an...

Страница 502: ...P2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F277_SORT see pag...

Страница 503: ...es used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The constant 0 is specified at input s3 which means the sorting is carried out in an ascending order However you can declare a variable in the POU header and write it in the function in the body at input s3 LD ST IF start THEN F277_SORT s1_Start data_fi...

Страница 504: ...ed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F278_DSORT see page 1323 Although this is a 32 bit instruction the num...

Страница 505: ... languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out Since the variable sort_order is set to 1 the specified data field in sorted in descending order LD ST IF start THEN F278_DSORT s1...

Страница 506: ...C types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F353_FSORT see page 1325 Variable Data typ...

Страница 507: ...ing languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body The variable sort_order is specified as the value 1 When the variable start is set to TRUE the function is carried out It sorts the elements of the ARRAY data_field in descending order LD ST sor...

Страница 508: ...Chapter 16 Bistable instructions ...

Страница 509: ...ata type Function Set Trigger BOOL sets Address output i e turns in ON Reset Trigger BOOL resets Address output i e turns it OFF Address BOOL specifed relay whose status set or reset is kept For Relay T C Register Constant Set Trigger Reset Trigger X Y R L T C o Y R L Description KEEP serves as a relay with set and reset points Data types Operands Example In this example the same POU header is use...

Страница 510: ... various relays with the SET and RST instructions does not result in double output It is not possible to specify a pulse relay P as the output destination for a SET or RST instruction For Relay T C Register Constant SET RST Y R L E Description SET When the execution conditions have been satisfied the output is turned on and the on status is retained RST When the execution conditions have been sati...

Страница 511: ...ons FBD LD In ladder diagram specify a rising edge in the contact and SET or RESET in the coil ST When programming with structured text enter the following TRUE and FALSE are assigned to Y0 IF DF X0 THEN Y0 TRUE END_IF IF DF X1 THEN Y0 FALSE END_IF ...

Страница 512: ...Chapter 17 Bitwise Boolean instructions ...

Страница 513: ... 0 to 16 F 4 7 FP2 2SH and 10SH number of bits to be transferred 16 0 to 16 F FP3 invalid 8 11 destination bit No 16 0 to 16 F 12 15 invalid For example reading from the right n 16 C01 would move from bit position one one bit to bit position 12 16 C PLC types Availability of F5_BTM see page 1325 Variable Data type Function s source 16 bit area n specifies source and destination bit positions d ANY...

Страница 514: ...os source bit pos bit pos target result Bit at position 15 is exchanged destination value in this example 16 7FFF Operands Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body Whe...

Страница 515: ...exadec digit hexadec digit hexadec digit hexadec digit n specifies the 3 source hexadecimal digit position the 2 number of digits and the 1 destination hexadecimal digit position to be copied using hexadecimal data as follows n 16 3 2 1 Source Starting hexadecimal digit position 0 Hexadecimal digit 0 1 Hexadecimal digit 1 2 Hexadecimal digit 2 3 Hexadecimal digit 3 Number of hexadecimal digits to ...

Страница 516: ... 3 2 1 0 s d 3 2 1 0 digit digit Specify n 16 212 when multiple hexadecimal digits hexadecimal digits 2 and 3 of the source are copied to multiple hexadecimal digits hexadecimal digits 2 and 3 of the destination 3 2 1 0 s d 3 2 1 0 digit digit Specify n 16 210 when multiple hexadecimal digits hexadecimal digits 0 and 1 of the source are copied to multiple hexadecimal digits hexadecimal digits 2 an...

Страница 517: ... bit area destination For Relay T C Register Constant s n WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Data types Operands Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the ...

Страница 518: ...Bitwise Boolean instructions 517 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F6_DGT s source n specify_n d output END_IF ...

Страница 519: ...area or 16 bit equivalent constant to be compared d ANY16 16 bit area for storing AND operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Description Executes AND operation of each bit in 16 bit equivalent constant or 16 bit data specified by s1 and s2 if the trigger EN is ...

Страница 520: ...ons 519 Part III FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F65_WAN value_1 value_2 output_value END_IF ...

Страница 521: ...bit area or 16 bit equivalent constant to be compared d ANY16 16 bit area for storing OR operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Description Executes OR operation of each bit in 16 bit equivalent constant or 16 bit data specified by s1 and s2 if the trigger EN i...

Страница 522: ...ons 521 Part III FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F66_WOR value_1 value_2 output_value END_IF ...

Страница 523: ...quivalent constant to be compared d ANY16 16 bit area for storing XOR operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Description Executes exclusive OR operation of each bit in 16 bit equivalent constant or 16 bit data specified by s1 and s2 if the trigger EN is in the ...

Страница 524: ...ons 523 Part III FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F67_XOR value_1 value_2 output_value END_IF ...

Страница 525: ...st of recently used elements PLC types Availability of F68_XNR see page 1326 Variable Data type Function s1 s2 16 bit area or 16 bit equivalent constant to be compared d ANY16 16 bit area for storing NOR operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Description Execut...

Страница 526: ...e same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F68_XNR value_1 value_2 output_value END_IF ...

Страница 527: ...sing edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F69_WUNI see page 1326 Variable Data type Function s1 s2 16 bit area or 16 bit equ...

Страница 528: ... instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header In this example the input variables input_value_1 input_value _2 and selection are declared However you can write constants directly at the input contact of the function instead Body When the variable start is set to TRUE the function i...

Страница 529: ...ant or 32 bit area d ANY32 32 bit area for storing AND operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the result calculated output d is 0 In this example the input variables input_value_1 and input_...

Страница 530: ... can write constants directly at the input contact of the function instead Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF START THEN F215_DAND dint1 dint2 dint3 END_IF ...

Страница 531: ...nt or 32 bit area d ANY32 32 bit area for storing OR operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the result calculated output d is 0 In this example the input variables input_value_1 and input_va...

Страница 532: ...constants directly at the input contact of the function instead Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F216_DOR input_value_1 input_value_2 output_value END_IF ...

Страница 533: ...ars under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F217_DXOR see page 1323 Variable Data type Function s1 32 bit equivalent constant or 32 bit area s2 32 bit equivalent constant or 32 bit area d ANY32 32 bit area for storing XOR operation result The variables s1 s2 and d have to be of the sa...

Страница 534: ...the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F217_...

Страница 535: ...o open the list of recently used elements PLC types Availability of F218_DXNR see page 1323 Variable Data type Function s1 32 bit equivalent constant or 32 bit area s2 32 bit equivalent constant or 32 bit area d ANY32 32 bit area for storing XNR operation result The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec ...

Страница 536: ...es used for programming this function have been declared in the POU header Body When the variable output is set to TRUE the function F218_DXNR is carried out LD ST When programming with structured text enter the following IF start THEN F218_DXNR input_value_1 2 11110001010100111 output_value END_IF ...

Страница 537: ...ction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements P...

Страница 538: ...constants directly at the input contact of the function instead Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE th...

Страница 539: ...ies bit position to be set For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Description Turns ON the bit specified by the bit position at n of the 16 bit data specified by d 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 Data types Operands Example In this example the same POU header is...

Страница 540: ...s bit position to be reset For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Description Turns OFF the bit specified by the bit position at n of the 16 bit data specified by d 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 Data types Operands Example In this example the function has been...

Страница 541: ...n to be inverted For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Description Inverts 1 ON 0 OFF or 0 OFF 1 ON the bit at bit position n in the 16 bit data area specified by d 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 Data types Operands Example In this example the same POU header ...

Страница 542: ...the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F133_BTT see page 1321 Variable Data type Function d ANY16 16 bit area n INT specifies bit position to be tested For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Descr...

Страница 543: ...tructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F133_BTT n 0 d value IF R900B THEN bit0_is_TRUE FALSE ELSE bit0_is_TRUE TRUE END_IF END_IF ...

Страница 544: ... Variable Data type Function s ANY16 source d INT destination area for storing the number of bits in the ON 1 state For Relay T C Register Constant s WY WR WL SV EV DT LD FL d WX WY WR WL SV EV DT LD FL dec or hex Description Counts the number of bits in the ON state 1 in the 16 bit data specified by s if the trigger EN is in the ON state Data types Operands Example In this example the function ha...

Страница 545: ...Variable Data type Function s ANY32 source d INT destination area for storing the number of bits in the ON 1 state For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d WY WR WL SV EV DT LD FL Description Counts the number of bits in the ON state 1 in the 32 bit data specified by s if the trigger EN is in the ON state Data types Operands Example In this example the sam...

Страница 546: ...the list of recently used elements PLC types Availability of F84_INV see page 1326 Variable Data type Function d ANY16 16 bit area to be inverted For Relay T C Register Const d WY WR WL SV EV DT LD FL Description Inverts each bit 0 or 1 of the 16 bit data specified by d if the trigger EN is in the ON state The inverted result is stored in the 16 bit area specified by d This instruction is useful f...

Страница 547: ...Bitwise Boolean instructions 546 Part III FP Instructions ST When programming with structured text enter the following IF DF start THEN F84_INV invert_value END_IF ...

Страница 548: ...elect Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F93_UNIT see page 1326 Variable Data type Function s WORD starting 16 bit area to be extracted source n INT spe...

Страница 549: ...list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The binary values in the illustration on the main help page serve as the array values in data_input In this example variables are declared in the POU header However you may assi...

Страница 550: ...nly executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F94_DIST see page 1326 Variable Data type Function s WORD 16...

Страница 551: ...r an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The binary values in the illustration on main help page serve as the values calculated In this example variables are declared in the POU header...

Страница 552: ... place and the corresponding bit at s1_InputData passes unchanged to d_OutputData In the following figure the bits in d_OutputData and their values will be the same as s1_InputData after the filter time has elapsed or for example if no masking takes place e g s2_InputMask is assigned the value 0 1 0 0 1 0 0 1 0 1 3 6 9 12 1 3 6 9 12 0 0 s1_InputData d_OutputData s2_InputMask s3_FilterTime Bit 0 Bi...

Страница 553: ...struction does not operate while the trigger is OFF Data is initialized when the system detects the trigger s rising edge Data is initialized when the system detects the trigger s rising edge Bit 1 to 15 of input data Bit 1 to 15 of filter result bStart Trigger ON PLC types Availability of F182_FILTER see page 1322 Variable Data type Function s1_InputData Input data whose bits will be filtered acc...

Страница 554: ...U header In this example the input variables wInputData wInputMask and iFilterTime are declared However for wInputMask and iFilterTime you can write a constant directly at the input contact of the function instead Additionally the variable bStart is declared to start the filter function and the variable wOutputData is declared for storing the result Body The filtered bits will only be written to w...

Страница 555: ......

Страница 556: ...Chapter 18 Bit shift instructions ...

Страница 557: ...ns Address Ranges menu Variable Data type Function DataInput BOOL when ON shift in data 1 when OFF shift in data 0 ShiftLeftTrigger BOOL shifts one bit to the left when ON Reset BOOL resets data area to 0 when ON d_WR ANY16 specified data area where data shift takes place For Relay T C DataInput ShiftLeftTrigger Reset X Y R L T C d_WR WR Description Shifts 1 bit of the specified data area d_WR to ...

Страница 558: ...Bit shift instructions 557 Part III FP Instructions Body ST When programming with structured text enter the following Output LSR DataInput ShiftTrigger ResetTrigger ...

Страница 559: ...sed in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F100_SHR see page 1320 Variable Data type Function d ANY16 16 bit area to be shifted to the right n INT number of bits to be shifted For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Description Shifts n bits of 1...

Страница 560: ...Bit shift instructions 559 Part III FP Instructions LD ST When programming with structured text enter the following IF DF start THEN F100_SHR n 4 d data END_IF ...

Страница 561: ...e pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F101_SHL see page 1320 Variable Data type Function d ANY16 16 bit area to be shifted to the left n INT number of bits to be shifted For Relay T C Register Constant d WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex Description Shifts n bits of 16 bit data...

Страница 562: ...Bit shift instructions 561 Part III FP Instructions LD ST When programming with structured text enter the following IF DF start THEN F101_SHL n 4 d data END_IF ...

Страница 563: ...Constant n WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9009 MX0 900 9 for an instant the bit at position n 1 has the value 1 Description The function shifts the value at output d to the right The number of bits at output d to be shifted to the right is specified by the value assigned at input n This shift can lie between 0 and 255 only the lower v...

Страница 564: ...the function is carried out It shifts out 4 bits corresponds to one position in a hexadecimal representation to the right The 4 bits in data resulting from the shift are filled with zeros At input n the constant 4 is assigned directly to the function You may however declare an input variable in the POU header instead LD ST When programming with structured text enter the following IF DF start THEN ...

Страница 565: ... range 16 0 to 16 FF d ANY32 32 bit area to be shifted to the left For Relay T C Register Constant n WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9009 MX0 900 9 for an instant the bit at position 31 n has the value 1 Description The function rotates the value at output d to the left The number of bits at output d to be shifted to the left is specif...

Страница 566: ...d in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out It shifts out 4 bits corresponds to one position in a hexadecimal representation to the left The 4 bits in data resulting from the shift are filled with zeros At input n the constant 4 is assigned directly to the function You may however declare an input variable in the POU header instead LD ST ...

Страница 567: ...ruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements...

Страница 568: ...ions 567 Part III FP Instructions Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F105_BSR data END_IF ...

Страница 569: ...when the hexadecimal or BCD data is handled This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the progra...

Страница 570: ...put variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F106_BSL data END_IF ...

Страница 571: ...it area n INT number of bits to be shifted The addresses of the variables at inputs d1 and d2 have to have the same address type For Relay T C Register Constant d1 d2 WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the address of the variables at the outputs d1 d2 or the value at input is n 16 Descript...

Страница 572: ...o the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out It shifts out 4 bits corresponds to one position in a hexadecimal representation to the right The 4 bits in data_field 2 resulting from the shift are filled with zeros LD ST When progr...

Страница 573: ...16 bit area n INT number of bits to be shifted The addresses of the variables at inputs d1 and d2 have to have the same address type For Relay T C Register Constant d1 d2 WY WR WL SV EV DT LD FL n WX WY WR WL SV EV DT LD FL dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the address of the variables at the outputs d1 d2 or the value at input is n 16 Desc...

Страница 574: ...ody When the variable start changes from FALSE to TRUE the function is carried out It shifts out 4 bits corresponds to one position in a hexadecimal representation to the left The 4 bits in data_field 0 resulting from the shift are filled with zeros At input n the constant 4 is assigned directly to the function You may however declare an input variable in the POU header instead LD ST When programm...

Страница 575: ...u require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F110_WSHR see page 1320 Variable Data type Function d1 starting 16 bit area d2 ANY16 ending 16 bit area The variables d1 and d2 have to be of the same data type For Relay...

Страница 576: ...ed for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F110_WSHR d1_Start source_array 1 d2_End source_array 3 END_IF ...

Страница 577: ...quire a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F111_WSHL see page 1320 Variable Data type Function d1 starting 16 bit area d2 ANY16 ending 16 bit area The variables d1 and d2 have to be of the same data type For Relay T C...

Страница 578: ...r programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F111_WSHL d1_Start source_array 1 d2_End source_array 3 END_IF ...

Страница 579: ...d out d1 and d2 should be the same type of operand d1 d2 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v with...

Страница 580: ...ured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F112_WBSR d1_Start source_array 1 d2_End source_ar...

Страница 581: ...s 0 d1 and d2 should be the same type of operand d1 d2 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within...

Страница 582: ...an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F112_WBSR d1_Start source_array 1 d2_End source_arra...

Страница 583: ... FALSE shifting out to the right Specifies the new shift in data New shift in data TRUE when the data input is in the TRUE state DataInput New shift in data FALSE when the data input is in the FALSE state ShiftTrigger Shifts 1 bit to the left or right when the rising edge of the trigger is detected FALSE TRUE Reset Turns all the bits of the data range specified by d1_Start and d2_End to 0 if this ...

Страница 584: ...ff 0 is shifted into bit position 0 d1_End LeftDirection OFF When DataInput turns off 0 is shifted into bit position 15 When DataInput turns on 1 is shifted into bit position 15 Shifted out bit is transferred to R9009 carry flag Bit position LeftDirection ON Left shift operation Right shift operation Bit position Data Bit position Data Data Bit position Data PLC types Availability of F119_LRSR see...

Страница 585: ...L Operands Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable enable_leftShift is set to TRUE the function shifts left else it shifts right ...

Страница 586: ...I FP Instructions LD ST When programming with structured text enter the following carry_out_value F119_LRSR LeftDirection enable_leftShift DataInput input ShiftTrigger shift_trigger Reset reset d1_Start data_array 0 d1_End data_array 2 ...

Страница 587: ...cuted at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F120_ROR see page 1320 Variable Data type Function d ANY16 16 bit a...

Страница 588: ...587 Part III FP Instructions Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F120_ROR n 4 d rot_value END_IF ...

Страница 589: ...he 16 bit data specified by d This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to ...

Страница 590: ...e POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F121_ROL n 4 d rot_value END_IF ...

Страница 591: ...ted into the higher bit positions of the 16 bit data specified by d This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl S...

Страница 592: ...instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F122_RCR n 4 d rot_value END_IF ...

Страница 593: ...so exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types...

Страница 594: ...put variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F123_RCL n 4 d rot_value END_IF ...

Страница 595: ...for an instant the bit at position n 1 of d has the value 1 Description The function rotates the value at output d to the right The number of bits at output d to be rotated to the right is specified by the value assigned at input n This shift can lie between 0 and 255 only the lower value byte of n is effective Right rotate means that the bits shifted out of bit position 0 LSB are shifted via bit ...

Страница 596: ...out It rotates 4 bits corresponds to one position in a hexadecimal representation to the right At input n the constant 4 is assigned directly to the function You may however declare an input variable in the POU header instead LD ST When programming with structured text enter the following IF DF start THEN F125_DROR n 4 d data END_IF ...

Страница 597: ...sed in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F126_DROL see page 1321 Variable Data type Function n INT number of bits to be rotated range 0 to 255 d ANY32 32 bit area For Relay T C Register Constant n WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9009 MX0 9...

Страница 598: ...start changes from FALSE to TRUE the function is carried out It rotates 4 bits corresponds to one position in a hexadecimal representation to the left At input n the constant 4 is assigned directly to the function You may however declare an input variable in the POU header instead LD ST When programming with structured text enter the following IF DF start THEN F126_DROL n 4 d data END_IF ...

Страница 599: ...rt P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F127_DRCR see page 1321 Variable Data type Function d ANY32 32 bit data area n INT number of bits to be rotated range 0 t...

Страница 600: ...red in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out In this example the constant 4 is assigned to the function at input n You may however declare a variable in the POU header instead LD ST When programming with structured text enter the following IF DF start THEN F127_DRCR n 4 d data END_IF ...

Страница 601: ...nsert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F128_DRCL see page 1321 Variable Data type Function d ANY32 32 bit area n INT number of bits to be rotated range 0 to ...

Страница 602: ...red in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out In this example the constant 4 is assigned to the function at input n You may however declare a variable in the POU header instead LD ST When programming with structured text enter the following IF DF start THEN F128_DRCL n 4 d data END_IF ...

Страница 603: ......

Страница 604: ...Chapter 19 Comparison instructions ...

Страница 605: ...ire a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F60_CMP see page 1325 Variable Data type Function s1 s2 ANY16 16 bit area or 16 bit equivalent constant to be compared The variables s1 and s2 have to be of the same data type ...

Страница 606: ...riable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following equal FALSE greater_or_equal FALSE IF start THEN F60_CMP value 2 IF R900B THEN equal TRUE END_IF IF NOT R9009 THEN greater_or_equal TRUE END_IF END_IF ...

Страница 607: ...To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F61_DCMP see page 1325 Variable Data type Function s1 s2 ANY32 32 bit area or 32 bit equivalent constant to be compared The variables s1 and s2 have to be of the same data type For Relay T C Regis...

Страница 608: ...riable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following equal FALSE greater_or_equal FALSE IF start THEN F61_DCMP value 2 IF R900B THEN equal TRUE END_IF IF NOT R9009 THEN greater_or_equal TRUE END_IF END_IF ...

Страница 609: ...er limit 16 bit area or 16 bit equivalent constant The variables s1 s2 and s3 have to be of the same data type For Relay T C Register Constant s1 s2 s3 WX WY WR WL SV EV DT LD FL dec or hex Description Compares the 16 bit equivalent constant or 16 bit data specified by s1_In with the data band specified by s2_Min and s3_Max if the trigger EN is in the ON state This instruction checks that s1_In is...

Страница 610: ... FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F62_WIN s1_In test_value s2_Min lower_limit s3_Max higher_limit END_IF ...

Страница 611: ... 32 bit equivalent constant s3_Max ANY32 upper limit 32 bit area or 32 bit equivalent constant The variables s1 s2 and s3 have to be of the same data type For Relay T C Register Constant s1_In s2_Min s3_Max DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex Description Compares the 32 bit equivalent constant or 32 bit data specified by s1_In with the data band specified by s2_Min and s3_Max if the tri...

Страница 612: ...ed for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST inside_the_range FALSE IF start THEN F63_DWIN s1_In test_value s2_Min lower_limit s3_Max higher_limit IF R900B THEN inside_the_range TRUE END_IF END_IF ...

Страница 613: ...he instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F64_BCMP see page 1326 The flag R900B used for the compare instruction is renewed each time a compare instruction is executed Therefore the program that uses R900B should be just after F64_BCMP Variable Data type Func...

Страница 614: ...please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F64_BCMP s1_Control ControlCode s2_Start DataBlock1 0 s3_Start DataBlock2 0 END_IF ...

Страница 615: ...e 1324 Variable Data type Function s1_In REAL number data to be compared to s2_Min and s3_Max s2_Min lower limit s3_Max REAL upper limit For Relay T C Register Constant s1 s2 s3 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the values at inputs s1_In s2_Min and s3_Max are not REAL numbers if the value at s2_Min s3_Ma...

Страница 616: ...ction is carried out The values of special internal relays R900A flag R900B flag and R900C flag are transferred to the variables larger_area middle_area and smaller_area Since the input_value 3 111 is within the range of the limits set 10 0 to 10 0 the relay and hence the variable middle_area are set to TRUE LD ST When programming with structured text enter the following input_value 3 111 IF start...

Страница 617: ...ay T C Register Constant s WX WY WR WL SV EV DT LD FL d WY WR WL SV EV DT LD FL No IEC address Set If R9009 MX0 900 9 to TRUE the input value at s has changed in comparison to the former value Description The function detects changes in a value at input s by comparing it with its former value that is stored at output d If the new input value at s does not coincide with the old value the function a...

Страница 618: ...arison instructions 617 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F373_DTR present_value old_value IF R9009 THEN changed_value TRUE END_IF END_IF ...

Страница 619: ...T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9009 MX0 900 9 to TRUE the input value at s has changed in comparison to the former value Description The function detects changes in a value at input s by comparing it with its former value that is stored at output d If the new input value at s does not coincide with the old value ...

Страница 620: ...rison instructions 619 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F374_DDTR present_value old_value IF R9009 THEN changed_value TRUE END_IF END_IF ...

Страница 621: ...structions If you need information on one of the following comparison instructions please refer to the corresponding standard operators in the online help ST AN OR STD AND ORD ST AN OR STD AND ORD ST AN OR STD AND ORD ST AN OR STD AND ORD ST AN OR STD AND ORD ST AN OR STD AND ORD ...

Страница 622: ...Chapter 20 Conversion instructions ...

Страница 623: ...FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Description Converts the data byte wise from the 1...

Страница 624: ...er specified by s2_Number exceeds the area specified by s1_Start the calculated result exceeds the area specified by d_Start the data specified by s2_Number is recognized as 0 Data types Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output varia...

Страница 625: ...rsion instructions 624 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F71_HEX2A s1_Start HexInput 0 s2_Number BytesToConvert d_Start ASCOutput 0 END_IF ...

Страница 626: ...ber of source data bytes s1 3 s1 2 s1 1 s1 0 d 1 d 0 31 46 45 44 43 42 41 1 F E D C B A 10 EF CD AB Converted result ASCII code 7 characters 7 bytes F72_AHEX instruction execution This position is filled with 0 Hexadecimal characters and ASCII codes Description Converts the ASCII codes that express the hexadecimal characters starting from the 16 bit area specified by s1 to hexadecimal numbers if t...

Страница 627: ... F72_A2HEX see page 1326 Variable Data type Function s1 WORD starting 16 bit area for ASCII code source s2 INT specifies number of source data bytes to be converted d ANY16 starting 16 bit area for storing converted data destination For Relay T C Register Constant s1 WX WY WR WL SV EV DT LD FL s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 ...

Страница 628: ...eader Body When the variable start is set to TRUE the function is carried out 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 LD ST When programming with structured text enter the following IF start THEN F72_A2HEX s1_Start AscInput 0 s2_Number 4 d_Start HexOutput ...

Страница 629: ...verted result is stored in the area specified by d ASCII code requires 8 bits one byte to express one BCD character Upon conversion to ASCII the data length will thus be twice the length of the BCD source data ASCII HEX code to express BCD character BCD character ASCII HEX code 0 1 2 3 4 5 6 7 8 9 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 This instruction also exists as a P instruction for FP2 2SH F...

Страница 630: ...on For Relay T C Register Constant s1 WX WY WR WL SV EV DT LD FL s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant Data types Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help ...

Страница 631: ...sion instructions 630 Part III FP Instructions ST When programming with structured text enter the following IF start THEN F73_BCD2A s1_Start BCDCodeInput s2_Number direction_number d_Start ASCOutput 0 END_IF ...

Страница 632: ...character Upon conversion to a BCD number the data length will thus be half the length of the ASCII code source data If an odd number of characters is being converted 0 will be entered for bit position 0 to 3 of the final data byte of the converted results if data is sequenced in the normal direction and 0 will be entered for bit position 4 to 7 if data is being sequenced in the reverse direction ...

Страница 633: ... ASCII code source s s2 ANY16 specifies number of source data bytes to be converted and how it is arranged d WORD starting 16 bit area for storing converted result destination For Relay T C Register Constant s1 WX WY WR WL SV EV DT LD FL s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant ASCII code not...

Страница 634: ...ed in the POU header Body When the variable start is set to TRUE the function is carried out For the variable at s1 you define an ARRAY with a minimum of four word 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 ...

Страница 635: ...Conversion instructions 634 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F74_A2BCD s1_Start ASCInput 0 s2_Number 16 8 d_Start BCDOutput 0 END_IF ...

Страница 636: ...ace If the number of bytes of ASCII codes following conversion including the minus sign is larger than the number of bytes specified by the s2 an operation error occurs Make sure the sign is taken into consideration when specifying the object of conversion for the s2 The following illustrations show conversions from 16 bit decimal data to ASCII codes When a negative number is converted 2D d 2 d 1 ...

Страница 637: ...0SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F75_BIN2A see page 1326 Variable Dat...

Страница 638: ...or all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out This programming example is based on the example for the conversion of a negative number outlined above The moni...

Страница 639: ... 30 0 0 1 30 30 d 100 9C FF 0 0 Range specified by s2 ASCII code Extra bytes Converted result F76_A2BIN instruction execution ASCII code Example of converting an ASCII code indicating a positive number s 2 s 1 s1 0 20 31 1 30 30 0 0 20 20 d 100 64 00 Converted result ASCII code ASCII code Extra bytes Range specified by s2 F76_A2BIN instruction execution Space Space Space ASCII HEX code to express ...

Страница 640: ...ode source s2 INT specifies number of source data bytes to be converted d ANY16 16 bit area for storing converted data destination For Relay T C Register Constant s1 WX WY WR WL SV EV DT LD FL s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the number of bytes specified by s2 exceeds the area specif...

Страница 641: ...ber of bytes to be converted is entered directly at the contact pin for s2 This programming example is based on the example for the conversion of a negative number on the main page of F76_A2BIN LD ST When programming with structured text enter the following IF start THEN F76_A2BIN s1_Start ASCInput 0 s2_Number 6 d DataOutput END_IF ...

Страница 642: ... operation error occurs Make sure the sign is taken into consideration when specifying the object of conversion for the s2 Example of converting a negative number from 32 bit decimal format to ASCII codes 2D d 2 d 1 d 0 31 1 32 33 3 2 20 12345678 B2 9E s1 d 3 34 35 5 4 d 4 36 37 7 6 38 8 43 FF Converted result 32 bit data F77_DBIN2A instruction execution Code Extra byte Range specified by s2 10 by...

Страница 643: ...y T C Register Constant s1 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex s2 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 R9008 MX0 900 7 MX0 900 8 permanently for an instant the number of bytes specified by s2 exceeds the area specified by d the data specified by s2 is recognized as 0 the converted result exceeds the area specified by d the number of...

Страница 644: ...Conversion instructions 643 Part III FP Instructions ST When programming with structured text enter the following IF start THEN F77_DBIN2A s1 DINT_input s2_Number 10 d_Start ASCII_output 0 END_IF ...

Страница 645: ...ified by s2 10 bytes F78_DA2BIN instruction execution Converted result Space ASCII HEX code to express decimal characters ASCII HEX code Decimal characters 16 20 16 2B 16 2D 16 30 16 31 16 32 16 33 16 34 16 35 16 36 16 37 16 38 16 39 SPACE 0 1 2 3 4 5 6 7 8 9 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN tr...

Страница 646: ... 32 bit data storage destination For Relay T C Register Constant s1 WX WY WR WL SV EV DT LD FL s2 WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the number of bytes specified by s2 exceeds the area specified by s1 the data specified by s2 is recognized as 0 the converted result exceeds the are...

Страница 647: ...ogramming this function have been declared in the POU header Body When the variable Enable is set to TRUE the function is executed The number of bytes to be converted is entered directly at the contact pin for s2 This programming example is based on the example for the conversion of a negative number outlined above LD ST When programming with structured text enter the following IF Enable THEN F78_...

Страница 648: ... Press Ctrl Shift v within the programming area to open the list of recently used elements See also BCD data in the online help PLC types Availability of F80_BIN see page 1326 Variable Data type Function s ANY16 binary data source range 0 to 9999 d WORD 16 bit area for 4 digit BCD code destination For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No ...

Страница 649: ...U header All input and output variables used for programming this function have been declared in the POU header Body When the variable Enable is set to TRUE the function is executed The decimal value in DecimalInput is converted to a BCD hexadecimal value and stored in the variable BCD_output LD ST When programming with structured text enter the following IF Enable THEN F80_BCD DecimalInput BCD_ou...

Страница 650: ...uction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements See also BCD data PLC types Availability of F81_BIN see page 1326 Variable Data type Function s WORD 16 bit area for 4 digit BCD data source d ANY16 16 bit area for storing 16 bit binary data destination For Relay T C Register Constant s WX WY WR WL S...

Страница 651: ...s used for programming this function have been declared in the POU header Body When the variable Enable is set to TRUE the function is executed The BCD value assigned to the variable BCD_input is converted to a decimal value and stored in the variable DecimalOutput The monitor value icon is activated for both the LD and IL bodies LD ST When programming with structured text enter the following IF E...

Страница 652: ...rs under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements See also BCD data PLC types Availability of F82_DBCD see page 1326 Variable Data type Function s ANY32 binary data source range 0 to 99 999 999 d DWORD 32 bit area for 8 digit BCD code destination For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL d...

Страница 653: ...amming this function have been declared in the POU header 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 prefix 2 or hexadecimal prefix 16 value directly at the contact pin for s LD ST When programming with structured text enter t...

Страница 654: ...u require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements See also BCD data PLC types Availability of F83_DBIN see page 1326 Variable Data type Function s DWORD area for 8 digit BCD data source d ANY32 32 bit area for storing 32 bit data destination For ...

Страница 655: ...eader All input and output variables used for programming this function have been declared in the POU header Body When the variable Enable is set to TRUE the function is executed The BCD value assigned to the variable BCD_input is converted to a decimal value and stored in the variable DINT_output LD ST When programming with structured text enter the following IF Enable THEN F83_DBIN BCD_input DIN...

Страница 656: ... you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F89_EXT see page 1326 Variable Data type Function s ANY16 16 bit source data area bit 15 is sign bit d ANY32 32 bit destination area s copied to lower 16 bits higher 1...

Страница 657: ...tions 656 Part III FP Instructions Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F89_EXT Var_16bit Var_32bit END_IF ...

Страница 658: ...t to 0 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recent...

Страница 659: ...n ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F90_DECO s input_value n specify_n ...

Страница 660: ...ndication destination For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Description Converts the 16 bit equivalent constant or 16 bit data specified by s to 4 digit data for 7 segment indication if the trigger EN is in the ON state The converted data is stored in the area starting with the 16 bit area specified by d The data for 7 segment ind...

Страница 661: ...instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F92_ENCO see page 1326 Variable Data type Function s starting 16 bit area to be encoded source n control data to specify the starting bit position and number of bits to be encoded d AN...

Страница 662: ...U header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F92_ENCO s input_value n specify_n d output_value END_IF ...

Страница 663: ...ions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F95_ASC see page 1326 Variable Data type Function s constant no variables possible Character constants max 12 letters source d ANY16 Starting 16 bit area f...

Страница 664: ... 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z b7 b7 Most significant digit Least significant digit ASCII HEX code ASCII Hex Code Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output var...

Страница 665: ...Conversion instructions 664 Part III FP Instructions LD ST When programming with structured text enter the following IF Enable THEN F95_ASC s ABC1230 DEF d_Start ASCII_Output 0 END_IF ...

Страница 666: ... For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL In this example the input variable input_value is declared However you can write a constant directly at the input contact of the function instead Description The function converts a value at input s to a gray code value The result of the conversion is returned at output d Data types Operands Example ...

Страница 667: ...ay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL In this example the input variable input_value is declared However you can write a constant directly at the input contact of the function instead Description The function converts a value at input s to a gray code value The result of the conversion is returned at output d Data types Operands...

Страница 668: ...ata For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL In this example the input variable input_value is declared However you can write a constant directly at the input contact of the function instead Description The function converts a gray code value at input s to binary data The result of the conversion is returned at output d Data types Operands E...

Страница 669: ...or Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL In this example the input variable input_value is declared However you can write a constant directly at the input contact of the function instead Description The function converts a gray code value at input s to binary data The result of the conversion is returned at output d Data type...

Страница 670: ...nstruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F240_COLM see page 1323 Variable Data type Function s source n ANY16 specifies bit position d ARRAY 0 15 of ANY16 destination a...

Страница 671: ...on are declared as input variables However you can write constants directly at the input contact of the function instead Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the ...

Страница 672: ...P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F241_LINE see page 1323 Variable Data type Function s ARRAY 0 15 OF ANY16 source area where bit column will be read n specifies bit position d ANY16 destination area for storing conv...

Страница 673: ...n are declared as input variables However you can write constants directly at the input contact of the function instead Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the P...

Страница 674: ...ion 16 converts in 16 bit 1 word units 32 converts in 32 bit 2 word units s2_BinaryData ANY Starting area for storing binary data n_Conversion Method ANY16 Conversion method 16 Number of ASCII characters per converted unit Offset in ASCII character units 8 bit Number of 16 bit 1 word or 32 bit 2 word units converted for details see explanation following the tables d_AsciiData ANY Starting area for...

Страница 675: ...o be converted in n_ConversionMethod the number of 16 or 32 bit decimal numbers to be converted specified by n_ConversionMethod exceeds the area for storing ASCII data the converted result exceeds the area Explanation of the conversion method e g n_ConversionMethod 16 0214 16 0 2 1 4 3 6 3 5 2 D 2 0 3 4 3 3 3 2 3 1 6 5 _ 4 3 2 1 F F C 8 0 4 D 2 56 1234 Number of ASCII characters per converted unit...

Страница 676: ...ce will be stored in the leading blanks if the area specified in d_AsciiData is larger than the number of ASCII characters per converted unit Conversion examples Binary data s1_ Con trol n_Con version Method Result ASCII data Comment Data type Offs in 16 bit word units Hex value D 3 D 2 D 1 D 0 16 5678 16 H 16 204 21 43 65 87 INT WORD 1 16 1234 Normal direction 2 x 4 ASCII characters 0 16 5678 16 ...

Страница 677: ...mming this function have been declared in the POU header Body When bExecute is set to TRUE the instruction is carried out It converts two 16 bit units to 2 x 4 decimal ASCII data Offset 1 ASCII character 8 bit LD ST When programming with structured text enter the following IF DF bExecute THEN F250_BTOA s1_Control 16 D s2_BinaryData iArray1 n_ConversionMethod 16 214 d_AsciiData iAscii1 END_IF ...

Страница 678: ...erts decimal ASCII data converts hexadecimal ASCII dat Normal direction Reverse direction converts the ASCII data to 16 bit 32 768 to 32 767 16 0 to 16 F converts the ASCII data to 32 bit 2 147 483 648 to 2 147 483 647 16 FFFFFFFF s2_AsciiData ANY Starting area for storing ASCII data n_ConversionMethod ANY16 Conversion method 16 Number of ASCII characters pe Offset in ASCII character units Number ...

Страница 679: ... 2 word units to be converted in n_ConversionMethod the number of 16 or 32 bit decimal numbers to be converted specified by n_ConversionMethod exceeds the area for storing ASCII data the converted result exceeds the area Explanation of the conversion method e g n_ConversionMethod 16 0413 for ASCII data 0123456789012 16 0 4 1 3 3 2 3 1 3 0 3 9 3 8 3 7 3 6 3 5 2 1 0 9 8 7 6 5 3 4 3 3 3 2 3 1 4 3 2 1...

Страница 680: ...haracters 0 16 201 1 16 534 2 16 867 H 16 16 403 INT WORD 3 16 B9A Normal direction 3 x 4 ASCII characters 0 16 012 1 16 345 2 16 678 H 16 16 403 INT WORD 3 6 9AB Reverse direction 3 x 4 ASCII characters 0 16 67452301 H 32 16 208 DINT DWORD 2 16 EFCDAB89 Normal direction 8 x 2 ASCII characters 0 16 01234567 H 32 16 208 DINT DWORD 2 16 89ABCDEF Reverse direction 8 x 2 ASCII characters 0 16 42301 H ...

Страница 681: ...used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When bExecute is set to TRUE the instruction is carried out It converts 2 x 4 decimal ASCII characters to binary data Offset 1 ASCII character 8 bit ...

Страница 682: ...tions 681 Part III FP Instructions LD ST When programming with structured text enter the following IF DF bExecute THEN F251_ATOB s1_Control D 16 s2_AsciiData iAscii1 n_ConversionMethod 16 214 d_BinaryData iArray2 END_IF ...

Страница 683: ...D s2_AsciiData WX WY WR WL SV EV DT LD FL n_Conversion Method WX WY WR WL SV EV DT LD dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant there is an error in the control string specified by s1_Control normal direction is specified in s1_Control when the format is decimal the number of ASCII characters per converted unit specified by n_ConversionMethod excee...

Страница 684: ...he POU header Body When bExecute is set to TRUE the instruction checks whether the data connected at s2_AsciiData can be converted when the control string is D 16 and the conversion method 16 214 LD ST When programming with structured text enter the following IF DF bExecute THEN F252_ACHK s1_Control D 16 s2_AsciiData Adr_Of_VarOffs Var sString1 Offs 2 n_ConversionMethod 16 214 IF sys_bIsEQ THEN bA...

Страница 685: ...data source d REAL Floating point real number data for result destination For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant the result of processing is recognized as 0 Description Converts the 16 bit integer data with sign specified by s to real number data The converted data is stored in ...

Страница 686: ...ult destination For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R900B MX0 900 11 for an instant there are too many significant digits in mantissa of converted real number data R9009 MX0 900 9 for an instant the result of processing is recognized as 0 Description Converts the 32 bit integer data with sign speci...

Страница 687: ...Conversion instructions 686 Part III FP Instructions LD ...

Страница 688: ...cilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F327_INT see page 1324 Variable Data type Function s REAL source REAL number data 2 words s2 INT WORD destination for storing converted data For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DD...

Страница 689: ...y at the input contact of the function instead Body When the variable start is set to TRUE the function is carried out It converts the floating point value 1 234 into the whole number value 2 which is transferred to the variable output_value at the output Since the whole number may not exceed the floating point value the function rounds down here LD ST When programming with structured text enter t...

Страница 690: ...te reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F328_DINT see page 1324 Variable Data type Function s REAL source REAL number data 2 words d DINT DWORD destination for storing converted data For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DL...

Страница 691: ...ion have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It converts the floating point value 1234567 89 into the whole number value 1234568 which is transferred to the variable output_value at the output Since the whole number may not exceed the floating point value the function rounds down here LD ST When programming with structured text en...

Страница 692: ...ns pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F333_FINT see page 1324 Variable Data type Function s REAL source d REAL destination For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL de...

Страница 693: ...ogramming this function have been declared in the POU header Body The value 1234 888 is assigned to the variable input_value When the variable start is set to TRUE the function is carried out It rounds down the input_value after the decimal point and returns the result here 1234 000 at the variable output_value LD ST When programming with structured text enter the following input_value 1234 888 IF...

Страница 694: ... DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the value at input s is not a REAL number R900B MX0 900 11 to TRUE the result is 0 R9009 MX0 900 9 for an instant the result causes an overflow In this example the input variable input_value is declared However you can write a constant directly at the i...

Страница 695: ...Conversion instructions 694 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F334_FRINT input_value output_value END_IF ...

Страница 696: ...Y DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the value at input s is not a REAL number R9009 MX0 900 9 for an instant the result causes an overflow In this example the input variable input_value is declared However you can write a constant directly at the input contact of the function instead Description The function changes the sig...

Страница 697: ...Conversion instructions 696 Part III FP Instructions LD ST When programming with structured text enter the following input_value 333 444 IF start THEN F335_FSIGN input_value output_value END_IF ...

Страница 698: ...recently used elements PLC types Availability of F337_RAD see page 1324 Variable Data type Function s REAL source angle data degrees 2 words d REAL destination for storing converted data For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the value at inpu...

Страница 699: ...ame POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F337_RAD i...

Страница 700: ...recently used elements PLC types Availability of F338_DEG see page 1324 Variable Data type Function s REAL source angle data radians 2 words d REAL destination for storing converted data For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the value at inpu...

Страница 701: ...ame POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F338_DEG i...

Страница 702: ...Chapter 21 Counter instructions ...

Страница 703: ...e a falling edge is detected at Reset the value at SV is assigned to EV SV set value value of EV after a reset procedure C signal output is set when EV becomes 0 EV elapsed value current counter value PLC types Availability of CT_FB see page 1319 Variable Data type Function Count count contact down Reset BOOL reset contact SV INT set value C BOOL set when EV 0 EV INT elapsed value Time chart Count...

Страница 704: ...n counter uses the same NUM address area Num input In order to avoid errors address conflicts the CT function and the CT_FB function block should not be used together in a project Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables which are used for prog...

Страница 705: ...s Body This example uses variables You may also use constants for the input variables Each rising edge detected at count_contact the value 1 is subtracted from the elapsed value EV Signal_output is set to TRUE if the elapsed value EV becomes zero LD ...

Страница 706: ...unt input is ignored and preset is executed PLC types Availability of CT see page 1319 This function does not require a variable at the output C Variable Data type Function Count BOOL subtracts 1 from the set value each time it is activated Reset BOOL resets the elapsed value when it is ON presets the set value when changing from on to off Num ANY16 Must be a constant number assigned to the counte...

Страница 707: ...ode is switched from RUN to PROG and a non hold type in which the counter is reset under these conditions System register 6 can be used to specify a non hold type Set Value and Elapsed Value area At the fall time when the reset input goes from on to off the value of the set value area SV is preset in the elapsed value area EV When the reset input is on the elapsed value is reset to 0 Each time the...

Страница 708: ...ructions 707 Part III FP Instructions LD ST When programming with structured text enter the following Counter100 CT Count Count_input Reset Reset_input Num 100 SV Setvalue Num 100 in this example must be a constant ...

Страница 709: ...0FF CountTrigger BOOL starts counter Reset_Preset BOOL resets counter s_PresetValue 16 bit area or equivalent constant for counter preset value d ANY16 16 bit area for counter elapsed value The variables s and d have to be of the same data type For Relay T C Register Constant UpDirection CountTrigger Reset_Preset X Y R L T C s_PresetValue WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT L...

Страница 710: ...nput UpDirection sets the direction of the counter TRUE up FALSE down TRUE at the input Reset_Preset resets the counter to the starting value LD ST When programming with structured text enter the following output_value F118_UDC UpDirection up Count_Trigger count Reset_Preset reset s_PresetValue set_value output_value contains the count value ...

Страница 711: ......

Страница 712: ...Chapter 22 Data transfer via communication ports ...

Страница 713: ...es The slave answers automatically to the commands received from the master so no program is necessary on the slave The Modbus protocol supports both ASCII mode and RTU binary mode However the PLCs of the FP Series only support the RTU binary mode Program controlled mode With program controlled communication the user generates a program which governs the data transfer between a PLC and one or more...

Страница 714: ...economic way of linking PLCs using a twisted pair cable and the MEWNET protocol Data is shared with all PLCs by means of dedicated internal relays called link relays L and data registers called link registers LD The statuses of the link relays and link registers of one PLC are automatically fed back to the other PLCs on the same network The link relays and link registers of the PLCs contain areas ...

Страница 715: ... Ports via the Input X Flags see page 732 Setting the COM Ports via the Output Y Flags see page 722 Setting the CPU s Communication Parameters 22 2 1 1 Setting the CPU s COM Ports in PROG Mode via System Registers For a general description on setting the system registers please refer to the online help under setting the system registers 1 2 3 Procedure 1 Double click PLC in the navigator 2 Double ...

Страница 716: ...t Communication format setting Default settings Data length 8 bits Parity Odd Stop bit 1 bit Start code No STX End code CR The setting must match the external device connected to the communication port MEWTOCOL COM and Modbus RTU The end code setting must always be CR and the start code setting must be No STX PLC Link The communication format settings are fixed For details on the format of the dat...

Страница 717: ...code STX 16 02 valid on None off off CR 16 0D and LF 16 0A on off CR 16 0D off on End code EXT 16 03 on on 2 bits off Stop bit 1 bit on None off off Even on off Parity check Odd on on 7 bits off Data length character bit 8 bits on 2 Set the baud rate The default baud rate is 9600bit s The setting must match the external device connected to the communication port Use the lower row of operation mode...

Страница 718: ... possible to change to the Modbus RTU mode using F159_MTRN The communication mode of the CPU s communication ports can be changed during RUN mode You can toggle between program controlled mode and MEWTOCOL COM mode by executing F159_MTRN and setting the variable n_Number the number of bytes to be sent to 16 8000 POU Header and LD Body The communication mode flag turns on when program controlled mo...

Страница 719: ...munication mode TRUE Program controlled mode FALSE MEWTOCOL COM Slave Computer Link mode Setting the MCU s COM Ports in PROG Mode via DIP Switches FP2 2SH Use the DIP switches that are located at the back of the unit to set the operation mode and communication speed Description Sets the communication mode to the mode indicated by the value applied at bSetProgramControlled If this value is TRUE the...

Страница 720: ... is ON Setting the MCU s COM Ports in PROG Mode via the MCU Dialog Please refer to the description of the MCU parameter settings in the online help Setting the MCU s communication ports in RUN Mode with F159_MWRT_PARA This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the...

Страница 721: ... 1 bit 1 2 bits 6 RS_CS_IsValid 0 disable 1 enable 7 SendWaitingTime 0 time for about three characters effective time n 0 01ms 0 to 100ms 8 SendingHeaderValue 0 No STX 1 STX 9 SendingTerminator_ReceptionDoneCriterion_Value 0 CR 1 CR LF 2 No SendingTerminator ReceptionDone by Timeout 24 bits 3 EXT 10 ReceptionDoneTimeOut 0 immediate effective time n 0 01 ms 0 to 100 ms 11 InitModemWhenPowerTurnsOn ...

Страница 722: ...ions For Relay T C Register Constant s_Para WX WY WR WL SV EV DT LD FL d_Port WY WR WL SV EV DT LD FL dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the MCU unit does not exist in the specified slot Operands Error flags ...

Страница 723: ...alid and using the RS232C communication cassette Y1A Y1D Y1A Y1D Undefined Default setting 0 Do not change None Y1E Y1F Request to reset CH Communication channels can be reset by turning on Y1E or Y1F No request to reset 0 Request to reset 1 After 1 is output and the completion of the reset is confirmed by XE XF return to 0 The reset is performed only once when this signal rises During reset the f...

Страница 724: ... Instructions Changing operation modes see page 717 switching between program controlled communication and MEWTOCOL COM Slave using F159_MTRN Turning on the PLC power supply or changing from PROG to RUN mode if the MCU settings have been made via software ...

Страница 725: ...ee page 859 2 Using PLC independent functions The port number must be specified in a variable The functions IsPlcLink see page 724 and IsProgramControlled see page 726 are available 3 Using special relays The relay numbers vary depending on the COM port and the PLC type For details on getting the communication mode of an MCU please refer to Getting the MCU communication parameters see page 729 22 ...

Страница 726: ..._bIsToolPortProgramCo ntrolled COM1 1 R9032 sys_bIsComPort1ProgramC ontrolled COM2 2 R9042 IsProgramControlled see page 726 sys_bIsComPort2ProgramC ontrolled FALSE FP2 FP2SH FP10SH Port name Port number Special internal relay Function name System variable name Bit status COM 0 R9032 IsProgramControlled see page 726 sys_bIsComPort1ProgramC ontrolled TRUE MCU Port name Port number Function name DUT ...

Страница 727: ... ntrolled COM1 1 R9032 sys_bIsComPort1ProgramC ontrolled COM2 2 R9042 IsProgramControlled see page 726 sys_bIsComPort2ProgramC ontrolled FALSE FP2 FP2SH FP10SH Port name Port number Special internal relay Function name System variable name Bit status COM 0 R9032 IsProgramControlled see page 726 sys_bIsComPort1ProgramC ontrolled FALSE MCU Port name Port number Function name DUT COM1 16 xx01 COM2 16...

Страница 728: ... ports 727 Part III FP Instructions xx slot number hexadecimal Getting the MCU s Communication Parameters In this section F161_MRD_PARA see page 728 F161_MRD_STATUS see page 730 Getting in RUN Mode via the Input X Flags see page 732 ...

Страница 729: ...om the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Configuration of communication parameters 1 UnitNumber station 1 to 99 2 BaudrateValue 0 to 10 2 2 Baud rate setting value Description Communication parameters in the...

Страница 730: ...tive time n 0 01 ms 0 to 100 ms 11 InitModemWhenPowerTurnsOn 0 not initialized 1 initialized PLC types Availability of F161_MRD_PARA see page 1321 Variable Data type Function s_Port ANY16 Specification of slot number high byte and port number low byte of the MCU to which the data is transmitted 16 xx01 COM1 on MCU in slot 16 xx 16 xx02 COM2 on MCU in slot 16 xx d1_Para MCU_PARA_DUT Communication p...

Страница 731: ...COL COM Slave 1 Program controlled serial communication 2 PLC Link 7 modem initialization 2 CommunicationCassette 0 no communication cassette 232 RS232C 422 RS422 485 RS485 3 ReceptionErrorCode Bit 0 receive buffer overrun hardware bit 1 stop bit not detected bit 2 parity unmatched Bit 8 receive buffer overflow bit 9 receive buffer full 4 NumberReceptionErrors number of times the reception error s...

Страница 732: ... xx01 COM1 on MCU in slot 16 xx 16 xx02 COM2 on MCU in slot 16 xx d1_Status MCU_STATUS_DUT Communication parameters defined in the predefined DUT For Relay T C Register Constant s_Port WX WY WR WL SV EV DT LD FL dec or hex d1_Status WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the specified address using the index modifier exceeds a limit...

Страница 733: ...the data read 1 No error exists in the data read 0 Note 1 Program controlled communication X8 X9 CTS signal monitor Status of the CTS signal sent from the device being communicated with Transmission from MCU is possible 0 Transmission from MCU is not possible 1 The RTS signal from the MCU is controllable by Y18 and Y19 Effective only when setting the RS CS to be valid and using the communication b...

Страница 734: ...age 741 allows multiple communication ports to be accommodated This instruction is an updated version of F144_TRNS Both instructions are compatible with all PLCs PLCs with multiple communication ports will compile F144_TRNS s n to F159_MTRN s_Start n_Number d_Port 1 PLCs with only one communication port will compile F159_MTRN to F144_TRNS s n 22 4 1 Sending data to external devices Steps for sendi...

Страница 735: ...fset 2 1 3 4 2n 2n 1 Bold numbers indicate the order of transmission The maximum volume of data that can be sent is 2048 bytes EXAMPLE Define a send buffer for 30 bytes ARRAY 0 15 OF WORD and copy 8 characters of a string ABCDEFGH into the buffer Send buffer layout 0 1 2 4 16 42 B 16 41 A 16 44 D 16 43 C 16 48 H 16 47 G 16 46 F 16 45 E 8 3 Offset 15 The first word of the send buffer offset 0 is re...

Страница 736: ...e F159_MTRN see page 741 to specify the amount of data to be sent specify the communication port to be used output the data from the communication port to the external device When the execution condition of F159_MTRN turns to TRUE and the transmission done flag is TRUE transmission starts For details on flag operation see page 757 When sending data operation is as follows The number of bytes to be...

Страница 737: ...ion F159_MTRN execution Transmission done flag POU Header and LD Body ST Body When the variable bSend is set to TRUE the function F10_BKMV copies the characters of the string sSendData to the buffer awSendBuffer beginning at awSendBuffer 1 Then F159_MTRN sends the data from the first element of the send buffer awSendBuffer 0 as specified by s_Start The length of the string to be sent 8 bytes is se...

Страница 738: ...transmission done flag and the communication error flag see page 757 For details on the format of the data in the send buffer and in the receive buffer please see Format of send and receive data on page 745 Data cannot be sent unless the pin CS Clear to Send is on When connecting to a three wire port short circuit the RS and CS pins ...

Страница 739: ...s The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored sString STRING Stores the send string bSuppressEndCode BOOL When set to TRUE the instruction does not append the sending end code character even if specified in the respective system register Input output variable SendBuffer ANY Stores the send string temporarily Description This...

Страница 740: ...the function has been programmed in ladder diagram LD and structured text ST POU header All input and output variables used for programming this function have been declared in the POU header LD If bSend changes from FALSE to TRUE the instruction sends the characters from sSendData to the MCU port 1 The characters are copied to the array awSendBuffer awSendBuffer 0 is reserved for the length of the...

Страница 741: ...on port Value 16 xx01 COM1 16 xx02 COM2 xx slot number hexadecimal of the MCU e g 16 0001 COM1 in slot 0 16 0A02 COM2 in slot 10 16 1401 COM1 in slot 20 Other PLCs The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored bSuppressEndCode BOOL When set to TRUE the instruction does not append the sending end code character even if specifie...

Страница 742: ...Data transfer via communication ports 741 Part III FP Instructions LD ST SendCharactersAndClearString Port 1 bSuppressEndCode bSuppressEndCode sString sSendData ...

Страница 743: ...uction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements REFERENCE Data transfer in program controlled mode see page 733 Changing the communication mode in RUN mode see page 717 Description This instruction is used...

Страница 744: ...02 COM2 xx slot number hexadecimal of the MCU e g 16 0001 COM1 in slot 0 16 0A02 COM2 in slot 10 16 1401 COM1 in slot 20 Other PLCs The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored For Relay T C Register Constant s_Start WX WY WR WL SV EV DT LD FL n_Number WX WY WR WL SV EV DT LD FL dec or hex d_Port WY WR WL SV EV DT LD FL No IE...

Страница 745: ...f characters The string header must not be copied into the buffer Therefore enter an offset of 2 to the starting address of the string before copying the data Make sure that the send buffer is big enough for all the data to be sent To determine its size you must take into account that two characters of the string SendString can be copied into each element of the array SendBuffer SendBuffer 0 is re...

Страница 746: ...art code resets the receive buffer If None is selected for the start code a start code is not added to the data sent and is not recognized in the data received Without start code the receive buffer can only be reset by executing F159_MTRN If None is selected for the end code an end code is not added to the data sent and is not recognized in the data received Without end code the reception done fla...

Страница 747: ... reset the receive buffer This is done automatically when sending the next data with F159_MTRN Resetting the receive buffer sets the number of bytes received in offset 0 to 0 and moves the write pointer back to offset 1 Subsequent data will be stored in the receive buffer starting at offset 1 The receive buffer is not cleared The reception done flag turns to FALSE To reset the receive buffer witho...

Страница 748: ...a received via the communication ports of an MCU has to be moved to the CPU receive buffer using the instruction F161_MRCV see page 755 1 Setting the communication parameters see 2 Receiving the data Data is automatically received in the receive buffer defined in the system registers Reception can be controlled by the reception done flag or by directly evaluating the receive buffer For details on ...

Страница 749: ...g CR has been selected in the system registers 3 Processing the data in the receive buffer Verify the end of reception Copy the data in the receive buffer to a target area defined in the program using a transfer instruction e g F10_BKMV see page 819 NOTE For details on the operation of the reception done flag see page 757 4 Preparing the system for the reception of further data In order to receive...

Страница 750: ...ble Reception possible Execution of F159_MTRN Receive buffer layout 0 1 2 4 16 42 B 16 41 A 16 44 D 16 43 C 16 48 H 16 47 G 16 46 F 16 45 E 8 3 Offset When reception begins the value in offset 0 is 8 At the end of reception the value in offset 0 is 0 The data in offset 1 to offset 4 is received in order from the low order byte System register settings In order to use the data in the receive buffer...

Страница 751: ...with n_Number 0 NOTE The status of the reception done flag may change while a scan is being carried out For example if the flag is used more than once as an input condition different statuses may exist within one scan To ensure proper execution of the program the status of the special internal relay should be copied to a variable at the beginning of the program The start code STX resets the receiv...

Страница 752: ...mmunication port Value 16 xx01 COM1 16 xx02 COM2 xx slot number hexadecimal of the MCU e g 16 0001 COM1 in slot 0 16 0A02 COM2 in slot 10 16 1401 COM1 in slot 20 Other PLCs The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored Output variable aBuffer ANY stores the receive data No IEC address Set If R9007 MX0 900 7 permanently R9008 M...

Страница 753: ...Data transfer via communication ports 752 Part III FP Instructions ST When programming with structured text enter the following if bReadReceiveData then aiReceiveBuffer ReceiveData 1 end_if ...

Страница 754: ... number hexadecimal of the MCU e g 16 0001 COM1 in slot 0 16 0A02 COM2 in slot 10 16 1401 COM1 in slot 20 Other PLCs The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored Output variable sString STRING string to be received No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the MCU unit does not exist at ...

Страница 755: ...The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored For Relay T C Register Constant Port WX WY WR WL SV EV DT LD FL dec or hex No IEC address Set If R900B MX0 900 11 for an instant R9009 MX0 900 9 for an instant the communication port specified by Port does not exist Description This instruction resets the receive buffer to be ready...

Страница 756: ...Data transfer via communication ports 755 Part III FP Instructions ST if DF bClearReceiveBuffer then ClearReceiveBuffer 1 end_if ...

Страница 757: ...out using the IsReceptionDoneByTimeOut see page 761 function or by checking the contents of the receive buffer The number of bytes received is stored in the initial address specified by d1_Start of the receive buffer If the data received exceeds the ending address specified by b2_End an operation error is detected The data which has been received up to d2_End will be stored F161_MRCV also clears t...

Страница 758: ...s not exist in the specified slot the specified communication port does not exist 22 4 3 Flag operation in program controlled communication Program controlled communication provides for half duplex communication i e communication is possible in both directions but not simultaneously Sending can be controlled by the transmission done flag Reception can be controlled by the reception done flag or by...

Страница 759: ...be copied to a variable at the beginning of the program FP0 Port name Port number Special internal relay Function name System variable name Bit status COM 1 R9038 IsReceptionDone see page 760 sys_bIsComPort1ReceptionDone TRUE FP0R Port name Port number Special internal relay Function name System variable name Bit status TOOL 0 R903E sys_bIsToolPortReceptionDone COM1 1 R9038 IsReceptionDone see pag...

Страница 760: ...nDone TRUE FP FP X Port name Port number Special internal relay Function name System variable name Bit status TOOL 0 R903F sys_bIsToolPortTransmissionDone COM1 1 R9039 sys_bIsComPort1TransmissionDone COM2 2 R9049 IsTransmissionDone see page 763 sys_bIsComPort2TransmissionDone TRUE FP2 FP2SH FP10SH Port name Port number Special internal relay Function name System variable name Bit status COM 0 R903...

Страница 761: ...P FP X Port name Port number Special internal relay Function name System variable name Bit status TOOL 0 R900E sys_bIsToolPortCommunicationError COM1 1 R9037 sys_bIsComPort1CommunicationError COM2 2 R9047 IsCommunicationError see page 764 sys_bIsComPort2CommunicationError TRUE FP2 FP2SH FP10SH Port name Port number Special internal relay Function name System variable name Bit status COM 0 R9037 Is...

Страница 762: ...l be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored Output variable IsDone BOOL set to TRUE if the end code has been received The end code is specified in the corresponding system register under COM port settings Description This function returns the value of the reception done flag The reception done flag is TRUE if the end code has been received...

Страница 763: ...mber hexadecimal of the MCU e g 16 0001 COM1 in slot 0 16 0A02 COM2 in slot 10 16 1401 COM1 in slot 20 Other PLCs The command will be compiled to F144_TRNS which works on the COM port of the CPU the parameter d_Port will be ignored TimeOutForCPU TIME Set the time out If no further data is received before the time out reception is done and IsDone is set to TRUE NoOfBytesReceived ANY16 Connect the s...

Страница 764: ...Data transfer via communication ports 763 Part III FP Instructions LD ST IsReceptionDone1 Port iPort TimeOutForCPU T 20ms NoOfBytesReceived g_awReceiveBuffer 0 IsDone bIsRecDone1 ...

Страница 765: ...nDone Evaluation of transmission done flag for all ports Description This function returns the value of the transmission done flag The transmission done flag see page 757 is TRUE if the specified number of bytes has been sent from the assigned communication port of the PLC Example ...

Страница 766: ...municationError Evaluation of communication error flag for all ports Description This instruction returns the value of the communication error flag The communication error flag is TRUE if an error has occurred at the specified port during serial communication Symbol Example ...

Страница 767: ...0124 If the transmission has been completed with an error R9045 is ON the contents of the error error code are stored COM2 sys_bIsComPort2F145F146Error R904B 0 Completed normally 1 Completed with error The error code is stored in DT90125 COM2 sys_wComPort2F145F146ErrorCode DT90125 If the transmission has been completed with an error R904B is ON the contents of the error error code are stored For d...

Страница 768: ...dress ANY16 Address of the remote station 1 99 MasterData ANY The master data which is written to the slave SlaveData ANY The data of the slave to which the data is written MasterData and SlaveData have to be of the same data type To establish external data access from the master to the slave data please assign fixed user addresses same addresses as slave data in the global variable list For Relay...

Страница 769: ...S see page 769 or the F145F146_MODBUS_COMMAND see page 777 For another station number outside the range 0 99 or another start register as available in the table of modbus commands see page 777 please use the modbus function blocks of the Modbus Library for FPWIN Pro NCL MODBUS LIB Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST GVL I...

Страница 770: ...ions ST When programming with structured text enter the following bBool1 sys_bPulse1s if bWrite1 and sys_bIsComPort1F145F146NotActive then F145_WRITE_DATA Port SYS_COM1_PORT SlaveAddress 2 MasterData bBool1 SlaveData Slave2_g_bR15 bRead1 true bWrite1 false end_if ...

Страница 771: ...ss ANY16 Address of the remote station 1 99 MasterWordData ANY The master data which is written to the slave SlaveWordAddressType Address type in the slave to which data is written The offset must be zero e g DT0 WL0 SlaveWordAddressOffs The offset for the starting slave address whose type is defined by SlaveWordAddressType and to which the data is written NumberOfWords_ BitsInWords ANY16 Number o...

Страница 772: ...t in the slave ON FF00 OFF 0000 The compiler calculates the higher word from Port and SlaveAddress The higher word is set implicitely The lower word is specified by NumberOfWords_BitsInWords For Relay T C Register Constant Port WX WY WR WL DT LD FL Slave Address WX WY WR WL DT LD FL dec or hex Master WordData WX WY WR WL DT LD FL SlaveWord Address Type WX WY WR WL DT LD FL SlaveWord AddressOffs WX...

Страница 773: ...6_OverlappingDut_1 b0 If bWrite1 and sys_bIsComPort1F145F146NotActive are set to TRUE bBool1 is written to the output Y38 of slave 2 via Bool16_OverlappingDut_1 b0 LD ST When programming with structured text enter the following bBool1 sys_bPulse1s Bool16_OverlappingDut_1 b0 bBool1 if bWrite1 and sys_bIsComPort1F145F146NotActive then F145_WRITE_DATA_TYPE_OFFS Port SYS_COM1_PORT SlaveAddress 2 Maste...

Страница 774: ...stant Port WX WY WR WL DT LD FL Slave Address WX WY WR WL DT LD FL dec or hex Master Data WX WY WR WL DT LD FL Slave Data WX WY WR WL DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 permanently port 0 global transmission gets no response from COM1 or COM2 slave data or master data exceeds the available address range the communication mode see page 712 is not set to MEWTO...

Страница 775: ...output variables used for programming this function have been declared in the POU header Body If bRead1 and sys_bIsComPort1F145F146NotActive are set to TRUE the global variable Slave2_g_bY38 which is assigned to Y38 of slave 2 is read and stored in bBool2 LD ST When programming with structured text enter the following if bRead1 and sys_bIsComPort1F145F146NotActive then F146_READ_DATA Port SYS_COM1...

Страница 776: ... which data is read SlaveWordAddressOffs The offset for the starting slave address whose type is defined by SlaveWordAddressType and to which the data is written NumberOfWords_ BitsInWords ANY16 Number of word units to be read by the master if the highest bit is not set or bits in word if the highest bit is set Is identical to the lower word of s1_ControlData MasterWordData ANY The master data whi...

Страница 777: ... to read must be 1 The compiler calculates the higher word from Port and SlaveAddress The higher word is set implicitely The lower word is specified by NumberOfWords_BitsInWords For Relay T C Register Constant Port WX WY WR WL DT LD FL Slave Address WX WY WR WL DT LD FL dec or hex SlaveWord Address Type WX WY WR WL DT LD FL SlaveWord AddressOffs WX WY WR WL DT LD FL dec or hex NumberOfWords_ BitsI...

Страница 778: ...tActive are set to TRUE the output Y38 of slave 2 is read and written to bit 1 of Bool16_OverlappingDut_1 w0 This bit can be accessed by Bool16_OverlappingDut_1 b1 and is copied to bBool2 LD ST When programming with structured text enter the following if bRead1 and sys_bIsComPort1F145F146NotActive then F146_READ_DATA_TYPE_OFFS Port SYS_COM1_PORT SlaveAddress 2 SlaveWordAddressType WY0 SlaveWordAdd...

Страница 779: ... 0 9998 1 100001 109999 03 SYS_MODBUS_03_R EAD_HOLDING_REGI STERS 0 32764 1 400001 432765 04 SYS_MODBUS_04_R EAD_INPUT_REGIST ERS 0 127 2000 2255 1 300001 300128 302001 302256 05 SYS_MODBUS_05_F ORCE_COIL 0 9998 1 000001 009999 06 SYS_MODBUS_06_P RESET_REGISTER 0 32764 1 400001 432765 15 SYS_MODBUS_15_F ORCE_COILS 0 9998 multiple of 16 000001 009999 16 SYS_MODBUS_16_P RESET_REGISTERS 0 32764 1 400...

Страница 780: ...SYS_MODBUS_06_PRESET_REGISTER SYS_MODBUS_15_FORCE_COILS SYS_MODBUS_16_PRESET_REGISTERS StartRegister Starting address The address type depends on the command specified by FunctionCode NumberOfRegisters ANY16 Number of transmission bits or words MasterData ANY The master data which is written to the slave For Relay T C Register Constant Port WX WY WR WL DT LD FL Slave Address WX WY WR WL DT LD FL F...

Страница 781: ...36 04 SYS_MODBUS_04_READ_INPUT_REGISTERS 0 65535 1 127 300001 365536 5 SYS_MODBUS_05_FORCE_COIL 0 65535 1 000001 065536 6 SYS_MODBUS_06_PRESET_REGISTER 0 65535 1 400001 465536 15 SYS_MODBUS_15_FORCE_COILS 0 65535 2 2040 000001 065536 16 SYS_MODBUS_16_PRESET_REGISTERS 0 65535 2 127 400001 465536 Modbus specifications for Panasonic PLCs Reference numbers Address area of Panasonic PLCs From 000001 Fr...

Страница 782: ...ds 1 2040 for function codes 01 02 2 2040 for function code 15 1 127 for function codes 03 04 2 127 for function code 16 MasterData ANY The master data which is written to the slave For Relay T C Register Constant Port WX WY WR WL DT LD FL Slave Address WX WY WR WL DT LD FL Function Code system Start Register WX WY WR WL DT LD FL NumberOf Registers dec or hex Master Data WX WY WR WL DT LD FL No IE...

Страница 783: ...lways TRUE 16 xx01 MCU COM1 port of MCU unit in slot xx FP2 FP2SH 16 xx02 MCU COM2 port of MCU unit in slot xx returns always TRUE For detailed information on using system variables please refer to data transfer to and from special data registers see page 859 IsReceptionDone for a special COM port via the corresponding System Variable You can use the following system variables to evaluate the IsF1...

Страница 784: ...s_bIsComPort2F14 5F146Error 0 TOOL port returns always FALSE FP0R 1 COM1 port R9045 sys_bIsComPort1F14 5F146Error FP0 FP e returns always FALSE 0 CPU COM port returns always FALSE 16 xx01 MCU COM1 port of MCU unit in slot xx FP2 FP2SH 16 xx02 MCU COM2 port of MCU unit in slot xx returns always FALSE For detailed information on using system variables please refer to data transfer to and from specia...

Страница 785: ......

Страница 786: ...Chapter 23 Data transfer via network ...

Страница 787: ...Data transfer via network 786 Part III FP Instructions 23 1 Data transfer via MEWNET link In this section F145_SEND see page 787 F146_RECV see page 789 ...

Страница 788: ... 3 0 LK UN n2 F n1 low high Bit Bit 1 LINK No selection LK 1 to 3 the station itself 1 Word unit send selection F 0 Word unit selection Up to 3 Link Units can be connected to 1 CPU n2 0 Set 0 when the word unit is selected This LK selects the source Link Unit of the three n1 11 16 Specify the number of words to be sent 2 Link station No selection UN 1 to 63 another station 2 Bit unit send selectio...

Страница 789: ... Must be a constant The variables s2 and d have to be the same data type For Relay T C Register Constant s1 DWX DWY DWR DWL DSV DEV DDT DLD DFL s2 WX WY WR WL SV EV DT LD FL d WY WR WL SV EV DT LD FL n dec or hex Data types Operands Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU head...

Страница 790: ... 3 0 LK UN n2 F n1 low high Bit Bit 1 LINK No selection LK 1 to 3 the station itself 1 Word unit send selection F 0 Word unit selection Up to 3 Link Units can be connected to 1 CPU n2 0 Set 0 when the word unit is selected This LK selects the source Link Unit of the three n1 11 16 Specify the number of words to be sent 2 Link station No selection UN 1 to 63 another station 2 Bit unit send selectio...

Страница 791: ...variables s2 and d have to be the same data type For Relay T C Register Constant s1 DWX DWY DWR DWL DSV DEV DDT DLD DFL s2 WX WY WR WL SV EV DT LD FL d WY WR WL SV EV DT LD FL n dec or hex Data types Operands Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output ...

Страница 792: ...Data transfer via network 791 Part III FP Instructions 23 2 Data transfer via shared memory of a MEWNET F Slave station In this section F152_RMRD see page 792 F153_RMWT see page 795 ...

Страница 793: ...list of recently used elements Specifications of s1 15 12 11 8 7 4 3 0 15 12 11 8 7 4 3 0 s1 higher word s1 lower word s1 high word s1 low word Bit Bit Bank No 16 00 to 16 FF if there is a bank to specify otherwise 16 00 Slot No 16 00 to 16 1F FP3 to 16 17 Master station No 16 01 to 16 04 Slave station No 16 01 to 16 20 Reference Intelligent unit with bank Name Order Number FP3 expansion data memo...

Страница 794: ...quest to be accepted The actual processing is carried out at the end of the scan The F152_RMRD F153_RMWT instruction completed flag R9036 can be used to confirm whether or not the instruction has been executed R9036 0 Completed normally 1 Completed with error The error code is stored in DT9036 DT90036 DT9036 DT90036 If the transmission has been completed with an error R9036 is on the contents of t...

Страница 795: ...his example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help Five words of data stored at address 0 to 4 in the shared memory of the intelligent unit of the slave station are read and the read data stored in ARRAY WordsRead of the master station CPU when Start turns on POU header All input and output variables used f...

Страница 796: ...FP32091 AFP32092 This instruction also exists as a P instruction for FP2 2SH FP3 5 FP10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list...

Страница 797: ...39 WordsWritten 8 WordsWritten 2 WordsWritten 0 WordsWritten 1 WordsWritten 7 WordsWritten 9 Power Master 1 Master 2 Master station 2 Power Slave No Intelligent unit shared memory Control data 16 2020A Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help Twenty words of data s...

Страница 798: ...Data transfer via network 797 Part III FP Instructions LD ...

Страница 799: ...Data transfer via network 798 Part III FP Instructions 23 3 Data exchange with flexible network In this section FNS_InitConfigDataTable see page 798 FNS_InitConfigNameTable see page 798 ...

Страница 800: ...ray 0 0 of WORD with size 1 Allowed data types for the input of the FNS_InitConfigDataTable are all 16 bit INT WORD 32 bit DINT DWORD TIME 32 bits REAL and 64 bit variables or arrays of them 64 bit variables are defined as 2 dimensional arrays e g Array 0 0 0 3 of INT is a 64 bit variable while Array 0 3 of INT represents an array with four elements of 16 bit variables The data types BOOL STRING a...

Страница 801: ...xample the variable ProcessData is a DUT of the type ProcessDataStructure with the following structure As the DUT has three entries the output variable ConfigData has to be an array of WORD with a size of three e g Array 0 2 of WORD ProcessData Table The following syntax table shows how to declare 16 bit 32 bit and 64 bit variables and arrays thereof when using them as ProcessDataTable input for t...

Страница 802: ...Data transfer via network 801 Part III FP Instructions LD ST When programming with structured text enter the following If sys_bIsFirstScan then ConfigData FNS_InitConfigDataTable ProcessData end_if ...

Страница 803: ...owed input data types are all 16 bit INT WORD 32 bit DINT DWORD TIME 32 bits REAL and 64 bit variables or arrays of them 64 bit variables are defined as 2 dimensional arrays e g Array 0 0 0 3 of INT is a 64 bit variable while Array 0 3 of INT represents an array with four elements of 16 bit variables The data types BOOL STRING and arrays of these types are NOT allowed at the input variable The out...

Страница 804: ... number of entries of the input variable myDUT60 As the DUT has three entries the output variable configNames1 has to be an array of WORD with a size of three e g Array 0 2 of WORD ProcessData Table The following syntax table shows how to declare 16 bit 32 bit and 64 bit variables and arrays thereof when using them as ProcessDataTable input Operands Example In this example the function is programm...

Страница 805: ......

Страница 806: ...Chapter 24 Data transfer within the PLC ...

Страница 807: ...s in the online help PLC types Availability of F0_MV see page 1320 Variable Data type Function s source 16 bit area d ANY16 destination 16 bit area The variables s and d have to be of the same data type For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Explanation with example value 16 0089 15 12 11 8 7 4 3 0 s 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 15 12 1...

Страница 808: ...and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F0_MV input_value output_value END_IF ...

Страница 809: ... recently used elements PLC types Availability of F1_DMV see page 1320 Variable Data type Function s source 32 bit area d ANY32 destination 32 bit area The variables s and d have to be of the same data type For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Explanation with example value 16 ACAEE486 31 28 27 24 23 20 19 16 15 12 10 8 ...

Страница 810: ... using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F1_DMV source destination END_IF ...

Страница 811: ...to be of the same data type For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Explanation with example value 16 5555 15 12 11 8 7 4 3 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 15 12 11 8 7 4 3 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 bit bit source dest Each bit is inverted target value in this example 16 AAAA Description The 16 bit data or 16 bit equivalent consta...

Страница 812: ...Data transfer within the PLC 811 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F2_MVN input_value output_value END_IF ...

Страница 813: ... d have to be of the same data type For Relay T C Register Constant s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Explanation with example value 16 75BCD15 s d 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1 31 28 27 24 23 20 19 16 15 12 10 8 7 4 3 0 1 1 1 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 1...

Страница 814: ...nd output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN F3_DMVN input_value output_value END_IF ...

Страница 815: ... Press Ctrl Shift v within the programming area to open the list of recently used elements Double click the I O map configuration in the project navigator for the settings required PLC types Availability of F4_GETS see page 1325 Variable Data type Function s_Slot Slot number from which the information is required d_FirstWX Number of the first WX of the specified slot d_FirstWY ANY16 Number of the ...

Страница 816: ...t III FP Instructions No IEC address Set If R9007 MX0 900 7 permanently the specified address using the index modifier exceeds a limit R9008 MX0 900 8 for an instant a number other than 0 to 31 is specified for the slot number Error flags ...

Страница 817: ...on s1 s2 ANY16 source 16 bit area d ANY32 destination 32 bit area For Relay T C Register Constant s1 s2 WX WY WR WL SV EV DT LD FL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL In this example the input variables input_value_1 and input_value_2 are declared However you can write constants directly at the input contact of the function instead Description The two 16 bit data or two 16 bit equivalent ...

Страница 818: ...Data transfer within the PLC 817 Part III FP Instructions ST When programming with structured text enter the following IF start THEN F7_MV2 input_value1 input_value2 output_value END_IF ...

Страница 819: ...RAY 0 1 of ANY32 destination lower 32 bit area of 64 bit area The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL In this example the input variables input_value_1 and input_value_2 are declared However you can write constants directly at the input contact of the function i...

Страница 820: ...Data transfer within the PLC 819 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F8_DMV2 input_value_1 input_value_2 output_value END_IF ...

Страница 821: ... to the same data area 15 12 11 8 7 4 3 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 15 12 11 8 7 4 3 0 0 0 0 1 0 1 0 0 1 1 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 source dest PLC types Availability of F10_BKMV see page 1320 Variab...

Страница 822: ...nline help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out It moves the data block starting at the 16 bit area specified by s1 and ending at the 16 bit area specified by s2 to the 16 bit area specified by d LD ST When programming with structured text...

Страница 823: ...Y WR WL SV EV DT LD FL s2_Number WX WY WR WL SV EV DT LD FL dec or hex d_Start WY WR WL SV EV DT LD FL Description The data block specified by the 16 bit starting area specified by s1_Start and the number of WORDs specified by s2_Number are copied to the block starting from the 16 bit area specified by d_Start if the trigger EN is in the ON state Data types Operands Example In this example the fun...

Страница 824: ... WY WR WL SV EV DT LD FL dec or hex Description The data block specified by the 16 bit starting area specified by s1_Start and 16 bit ending area specified by s2_End are copied to the block starting from the 16 bit area specified by the offset d_Offset from s1_Start if the trigger EN is in the ON state Data types Operands Example In this example the function is programmed in ladder diagram LD The ...

Страница 825: ... WL SV EV DT LD FL dec or hex d_Offset WY WR WL SV EV DT LD FL dec or hex Description The data block specified by the 16 bit starting area specified by s1_Start and the number of WORDs specified by s2_Number are copied to the block starting from the 16 bit area specified by the offset d_Offset from s1_Start if the trigger EN is in the ON state Data types Operands Example In this example the functi...

Страница 826: ...ction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F11_COPY see page 1320 Variable Data type Function s source 16 bit area d1_Start starting 16 bit area destination d2_End ANY16 endin...

Страница 827: ...ing languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF start THEN Copy the value 11 to data_array 3 data_array 4 and data_array 5 F11_COPY s 11 d1_Start data_array 3 d2_End data_array 5 EN...

Страница 828: ...to be written ENO BOOL When the function was executed ENO is set to TRUE Helpful at cascading functions with EN functionality For Relay T C Register Constant s1 s2 DWX DWY DWR DSV DEV DDT dec or hex d DT Description Using this instruction data will be copied from EEPROM Flash ROM to the destination area DT The copy function is carried out with blocks only Thus you can not copy single words The blo...

Страница 829: ...an 1 ms each block Less than 1 ms each block 9 94 s 1562 6 numb er of blocks s Max number of writing events Power down RUN PROG mode changes are also counted 100 000 10 000 10 000 10 000 Max read times No limit No limit No limit No limit PLC specific information Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer t...

Страница 830: ...n s1_Start starting 32 bit area to be read in extended memory s2_Number ANY32 number of words to be read d_Start ANY16 destination starting 16 bit area For Relay T C Register Constant s1_Start dec or hex s2_Num ber DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d_Start WY WR WL SV EV DT LD FL Description The data for the number of words specified by s2_Number are read from the address in the IC ca...

Страница 831: ...22 33 END_IF Write a REAL value to the IC Card IF DF Write_To_ICCard THEN F13_ICWT s1_Start Adr_Of_Var Var_Real s2_Number INT_TO_DINT Size_Of_Var Var_Real d_Start ICCardStartAdr END_IF Read a REAL value from the IC Card IF DF Read_From_ICCard THEN F12_ICRD s1_Start ICCardStartAdr s2_Number INT_TO_DINT Size_Of_Var Var_Real d_Start Adr_Of_Var Var_Real END_IF ...

Страница 832: ...art ANY16 source data starting 16 bit area s2_Number number of words to be read then written to IC card d_Start ANY32 destination area of IC card expansion memory For Relay T C Register Constant s1_Start WX WY WR WL SV EV DT LD FL s2_Number DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d_Start dec or hex Description The data for the number of words specified by s2_Number are read from the address...

Страница 833: ...22 33 END_IF Write a REAL value to the IC Card IF DF Write_To_ICCard THEN F13_ICWT s1_Start Adr_Of_Var Var_Real s2_Number INT_TO_DINT Size_Of_Var Var_Real d_Start ICCardStartAdr END_IF Read a REAL value from the IC Card IF DF Read_From_ICCard THEN F12_ICRD s1_Start ICCardStartAdr s2_Number INT_TO_DINT Size_Of_Var Var_Real d_Start Adr_Of_Var Var_Real END_IF ...

Страница 834: ...a storing program For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL Description When the execution criterion of F P14_PGRD is turned ON the execution proceeds until the END The program subsequently switches to the program specified by s Data types Operands Example In this example the same POU header is used for all programming languages For an example using IL instruction list please re...

Страница 835: ...to hold your profile data such as positioning parameters or any other parameter values that are changed infrequently you will find this instruction very useful PLC types Availability of P13_EPWT see page 1329 One of the two input variables s2 or d has to be assigned constant number value Variable Data type Function EN BOOL Activation of the function when EN changes from FALSE to TRUE the function ...

Страница 836: ...s than 1 ms each block Less than 1 ms each block 9 94 s 1562 6 numb er of blocks s Max number of writing events Power down RUN PROG mode changes are also counted 100 000 10 000 10 000 10 000 Max read times No limit No limit No limit No limit PLC specific information Example In this example the same POU header is used for all programming languages For an example using IL instruction list please ref...

Страница 837: ...ge 1321 Variable Data type Function d1 16 bit area to be exchanged with d2 d2 ANY16 16 bit area to be exchanged with d1 The variables d1 and d2 have to be of the same data type For Relay T C Register Constant d1 d2 WY WR WL SV EV DT LD FL Description The contents in the 16 bit areas specified by d1 and d2 are exchanged if the trigger EN is in the ON state Data types Operands Example In this exampl...

Страница 838: ...ithin the programming area to open the list of recently used elements PLC types Availability of F16_DXCH see page 1321 Variable Data type Function d1 32 bit area to be exchanged with d2 d2 ANY32 32 bit area to be exchanged with d1 The variables d1 and d2 have to be of the same data type For Relay T C Register Constant d1 d2 DWY DWR DWL DSV DEV DDT DLD DFL Description Two 32 bit data specified by d...

Страница 839: ...Data transfer within the PLC 838 Part III FP Instructions ST When programming with structured text enter the following IF start THEN F16_DXCH value_1 value_2 END_IF ...

Страница 840: ...t v within the programming area to open the list of recently used elements PLC types Availability of F17_SWAP see page 1322 Variable Data type Function d ANY16 16 bit area in which the higher and lower bytes are swapped exchanged For Relay T C Register Constant d WY WR WL SV EV DT LD FL Description The higher byte higher 8 bits and lower bytes lower 8 bits of a 16 bit area specified by d are excha...

Страница 841: ...Data transfer within the PLC 840 Part III FP Instructions ST When programming with structured text enter the following IF start THEN F17_SWAP swap_value END_IF ...

Страница 842: ...rl Shift v within the programming area to open the list of recently used elements PLC types Availability of F18_BXCH see page 1322 Variable Data type Function d1_Start starting 16 bit area of block data 1 d2_End ending 16 bit area of block data 1 d3_Start ANY16 starting 16 bit area of block data 2 For Relay T C Register Constant d1_Start d2_End d3_Start WY WR WL SV EV DT LD FL No IEC address Set I...

Страница 843: ... and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out It exchanges the data of ARRAY data_field_1 from the 2nd to the 5th element with the data of ARRAY data_field_2 from the 3rd element on LD ST When programming with structured text enter the following IF start THEN F18_BXCH d1_Start d1...

Страница 844: ...Start starting word address and d2_End ending word address immediately after the trigger turns ON even in the program execution stage With the FP0 and FP refreshing initiated by the IORF command is done only for the control unit If d1_Start and d2_End are variables and not constants then the compiler automatically accesses the variables values via the index register With input refreshing WX0 shoul...

Страница 845: ...eader is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start changes from FALSE to TRUE the function is carried out To update WX10 and WY10 based on the master I O map configuration set d1 10 and d2 10 LD ST When programming with structured text enter the following PLCs wit...

Страница 846: ...PR see page 1321 Variable Data type Function s ANY16 starting 16 bit area for storing 12 bytes 6 words of ASCII codes source d WORD word external output relay used for output of ASCII codes destination For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL d WY No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the ending area for storing ASCII codes exceeds the...

Страница 847: ...5 Y4 Y3 Y2 Y1 Y0 H CR PrintOutString Source ASCII code for 12 characters A B C D E F G H I and J ASCII HEX code ASCII character Control data for printer ASCII codes start ON Destination Y0 to YF for data signals of printer Y0 to Y7 correspond to DA A1 to DA A8 of printer Y8 for strobe signal of printer Y9 to YF not used Example In this example the function is programmed in ladder diagram LD The sa...

Страница 848: ...ransfer within the PLC 847 Part III FP Instructions Body LD ST When programming with structured text enter the following IF DF start OR PrintOutFlag THEN F147_PR Adr_Of_VarOffs PrintOutString 2 Printer END_IF ...

Страница 849: ... specified by s2 and are stored in the area specified by d of the CPU The number of variable arguments at the inputs is limited by the available index registers of the PLC Specifying s1 Intelligent unit without bank Specify the slot number in which the target intelligent unit has been installed 16 00 s1 Upper byte Lower byte Slot No 16 00 to 16 1F Intelligent unit with bank Specify the slot number...

Страница 850: ...er Constant s1 WX WY WR WL SV EV DT LD FL dec or hex s2 WX WY WR WL SV EV DT LD FL dec or hex n WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant s1 exceeds the limit of specified range the data read exceeds the area of d Data types Operands Error flags Example In this example the function has been progr...

Страница 851: ...y Reads 4 words of data stored in the addresses starting from 19 specified in AddrDataToRead of the intelligent unit s shared memory located in slot 3 Then it stores them in the array DestAddrCPU when Start turns on LD ST When programming with structured text enter the following IF start THEN F150_READ s1_BankSlot SlotNo s2_Start AddrDataToRead n_Number NoWordsToRead d_Start DestAddrCPU 0 END_IF ...

Страница 852: ...f the shared memory of the intelligent unit specified by s1 The number of variable arguments at the inputs is limited by the available index registers of the PLC Specifying s1 Intelligent unit without bank Specify the slot number in which the target intelligent unit has been installed 16 00 s1 Upper byte Lower byte Slot No 16 00 to 16 1F Intelligent unit with bank Specify the slot number hex const...

Страница 853: ...hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant s1 exceeds the limit of specified range the data read exceeds the area of d Five words of data defined in CPUDataToWrt are written into the addresses starting from 0 to 4 of the intelligent unit s shared memory located in slot 0 when Start turns on 0 1 2 3 4 CPU 0 2 1 3 4 5 6 CPU rt 0 CPUDataToW CPUDataToWrt 1 CPU...

Страница 854: ... the PLC 853 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F151_WRT s1_BankSlot SlotNo s2_Start CPUDataToWrt 0 n_Number NoWordsToWrite d_Start DestinationAddr END_IF ...

Страница 855: ...page 815 or P7_MV2 instruction Variable Data type Function s1 s2 s3 ANY16 source 16 bit area d ARRAY 0 2 of ANY16 destination lower 16 bit area of 48 bit area The variables s1 s2 and d have to be of the same data type For Relay T C Register Constant s1 s2 s3 WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL dec or hex The function copies three 16 bit data values at inputs s1 s2 and s...

Страница 856: ...Data transfer within the PLC 855 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F190_MV3 word_1 word_2 word_3 data_field END_IF ...

Страница 857: ...DMV2 instruction Variable Data type Function s1 s2 s3 ANY32 source 32 bit area d ARRAY 0 2 ofANY32 destination lower 32 bit area of 96 bit area The variables s1 s2 s3 and d have to be of the same data type For Relay T C Register Constant s1 s2 s3 DWX DWY DWR DWL DSV DEV DDT DLD DFL dec or hex d DWY DWR DWL DSV DEV DDT DLD DFL Description The function copies three 32 bit data values at inputs s1 s2...

Страница 858: ...Data transfer within the PLC 857 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN F191_DMV3 word_1 word_2 word_3 data_field END_IF ...

Страница 859: ... F309_FMV see page 1324 This instruction cannot be programmed in the interrupt program Variable Data type Function s Floating point constant Floating point data 32 bits source d REAL 32 bit area for result destination For Relay T C Register Constant d DWY DWR DWL DSV DEV DDT DLD DFL Description The floating point data 32 bits specified by s is copied to the 32 bit area specified by d when the trig...

Страница 860: ... the following syntax sys_ _system variable b w dw i di BOOL WORD DWORD INT DINT You can insert these system variables into the body via the Variables dialog Tip Set the class filter to System Variables to display system variables only In addition these system variables are also displayed under Monitor Special Relays and Registers as the last entries in the comments e g sys_w_HSC_ControlFlags Exam...

Страница 861: ...nsfer within the PLC 860 Part III FP Instructions 24 2 Transferring data to and from file register banks 1 or 2 In this section ReadDataFromFileRegisterBank see page 861 WriteDataToFileRegisterBank see page 863 ...

Страница 862: ...ad from the file register bank DataStartAddress ANY16 Specifies the start address of data which is read from the file register bank For Relay T C Register Constant BankN umber WX WY WR WL DT LD FL dec or hex BankO ffset WX WY WR WL DT LD FL dec or hex DataN umber OfWor ds WX WY WR WL DT LD FL DataSt artAdd ress WX WY WR WL DT LD Description This instruction reads the number of words specified by D...

Страница 863: ...uctions LD ST When programming with structured text enter the following if DF bGetData then ReadDataFromFileRegisterBank BankNumber 2 BankOffset 1000 DataNumberOfWords Size_Of_Var awProcessDataToGet DataStartAddress Adr_Of_Var awProcessDataToGet end_if ...

Страница 864: ...Offset INT Specifies bank number offset DataStartAddress ANY16 Specifies start address of data to be written to File Register Bank DataNumberOfWords INT Specifies number of word units to be written to File Register Bank For Relay T C Register Const ant BankNum ber WX WY WR WL DT LD FL dec or hex BankOffse t WX WY WR WL DT LD FL dec or hex DataStart Address WX WY WR WL DT LD DataNumb erOfWord s WX ...

Страница 865: ...Store a DUT containing 11 elements is filled with the data from File Register Bank 2 BankOffset 1000 LD ST When programming with structured text enter the following if DF bStoreData then WriteDataToFileRegisterBank BankNumber 2 BankOffset 1000 DataStartAddress Adr_Of_Var awProcessDataToStore DataNumberOfWords Size_Of_Var awProcessDataToStore end_if ...

Страница 866: ...Chapter 25 Date and time instructions ...

Страница 867: ...rom the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F138_TIMEBCD_TO_SECBCD see page 1321 Variable Data type Function s_TIMEBCD DWORD source area for storing hours minutes and seconds data d_S...

Страница 868: ...truction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F139_SECBCD_TO_TIMEBCD see page 1321 Variable Data type Function s_SECBCD DWORD source area for storing seconds data d_TIME_BCD D...

Страница 869: ... if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Example 1 clock calendar data in DTBCD format DUT Member Result MinSec 16 2331 minutes seconds DayHour 16 0114 day hour August 1 1992 Time 14 23 31 hours minutes seconds YearMon 16 9208 year...

Страница 870: ...d time and date values in BCD format s2_TIMEBCD DWORD addend 32 bit area for storing time data in BCD format d_DTBCD DTBCD sum in BCD format For Relay T C Register Const s1_DTBCD WX WY WR WL SV EV DT LD FL s2_TIMEBCD WY WR WL SV EV DT LD FL d_DTBCD WX WY WR WL SV EV DT LD FL dec or hex Data types Operands ...

Страница 871: ...n the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements Example 1 clock calendar data in DTBCD format DUT Member Result MinSec 16 2331 minutes seconds DayHour 16 0114 day hour August 1 1992 Time 14 23 31 hour minutes seconds YearMon 16 9208 year month Example 2 time data in TIMEBCD format 32 hours 50 minutes and 45 seconds 16 00325045 hex hours m...

Страница 872: ... and time instructions 871 Part III FP Instructions For Relay T C Register Const s1_DTBCD WX WY WR WL SV EV DT LD FL s2_TIMEBCD WY WR WL SV EV DT LD FL d_DTBCD WX WY WR WL SV EV DT LD FL dec or hex Operands ...

Страница 873: ...C types Availability of F230_DTBCD_TO_SEC see page 1323 Variable Data type Function s_DTBCD DTBCD Area in which the input time data is stored d_SEC ANY32 Area in which the converted second information is stored 32 bits For Relay T C Register Constant s_DTBCD WX WY WR WL SV EV DT LD FL d_SEC WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant the...

Страница 874: ...rea to open the list of recently used elements PLC types Availability of F231_SEC_TO_DTBCD see page 1323 Variable Data type Function s_SEC ANY32 Area in which the number of seconds are stored 32 bits d_DTBCD DTBCD Head area in which time data is stored For Relay T C Register Constant s_SEC WX WY WR WL SV EV DT LD FL d_DTBCD WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently ...

Страница 875: ...r press Ctrl Shift v in the programming window Description Use this PLC independent instruction to read the real time clock data from the PLC When the instruction is carried out the values from the special data registers DT90054 to DT90056 DT9054 to DT9056 are transferred to the data unit type DTBCD You can also use the system variables to set the RTC For detailed information on using system varia...

Страница 876: ...d is set to TRUE the values from the data unit type DTBCD are transferred to the special data registers DT90054 to DT90056 DT9054 to DT9056 and the value 16 8000 is written to the special data register DT90058 DT9058 to set the real time clock of the PLC You can also use the system variables to set the RTC For detailed information on using system variables please refer to data transfer to and from...

Страница 877: ......

Страница 878: ...Chapter 26 Selection Instructions ...

Страница 879: ... PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F285_LIMT see page 1323 Variable Data t...

Страница 880: ...ad Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The constant 0 lower limit and 2000...

Страница 881: ...10 10SH PLC types which is only executed at the rising edge of the EN trigger Select Insert P instruction from the Instructions pane if you require a P instruction To facilitate reuse the instruction then appears under Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F286_DLIMT see page 1323 Variabl...

Страница 882: ... Operands Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out The constant 123456 lower limit and 6...

Страница 883: ......

Страница 884: ...Chapter 27 Edge detection instructions ...

Страница 885: ...3 LOOP see page 1012 to LBL see page 1013 Variable Data type input BOOL output BOOL For Relay T C Register Constant i X Y R L T C o Y R L Description DF is a rising edge differential instruction The DF instruction executes and turns ON output o for a singular scan duration if the trigger i changes from an OFF to an ON state Data types Operands Example In this example the function has been programm...

Страница 886: ...1010 to LBL see page 1013 LOOP see page 1012 to LBL see page 1013 Variable Data type input BOOL output BOOL For Relay T C Register Constant i X Y R L T C o Y R L Description The DFN instruction executes and turns ON output o for a single scan duration if the trigger i changes from an ON to an OFF state Data types Operands Example In this example the function has been programmed in ladder diagram L...

Страница 887: ...h commands that effect the order in which a program is carried out e g jump or loop instructions within a sequential function chart or a function block The order of the instructions might change depending on the time when the instruction is carried out or the input value Specific basic JUMP and LOOP instructions are MC see page 1007 to MCE see page 1008 JP see page 1009 to LBL see page 1013 F19_SJ...

Страница 888: ...or all programming languages For an example using IL instruction list please refer to the online help POU header In the POU header all input and output variables are declared that are used for programming this function LD ST When programming with structured text enter the following output_value DFI input_value ...

Страница 889: ...ic basic JUMP and LOOP instructions are MC to MCE instruction JP to LBL instruction F19_SJP to LBL instruction LOOP to LBL instruction Variable Data type input BOOL output BOOL For Relay T C Register Constant i X Y R L T C o Y R L Description The function inverts the output condition output o each time the rising edge of the input signal input i is detected Time chart X0 Y10 Invert Invert Invert O...

Страница 890: ...Chapter 28 High speed counter instructions ...

Страница 891: ...e for beginners or users familiar with FPWIN GR Most of the information which is accessible via information and control functions is stored in special internal relays and special data registers These relays and registers can also be accessed using PLC independent system variables To take advantage of the features you prefer the instructions of both libraries can be mixed NOTE When programming with...

Страница 892: ... can be monitored using the system variables sys_wHscChannelxControlCode or sys_wPulseChannelxControlCode where x channel number The settings of this system variable remain unchanged until another setting operation is executed Description for FP FP X FP0R Bits 0 15 of the control code are allocated in groups of four The bit setting in each group is represented by a hex number e g 0002 0000 0000 10...

Страница 893: ...e to 0 bit 0 4 0 no 1 yes Example 16 90 Group Value Description IV 0 III 0 Channel number 1 Hex 9 corresponds to binary 1001 Clear high speed counter instruction clear bit 3 1 Reset input enabled bit 2 0 Count permit bit 1 0 II 9 Reset elapsed value to 0 yes bit 0 1 I 0 Turning the reset input to TRUE sets the elapsed value to 0 Use the reset input setting bit 2 to disable the reset input allocate...

Страница 894: ...ust after that in step 2 to start counting A reset alone does not start counting POU header FP FP X FP0R All input and output variables used for programming this function have been declared in the POU header Body The reset is performed in step 1 and 0 is entered just after that in step 2 to start counting A reset alone does not start counting LD ...

Страница 895: ...rst example shows how to write an initial value elapsed value into the high speed counter The second example shows how to read an elapsed value and copy it to a variable All input and output variables used for programming this function have been declared in the POU header Body An initial value of 3000 elapsed value is written into channel 0 of the high speed counter LD POU header All input and out...

Страница 896: ...arget value 3 3 Output relay 0 4 4000 Target value 2 2000 Target value 1 Whenever the elapsed value is in the target value area n to n 1 incremental counting or n 1 to n decremental counting the corresponding output relay n is TRUE In the example above maximum target value control has been enabled When the elapsed value reaches the maximum target value the elapsed value is reset to 0 and counting ...

Страница 897: ...get value counting continues and the elapsed value is not reset to 0 8000 4000 4000 10000 t ms y 1 2 0 1 2 3 4 3 INT0 y Elapsed value of high speed counter 8000 Target value 4 1 Execution condition 4000 Target value 3 2 High speed counter control flag 4000 Target value 2 3 Output relay 0 4 10000 Target value 1 INT0 Interrupt program 0 Maximum target value control The instruction can be executed us...

Страница 898: ... to 0 When the elapsed value reaches the last target value the pointer returns to target value 1 output relay 0 turns to TRUE the elapsed value continues to increment and restarts at the minimum value of the ring counter Decremental counting The pointer of the data table moves from the last target value to target value 1 When the elapsed value reaches the value 1 the pointer returns to the last ta...

Страница 899: ...the main program make sure the minimum time span between adjacent target values is greater than the scan time If the instruction is executed in an interrupt program make sure the minimum time span between adjacent target values is greater than the maximum execution time of the interrupt program This instruction can be executed simultaneously on a maximum of two channels When using a reset input or...

Страница 900: ... arranged in ascending order Example 1 With maximum target value control The DUT F165_HighSpeedCounter_Cam_8_Values_DUT is predefined in the FP Library and can be used as a sample Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST DUT GVL In the global variable list you define variables that can be accessed by all POUs in the p...

Страница 901: ...programmed in ladder diagram LD and structured text ST DUT The DUT F165_HighSpeedCounter_Cam_8_Values_DUT is predefined in the FP Library and can be used as a sample POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable bStartCam is set to TRUE the function is carried out LD ST When programming with structured text ...

Страница 902: ...fied that has not been implemented only the internal memory of the corresponding WY address is set or reset Interrupt operation The interrupt program will be executed when the elapsed value matches the target value Any interrupt that has been entered into the Tasks list is automatically enabled Channels used by interrupt programs PLC type FP0 FP e FP FP X Relay types FP X Transistor types FP0R Int...

Страница 903: ...on is executed both the high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag e g sys_bIsPulseChannel0Active for the channel used are TRUE No other high speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE If both the main program and the interrupt program contain code for the same channel make sure both ...

Страница 904: ... Register Constant n_diHscChannel dec or hex s_diTargetValue DWX DWY DWR DSV DEV DDT d_Y Y No IEC address Set If R9007 MX0 900 7 ON R9008 MX0 900 8 ON channel number or values of the data table are outside the permissible range high speed counter has not been set in the system registers Data types Operands Error flags Example In this example the function has been programmed in ladder diagram LD an...

Страница 905: ...the input variable e g Monitor Monitor Header click the variable enter the value press Enter or replace the input variables with numbers LD ST When programming with structured text enter the following IF DF start THEN F166_HighSpeedCounter_Set n_diHscChannel 0 s_diTargetValue 10 d_Y out_0 ...

Страница 906: ...d that has not been implemented only the internal memory of the corresponding WY address is set or reset Interrupt operation The interrupt program will be executed when the elapsed value matches the target value Any interrupt that has been entered into the Tasks list is automatically enabled A special interrupt program number is assigned to each channel number Channels used by interrupt programs P...

Страница 907: ...on or a pulse output instruction is executed both the high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag e g sys_bIsPulseChannel0Active for the channel used are TRUE No other high speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE If both the main program and the interrupt program contain code for th...

Страница 908: ...egister Constant n_diHscChannel dec or hex s_diTargetValue DWX DWY DWR DSV DEV DDT d_Y Y No IEC address Set If R9007 MX0 900 7 ON R9008 MX0 900 8 ON channel number or values of the data table are outside the permissible range high speed counter has not been set in the system registers Data types Operands Error flags Example In this example the function has been programmed in ladder diagram LD and ...

Страница 909: ...hSpeedCounter_Reset n_diHscChannel 0 s_diTargetValue 200 d_Y out_0 Assign a number to the input variable e g Monitor Monitor Header click the variable enter the value press Enter or replace the input variables with numbers When programming with structured text enter the following END_IF ...

Страница 910: ...rement has not been completed the measured pulse period is set to 1 General programming information Select the high speed counter input for the desired channel in the system registers Keep the execution condition TRUE for pulse measurement using this instruction To stop the measurement turn the execution condition to FALSE When a high speed counter instruction is executed the high speed counter co...

Страница 911: ...iTimeoutValueOf1ms UnitOutput INT 1 100ms 2 200ms 3 300ms 4 500ms 6 1s 7 2s 8 10s 9 60s d_NumberOfPulses_diAverage DINT Average number of pulses per counting period no of pulses in counting period number of counting periods d_PulsePeriod_diTime_ s DINT Pulse period s For Relay T C Register Constant s1_iHscC hannel WX WY WR WL SV EV DT LD FL dec or hex s1 s2 inputs WX WY WR WL SV EV DT LD FL dec or...

Страница 912: ...have been declared in the POU header LD ST When programming with structured text enter the following IF bStartMeasurement THEN F178_HighSpeedCounter_Measure s1_iHscChannel 0 s2_NumberOfPulses_iPeriodTime_ms 10 s1_NumberOfPulses_iNumberOfPeriods 5 s1_PulsePeriod_iMeasurementMethod SYS_F178_HSC_MEASUREMENT_ s_ms s1_PulsePeriod_iTimeoutValueOf1msUnitOutput 0 d_NumberOfPulses_diAverage diNumberOfPulse...

Страница 913: ......

Страница 914: ...Chapter 29 Timer instructions ...

Страница 915: ...s limited and depends on the settings in the system registers 5 and 6 The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 a...

Страница 916: ...are used for programming the function block TM_1ms_FB are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under Alarm_Control and a separate data area is reserved Body As soon the variable Start_contact becomes TRUE the timer Alarm_control will be started The variable EV of the timer is set to th...

Страница 917: ...tructured text enter the following Alarm_Control start Start_Contact SV 1000 T Alarm_Relay_2 EV Alarm_Control EV The ON delay time is 1000ms Alarm_Relay_1 Alarm_Control EV 500 Alarm_Control EV 0 Alarm_Relay_1 is set to TRUE after 500ms Alarm_Relay_1 is set to TRUE after 500ms ...

Страница 918: ...is limited and depends on the settings in the system registers 5 and 6 The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 ...

Страница 919: ...header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under Alarm_Control and a separate data area is reserved This example uses variables You may also use constants for the input variables Body As soon the variable Start_contact becomes TRUE the timer Alarm_control will be started The variable EV of the timer is set to t...

Страница 920: ...with structured text enter the following Alarm_Control start Start_Contact SV 1000 T Alarm_Relay_2 EV Alarm_Control EV The ON delay time is 10s Alarm_Relay_1 Alarm_Control EV 500 Alarm_Control EV 0 Alarm_Relay_1 is set to TRUE after 5s Alarm_Relay_1 is set to TRUE after 5s ...

Страница 921: ... is limited and depends on the settings in the system registers 5 and 6 The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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...

Страница 922: ...re used for programming the function block TM_100ms_FB are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under Alarm_Control and a separate data area is reserved Body As soon the variable Start_contact becomes TRUE the timer Alarm_control will be started The variable EV of the timer is set to t...

Страница 923: ... with structured text enter the following Alarm_Control start Start_Contact SV 100 T Alarm_Relay_2 EV Alarm_Control EV The ON delay time is 10s Alarm_Relay_1 Alarm_Control EV 50 Alarm_Control EV 0 Alarm_Relay_1 is set to TRUE after 5s Alarm_Relay_1 is set to TRUE after 5s ...

Страница 924: ...limited and depends on the settings in the system registers 5 and 6 The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 ...

Страница 925: ...hich are used for programming the function block TM_1s_FB are declared in the POU header This also includes the function block FB itself By declaring the FB you create a copy of the original FB This copy is saved under Alarm_Control and a separate data area is reserved Body As soon the variable Start_contact becomes TRUE the timer Alarm_control will be started The variable EV of the timer is set t...

Страница 926: ...g with structured text enter the following Alarm_Control start Start_Contact SV 10 T Alarm_Relay_2 EV Alarm_Control EV The ON delay time is 10s Alarm_Relay_1 Alarm_Control EV 5 Alarm_Control EV 0 Alarm_Relay_1 is set to TRUE after 5s Alarm_Relay_1 is set to TRUE after 5s ...

Страница 927: ...V from the SV During the timing operation the time is subtracted from the EV The scan time is also subtracted from the EV in the next scan The timer contact T turns ON when the EV becomes 0 Calculation of the timing operation timing operation time set value 0 to 1 2 of units 0 5ms scan time Example 150ms time set value and 8ms PLC scan time Upper limit 150 0 8 158ms Lower limit 150 0 5 8 157 5ms T...

Страница 928: ...registers 5 and 6 Timer of type TM_1s TM_100ms TM_10ms TM_1ms use the same Num address range The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 counti...

Страница 929: ...V from the SV During the timing operation the time is subtracted from the EV The scan time is also subtracted from the EV in the next scan The timer contact T turns ON when the EV becomes 0 Calculation of the timing operation timing operation time set value 0 to 1 4 of units 2 5ms scan time Example 150ms time set value and 8ms PLC scan time Upper limit 150 0 8 158ms Lower limit 150 2 5 8 155 5ms T...

Страница 930: ...registers 5 and 6 Timer of type TM_1s TM_100ms TM_10ms TM_1ms use the same Num address range The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 counti...

Страница 931: ... is transferred to the EV from the SV During the timing operation the time is subtracted from the EV The scan time is also subtracted from the EV in the next scan The timer contact T turns ON when the EV becomes 0 Calculation of the timing operation timing operation time set value 0 to 1 4 of units 25ms scan time Example 1500ms time set value and 8ms PLC scan time Upper limit 1500 0 8 1508ms Lower...

Страница 932: ...egisters 5 and 6 Timer of type TM_1s TM_100ms TM_10ms TM_1ms use the same Num address range The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 countin...

Страница 933: ...m the SV During the timing operation the time is subtracted from the EV The scan time is also subtracted from the EV in the next scan The timer contact T turns ON when the EV becomes 0 Calculation of the timing operation timing operation time set value 0 to 1 4 of units 250ms scan time Example 150s time set value and 8ms PLC scan time Upper limit 150000 0 8 150008ms Lower limit 150000 250 8 149758...

Страница 934: ... registers 5 and 6 Timer of type TM_1s TM_100ms TM_10ms TM_1ms use the same Num address range The system timer functions TM_1s TM_100ms TM_10ms and TM_1s use the same NUM address area as the system timer function 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 count...

Страница 935: ... timer set value d ANY16 16 bit area for timer elapsed value The variables s and d have to be of the same data type For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL dec or hex d WY WR WL SV EV DT LD FL Description The auxiliary timer instruction F137_STMR is a down type timer The formula of the timer set time is 0 01 sec set value s time can be set from 0 01 to 327 67 sec If you use th...

Страница 936: ...instruction activates an upward counting 32 bit timer which works on delayed The smallest counting unit is 0 01s During execution of F183 start TRUE elapsing time is added to the elapsed value d The timer output will be enabled when the elapsed value d equals the set value s If the start condition start is set to FALSE execution will be interrupted and the elapsed value d will be reset to zero The...

Страница 937: ......

Страница 938: ...Chapter 30 Process control instructions ...

Страница 939: ...lue e set value measured value With the parameters given proportional gain Kp integral time Ti a new output value MV is calculated in increments set by the sampling time Ts This result is then applied to the actuator e g a fan that regulates room temperature after the D A conversion The analog section represents the system s actuator e g heater and temperature regulation of a room A PID operation ...

Страница 940: ...alue SP Standard tolerance e Measurement signal PV Integral operation Output MVi 0 t e 0 t MVi MVi 1 Ti edt 3 Derivative part D part The derivative part produces an output quantity that corresponds to the time derivation of the input quantity The derivative time corresponds to the weighting of the derived input quantity A derivative component can be an RC bleeder capacitor hooked up in series and ...

Страница 941: ...t value SP Standard tolerance e Measurement signal PV Integral operation Derivative operation Output MV Reference equations for calculating the controller output MV The following equations are used to calculate the controller output MV under the following conditions In general The output value at time period n is calculated from the previous output value n 1 and the change in the output value in t...

Страница 942: ...instructions 941 Part III FP Instructions Reverse operation I PD Control 16 X002 Forward operation I PD Control 16 X003 PID processing instructions PID_FB_DUT see page 953 PID_FB see page 951 F355_PID_DUT see page 941 ...

Страница 943: ...e Unit SP Set point value 0 10000 PV Process value 0 10000 MV Manipulated value 0 10000 LowerLimit MV lower limit 0 10000 UpperLimit MV upper limit 1 10000 Kp Proportional gain 1 9999 0 1 Ti Integral time 1 30000 0 1s Td Derivative time 1 10000 0 1s Ts Sampling time 1 6000 0 01s AT_Progress INT Auto tuning progress 0 5 Dummies ARRAY 11 30 OF WORD are utilized internally by the PID controller PLC t...

Страница 944: ...set to 4000 The proportional gain Kp is initially set at 80 8 Ti and Td at 200 20s and the sampling time Ts at 100 1s Error flags Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help GVL In the global variable list you define variables that can be accessed by all POUs in the project POU header All...

Страница 945: ... an EN output connected directly to the power rail the function is carried out when the PLC is in RUN mode The calculated controller output stored by the member MV of the DUT PidParameters is assigned to the variable Output_Value_MV Its value is returned via a D A converter from the PLC to the output of the system LD ST When programming with structured text enter the following Auto Tuning if DF En...

Страница 946: ...rite the values into the DUT using a MOVE instruction for example which must be triggered continuously by a TRUE condition 2 F356_PID_PWM must be executed once and only once per scan Therefore do not execute F356_PID_PWM in interrupt programs or loops 3 Do not turn the execution condition to FALSE during PID processing Otherwise PID processing will be disabled 4 If you do not want parallel PWM out...

Страница 947: ...EV DT LD FL Parameters WX WY WR WL SV EV DT LD FL Process Values WY WR WL SV EV DT LD FL No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant any parameter of F356_Parameters_NonHold_DUT is out of range R900B MX0 900 11 permanently the area specified with UpperLimit or LowerLimit is out of range Detailed information Control conditions F356_Parameters_Hold_DUT see page 9...

Страница 948: ...b1_AT_Complete of ControlData is set and Kp Ti and Td are set for the PID control If bRunPidControl is still on it will change to PID control automatically and the PWM output will be executed If the execution condition bRunPidControl has turned to FALSE during PID control PWM_Output also turns off However only the member MV manipulated value can be held depending on the status of the flag b2_HoldM...

Страница 949: ...bit 3 FALSE to use PWM control TRUE to use an analog output unit for output In this case transmit the output value F356_Parameters_NonHold_DUT MV to WY of an analog output unit b4_UseReducedInter nalOutputRange bit 4 When FALSE the maximum value of the internal output is the output upper limit value 20 of the output range output upper limit value output lower limit value and the minimum value is t...

Страница 950: ...000 0 1000s If the parameters Kp Ti and Td are all 0 when PID operation has started they are initialized at 1 1 and 0 respectively and operation continues If any of the parameters Kp Ti or Td is out of range when auto tuning has started they are initialized at 1 1 and 0 respectively and auto tuning continues F356_Parameters_NonHold_DUT This data type is predefined in the FP Library and is used by ...

Страница 951: ...MV is only output in the range of the specified upper and lower limit Detailed information on the setting method PV_Band_WithFullOutput Define the percentage of the set point value at which PID control should start Below this level output is at 100 For example if PV_Band_WithFullOutput is set to 80 and the measured value process value PV is only at 50 of the set value the output will be at 100 It ...

Страница 952: ...ature rise during auto tuning In forward operation SP is the sum of the set point value SP and the auto tuning bias value SP SP Set value SP Temperature Auto tuning bias value Auto tuning in reverse operation Auto tuning in forward operation Temperature Set value SP Auto tuning bias value During auto tuning During auto tuning PID control PID control Time Time KP TI and TD calculation KP TI and TD ...

Страница 953: ...Derivative time range 1 10000 unit 0 1s Ts Sampling time range 1 6000 unit 0 01s LowerLimit MV lower limit range 0 10000 UpperLimit INT MV upper limit range 1 10000 Input output variable VAR_IN_OUT MV Manipulated value Auto tuning is not possible using PID_FB For this use PID_FB_DUT see page 953 The value for MV can be assigned externally either when the program is initialized or when the value of...

Страница 954: ... and output values are declared that are used to program the function The addresses are depending on the respective PLC Type POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following PID_Control Automatic TRUE Forward FALSE I_PD FALSE SP Set_Value_SP PV Process_Value_PV Kp 15 Ti ...

Страница 955: ...ly either when the program is initialized or when the value of Automatic is FALSE In order to achieve maximum resolution and minimum dead time beyond LowerLimit and UpperLimit these values should if possible cover the entire range of 0 10000 Description This implementation allows you to access the F355_PID instruction via the structure PID_DUT Data types Example In this example the function has be...

Страница 956: ... Part III FP Instructions Output_Value_MV PID_Parameter MV LD ST When programming with structured text enter the following PID_Parameter SP Set_Value_SP PID_Parameter PV Process_Value_PV PID_Control Automatic TRUE PidDut PID_Parameter ...

Страница 957: ...perLimit Output value assigned to the upper limit of the input range can be lower than iOutputLowerLimit Output variable INT Scaled output signal Description This instruction scales an INTEGER value between a lower and an upper limit to an INTEGER output value Use WITHIN_LIMITS see page 111 to check if the input value is within the specified limits Data types Example In this example the function h...

Страница 958: ... Part III FP Instructions ST When programming with structured text enter the following if bScale then SCALE_INT iInput iInput iInputLowerLimit 50 iInputUpperLimit 1000 iOutputLowerLimit 40 iOutputUpperLimit 2000 iOutput iOutput end_if ...

Страница 959: ...it uiOutputUpperLimit Output value assigned to the lower limit of the input range can be higher than uiOutputUpperLimit Output variable UINT Scaled output signal Description This instruction scales an INTEGER value between a lower and an upper limit to an unsigned INTEGER output value Use WITHIN_LIMITS see page 111 to check if the input value is within the specified limits Data types Example In th...

Страница 960: ...t III FP Instructions ST When programming with structured text enter the following if bScale then SCALE_INT_UINT iInput iInput iInputLowerLimit 50 iInputUpperLimit 1000 uiOutputLowerLimit 0 uiOutputUpperLimit 2000 uiOutput uiOutput end_if ...

Страница 961: ...utput value assigned to the lower limit of the input range can be higher than rOutputUpperLimit Output variable REAL Scaled output signal Description This instruction scales a REAL value between a lower and an upper limit to a REAL output value Use WITHIN_LIMITS see page 111 to check if the input value is within the specified limits Data types Example In this example the function has been programm...

Страница 962: ...FP Instructions ST When programming with structured text enter the following if bScale then SCALE_REAL rInput rInput rInputLowerLimit 245 25 rInputUpperLimit 123456 56 rOutputLowerLimit 147 25 rOutputUpperLimit 258369 25 rOutput rOutput end_if ...

Страница 963: ... Output value assigned to the upper limit of the input range can be lower than uiOutputLowerLimit Output variable UINT Scaled output signal Description This instruction scales an unsigned INTEGER value between a lower and an upper limit to an unsigned INTEGER output value Use WITHIN_LIMITS see page 111 to check if the input value is within the specified limits Data types Example In this example th...

Страница 964: ...II FP Instructions ST When programming with structured text enter the following if bScale then SCALE_UINT uiInput uiInput uiInputLowerLimit 123 uiInputUpperLimit 45678 uiOutputLowerLimit 321 uiOutputUpperLimit 65535 uiOutput uiOutput end_if ...

Страница 965: ...caled output signal Description This instruction scales an unsigned INTEGER value between a lower and an upper limit to an INTEGER output value Use WITHIN_LIMITS see page 111 to check if the input value is within the specified limits Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming langua...

Страница 966: ...Process control instructions 965 Part III FP Instructions ...

Страница 967: ...k it may be neither initialized nor written in the body Output variable iOut INT Output signal Description This instructions uses a 1st order delay time tT1 to smooth the INTEGER input value at iIN Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output ...

Страница 968: ...ock it may be neither initialized nor written in the body Output variable rOut REAL Output signal Description This instructions uses a 1st order delay time tT1 to smooth the REAL input value at iIN Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output ...

Страница 969: ...ay be neither initialized nor written in the body Output variable uiOut UINT Output signal Description This instructions uses a 1st order delay time tT1 to smooth the unsigned INTEGER input value at iIN Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and ou...

Страница 970: ...Chapter 31 FP e display instructions ...

Страница 971: ... WY WR SV EV DT IX IY s3 WX WY WR SV EV DT s4 WY WR SV EV DT IX IY No IEC address Set If R9007 R9008 MX0 900 7 MX0 900 8 permanently for an instant the area specified using the Index modifier exceeds the limit the value for s1 or s2 is outside of the range specified Special register DT9 cannot be specified for the lower section display data s4 This instruction cannot be used in an interrupt progra...

Страница 972: ...SCR_DUT see page 1322 Variable Data type Function ScreenSelection ANY16 Display mode ScreenControl F180_DUT Data unit type for the control data of the screen display DataUpperSection Value in the upper display area DataLowerSection ANY16 Value in the lower display area For Relays T C Registers Constant Screen Selection WX WY WR SV EV DT IX IY dec or hex Screen Control DataUpper Section WX WY WR SV...

Страница 973: ...the global variable list you define variables that can be accessed by all POUs in the project POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable Enable0 is set to TRUE the function is executed and the FP e is switched to N mode 1st screen ProcessValue0 and SetValue0 are displayed in the upper and lower sections i...

Страница 974: ...Part III FP Instructions DisplayMode0 DisplayMode1 DisplayControlData0 DisplayControlData1 For detailed information please refer to the technical manual of the FP e file ARCT1F369E PDF on your installation CD of Control FPWIN Pro LD ...

Страница 975: ...180_SCR_DUT ScreenSelection DisplayMode0 ScreenControl DisplayCtrlData0 DataUpperSection ElapsedValue0 DataLowerSection SetValue0 F181_DSP DisplayMode0 END_IF IF DF Enable1 THEN F180_SCR_DUT ScreenSelection DisplayMode1 ScreenControl DisplayCtrlData1 DataUpperSection ElapsedValue1 DataLowerSection SetValue1 F181_DSP DisplayMode1 END_IF ...

Страница 976: ... I mode 1st screen 7 I mode 2nd screen N normal mode S switch mode R register mode I I O monitor mode No IEC address Set If R9007 R9008 MX0 900 7 MX0 900 8 permanently for an instant the area specified using the Index modifier exceeds the limit the value s1 is not 0 to 7 If a value other than 0 to 7 is specified for s1 an operation error will occur This instruction cannot be used during an interru...

Страница 977: ...r programming this function have been declared in the POU header Body According to the variable Enable0 to Enable7 that is set to TRUE the function is executed and the FP e is switched to the corresponding mode and the corresponding screen N normal mode S switch mode R register mode I I O monitor mode LD ...

Страница 978: ...N N mode 2nd screen F181_DSP s1 1 END_IF IF DF bEnable2 THEN S mode 1st screen F181_DSP s1 2 END_IF IF DF bEnable3 THEN S mode 2nd screen F181_DSP s1 3 END_IF IF DF bEnable4 THEN R mode 1st screen F181_DSP s1 4 END_IF IF DF bEnable5 THEN R mode 2nd screen F181_DSP s1 5 END_IF IF DF bEnable6 THEN I mode 1st screen F181_DSP s1 6 END_IF IF DF bEnable7 THEN I mode 2nd screen F181_DSP s1 7 END_IF ...

Страница 979: ......

Страница 980: ...Chapter 32 System register instructions ...

Страница 981: ...ndition setting for the COM ports of the CPU This changes the communication conditions for the COM port or Tool port based on the contents specified by the character constant The communication conditions for the port specified by the first keyword are changed to the contents specified by the second keyword The first and second keywords are separated by a comma Contents that can be changed include ...

Страница 982: ...s can be specified for FP X V2 0 or later and FP V3 1 or later These baud rates cannot be set in the system registers 3 Unit No Shared by the Tool COM 1 and COM 2 ports TOOL No 1 Port used TOOL Tool port COM1 COM1 port COM2 COM2 port Unit No No 1 to No99 No 1 to No 99 With the FP0R use the keywords COM1No and TOOLNo to read the unit number from a data register DT0 DT9999 containing the unit number...

Страница 983: ...99 SYS1 COM1No D0000 indicates DT0 A calculation error occurs if any value except 1 99 is assigned to the DT memory 4 Header and Terminator Shared by the COM 1 and COM 2 ports Port used COM1 COM1 port COM2 COM2 port Header Terminator STX STX STX NOSTX no STX ETX ETX CR CR CRLF CR LF NOTERM None COM1 ...

Страница 984: ...s during programming Executing this instruction does not rewrite the contents of the system ROM in the control unit As a result turning the power supply off and then on again rewrites the contents of the system registers specified by the tool software We recommend using differential execution with this instruction Because the system register settings are changed a verification error may occur in s...

Страница 985: ...pecified for COM1 the baud rate or transmission format is changed while the Tool port COM port 1 or COM port 2 is being initialized using MODEM the communication mode is set to anything other than the general communication mode when header and terminator have been set any communication cassette other than the 1 channel RS232C type communication cassette is installed when using RS control the speci...

Страница 986: ...ing to the internal F ROM takes approximately 100ms If the specified password is the same as the password that has already been written the password is not written to the F ROM We recommend using differential execution with this instruction Separate first and second keywords with a comma and do not use spaces No IEC address Set If R9007 R9008 MX0 900 7 MX0 900 8 permanently for an instant any char...

Страница 987: ... the interrupt input and changes the input conditions to the contents specified by the second keyword The first and second keywords are separated by a comma Keyword setting INT2 UP Effective edges Interrupt Input INT0 X0 INT2 X2 INT4 X4 INT6 X6 UP Rising edge DOWN Falling edge Both Rising and falling edged INT1 X1 INT3 X3 INT5 X5 INT7 X7 For the FP X you can set INT0 to INT13 Body When ChangePassw...

Страница 988: ...sters do not change Separate first and second keywords with a comma and do not use spaces No IEC address Set If R9007 R9008 MX0 900 7 MX0 900 8 permanently for an instant any character other than a keyword is specified no comma is between the first and second keywords small letters of the alphabet are used to specify the keyword In this example the function has been programmed in ladder diagram LD...

Страница 989: ...nk entry wait time PCLK1T0 100 PCLK1T0 Specified range Fixed 10 to 400 10 ms to 400 ms 2 Error detection time for transmission assurance relay PCLK1T1 PCLK1T1 100 Specified range 100 to 6400 100 ms to 6400 ms Fixed Precautions during programming The program should be placed at the beginning of all PLCs being linked and the same values specified This instruction should be specified in order to set ...

Страница 990: ...er than a keyword is specified no comma is between the first and second keywords small letters of the alphabet are used to specify the keyword the specified value is outside the specified range Link entry wait time 100ms Error detection time for transmission assurance relay 100ms The values entered at s will be right aligned automatically by the compiler This changes the operation mode of the high...

Страница 991: ...pecified the contents of the system registers change in accordance with the specification so a verification error may occur in some cases when checking or compiling the program When BOTH have been specified the contents of the system registers do not change Separate the first and the second keyword with a comma e g HSCB UP do not use spaces Otherwise an operation error will occur No IEC address Se...

Страница 992: ...d by the character constant The port response time specified by the first keyword is delayed based on the contents specified by the second keyword This instruction is used to delay the response time on the PLC side until the state is reached in which commands can be sent by an external device and responses can be received from the PLC The first and second keywords are separated by a comma LD ST Wh...

Страница 993: ...n the general communication mode Executing this instruction does not change the settings in the system registers We recommend using differential execution with this instruction When the power supply to the PLC is off the settings set by this instruction are cleared The set value will become 0 If the mode is switched to the PROG mode after the instruction has been executed however the settings will...

Страница 994: ...rs of the alphabet are used to specify the keyword no communication cassette has been installed when COM1 or COM2 has been set In this example the function SYS1 is programmed in ladder diagram LD The values entered at s will be right aligned automatically by the compiler Error flags Example POU header The same POU header is used for all programming languages Body When ChangeResponseT turns on the ...

Страница 995: ...alues should always be specified in such a way that d_Start d_End The values of the system registers change so a verification error may occur when the program is verified PLC types Availability of SYS2 see page 1331 Variable Data type Function s_Start Contains new values for the system registers defined by remaining two variables d_Start First system register between 40 47 to receive new value Mus...

Страница 996: ...sed of several data types A DUT is first defined in the DUT pool and then processed like the standard data types BOOL INT etc in the list of global variables or the POU header POU header The same POU header is used for all programming languages Body Changes the values for the PC link area system registers 40 through 45 as defined in LinkAreas when SetLinkAreas turns on LD ...

Страница 997: ......

Страница 998: ...Chapter 33 Special instructions ...

Страница 999: ...bility of F140_STC see page 1321 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 see page 589 and F123_RCL see page 591 instructions Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all ...

Страница 1000: ...ilability of F141_CLC see page 1321 Description Special internal relay R9009 carry flag goes OFF 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 see page 589 and F123_RCL see page 591 instructions Example In this example the same POU header is used for all programming languages For an example using IL instruction list please ref...

Страница 1001: ...ft v within the programming area to open the list of recently used elements PLC types Availability of F142_WDT see page 1321 Variable Data type Function s INT specifies watchdog timer value Description The scan check watchdog timer is preset with the constant specified by s if the trigger EN is in the ON state The value specified by s is 1 to 255 and the preset time becomes 2 5 ms s 637 5 ms Data ...

Страница 1002: ...Shift v within the programming area to open the list of recently used elements PLC types Availability of F148_ERR see page 1321 Variable Data type Function n ANY16 Must be a constant self diagnostic error code number range 0 and 100 to 299 See also PLC status in the online help For Relay T C Register Constant n dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 permanentl...

Страница 1003: ...s 1002 Part III FP Instructions LD ST When programming with structured text enter the following IF start THEN Sets the self diagnostic error 100 The ERROR ALARM LED of the PLC is on and operation stops F148_ERR 100 END_IF ...

Страница 1004: ...Recently used in the pop up menu Press Ctrl Shift v within the programming area to open the list of recently used elements PLC types Availability of F149_MSG see page 1321 Variable Data type Function s STRING 12 message to be displayed For Relay T C Register Constant s character Description This instruction is used for displaying the message on the FP Programmer II screen After executing the F149_...

Страница 1005: ...ling points using Control FPWIN Pro Relay contacts 16 points Available for FP format X Y R L T C Data 3 words Available for FP format WX WY WR WL SV EV DT LD FL PLC types Availability of F155_SMPL see page 1321 Description This instruction transfers the sampling data specified by the sampling trace editor into the sampling memory Example In this example the function has been programmed in ladder d...

Страница 1006: ...ing points using Control FPWIN Pro Relay contacts 16 points Available for FP format X Y R L T C Data 3 words Available for FP format WX WY WR WL SV EV DT LD FL PLC types Availability of F156_STRG see page 1321 Description This instruction sets the sampling trigger that stopps the sampling after the delay specified by the sampling trace parameters Example In this example the function has been progr...

Страница 1007: ......

Страница 1008: ...Chapter 34 Program execution control instructions ...

Страница 1009: ...t must correspond to MC number both of which delimit a nested program that is not executed It is not possible to use this function in a function block POU The maximum possible value that can be assigned to Num depends on the PLC type PLC types Availability of MC see page 1328 Variable Data type Function Num constant Constant number that must correspond to MCE number both of which delimit a nested ...

Страница 1010: ...t is not possible to use this function in a function block POU The maximum possible value that can be assigned to Num depends on the PLC type PLC types Availability of MCE see page 1328 Variable Data type Function Num constant Constant number that must correspond to MC number both of which delimit a nested program that is not executed LD start EN start Starting signal for the MC MCE function MC 1 ...

Страница 1011: ...on pair can be programmed between another pair This construction is called nesting It is not possible to use this function in a function block POU The maximum possible value that can be assigned to Num depends on the PLC type PLC types Availability of JP see page 1328 Variable Data type Function Num constant Constant number that must correspond to LBL number this nested program is jumped over LD s...

Страница 1012: ...ements The range of the number s can be between 0 and 255 PLC types Availability of F19_SJP see page 1322 Variable Data type Function s ANY16 Stores label number 0 to 255 For Relay T C Register Constant s WX WY WR WL SV EV DT LD FL When the variable start is set to TRUE the function is carried out Description Jumps to the label LBL see page 1013 s with the same number as the data stored in the are...

Страница 1013: ...tions 1012 Part III FP Instructions ST When programming with structured text enter the following if Start is true Counter will be incremented by 1 else by 2 IF Start THEN F19_SJP _label END_IF Counter Counter 1 LBL 1 Counter Counter 1 ...

Страница 1014: ...instruction is not executed ignored It is not possible to use this function in a function block POU The maximum possible value that can be assigned to Num depends on the PLC type PLC types Availability of LOOP see page 1328 Variable Data type Function s INT WORD Set value Num constant Constant number that must correspond to LBL number this nested program is looped until the variable at s reaches 0...

Страница 1015: ...he PLC type PLC types Availability of LBL see page 1328 Variable Data type Function Num constant Constant number that must correspond to JP LOOP or F19 label number When the variable start is set to TRUE the function is carried out Description The LBL Label for the JP and LOOP instruction skips to the LBL instruction with the same number Num as the JUMP see page 1009 instruction if the predetermin...

Страница 1016: ...structions 1015 Part III FP Instructions ST When programming with structured text enter the following if Start is true Counter will be incremented by 1 else by 2 IF Start THEN JP 1 END_IF Counter Counter 1 LBL 1 Counter Counter 1 ...

Страница 1017: ... when the mode selector switch on the PLC is set to RUN mode with setting the INITIALIZE TEST switch to the TEST mode Description The BRK Breakpoint instruction stops the execution at the address of this instruction during the test run mode if the trigger EN is in the ON state Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header i...

Страница 1018: ...3 02 Periodic interrupt INT 24 s2_Condition 2 Bit 0 0 Interrupt program 0 disabled Bit 0 1 Interrupt program 0 enabled Bit 1 0 Interrupt program 1 disabled Bit 15 1 Interrupt program 15 enabled Example s2 2 0000000000001010 The current enable disable status of each interrupt module initiated interrupt can be checked by monitoring the special data register see page 1254 DT90025 The current enable d...

Страница 1019: ... SV EV DT LD FL dec or hex Data types Operands Example In this example the same POU header is used for all programming languages For an example using IL instruction list please refer to the online help POU header All input and output variables used for programming this function have been declared in the POU header Body The interval for executing the periodic interrupt is specified as 100ms 10ms ti...

Страница 1020: ...Chapter 35 Pulse output instructions ...

Страница 1021: ... beginners or users familiar with FPWIN GR Most of the information which is accessible via information and control functions is stored in special internal relays and special data registers These relays and registers can also be accessed using PLC independent system variables To take advantage of the features you prefer the instructions of both libraries can be mixed NOTE When programming with the ...

Страница 1022: ...ables sys_wHscChannelxControlCode or sys_wPulseChannelxControlCode where x channel number The settings of this system variable remain unchanged until another setting operation is executed Performing a forced stop may cause the elapsed value at the PLC output side to differ from the elapsed value at the motor input side Therefore you must execute a home return after pulse output has stopped Setting...

Страница 1023: ...001 0000 1001 16 2109 15 12 11 8 7 4 3 0 I II III IV Group IV 1 Channel number channel n 16 n Group III 2 1 fixed Near home input bit 4 see note Group II 3 0 FALSE 1 TRUE Pulse output bit 3 4 0 continue 1 stop Count bit 1 5 0 permit 1 prohibit Reset elapsed value to 0 bit 0 Group I 6 0 no 1 yes Example 16 2109 Group Value Description IV 2 Channel number 2 III 1 fixed II 0 Near home input FALSE Hex...

Страница 1024: ...ermit 1 prohibit Reset elapsed value to 0 bit 0 Group I 8 0 no 1 yes Example 16 2109 Group Value Description IV 2 Channel number 2 III 1 fixed Position control start request disabled Decelerated stop request disabled II 0 Near home input FALSE Hex 9 corresponds to binary 1001 Pulse output stop bit 3 1 Clear pulse output control bit 2 0 Count permit bit 1 0 I 9 Reset elapsed value to 0 yes bit 0 1 ...

Страница 1025: ...nput FALSE bit 2 0 Count permit bit 1 0 II 9 Reset elapsed value to 0 yes bit 0 1 I 0 Example The first example shows how to enable the near home input for channel 2 and the second example shows how to perform pulse output stop for channel 0 All input and output variables used for programming this function have been declared in the POU header Body The near home input is enabled for channel 2 durin...

Страница 1026: ...5 Part III FP Instructions Performing a forced stop may cause the elapsed value at the PLC output side to differ from the elapsed value at the motor input side Therefore you must execute a home return after pulse output has stopped ...

Страница 1027: ...mple shows how to write an initial value elapsed value into the high speed counter The second example shows how to read an elapsed value and copy it to a variable All input and output variables used for programming this function have been declared in the POU header Body An initial value of 3000 elapsed value is written into channel 0 of the high speed counter LD POU header All input and output var...

Страница 1028: ...ed only the internal memory of the corresponding WY address is set or reset Interrupt operation The interrupt program will be executed when the elapsed value matches the target value Any interrupt that has been entered into the Tasks list is automatically enabled A special interrupt program number is assigned to each channel number Channels used by interrupt programs Interrupt 8 Channel 0 Interrup...

Страница 1029: ...will continue If both the main program and the interrupt program contain code for the same channel make sure both are not executed simultaneously We strongly recommend that you incorporate a forced stop see page 1021 option in your positioning program The status of the high speed counter control flag or pulse output control flag may change while a scan is being carried out For example if the flag ...

Страница 1030: ...l variable list you define variables that can be accessed by all POUs in the project POU header All input and output variables used for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F166_PulseOutput_Set n_diPulseOutputChannel 0 s_...

Страница 1031: ...WY address is set or reset Interrupt operation The interrupt program will be executed when the elapsed value matches the target value Any interrupt that has been entered into the Tasks list is automatically enabled A special interrupt program number is assigned to each channel number Interrupt 8 Channel 0 Interrupt 9 Channel 1 Interrupt 10 Channel 2 Interrupt 11 Channel 3 General programming infor...

Страница 1032: ...atus of the high speed counter control flag or pulse output control flag may change while a scan is being carried out For example if the flag is used more than once as an input condition different statuses may exist within one scan To ensure proper execution of the program the status of the special internal relay should be copied to a variable at the beginning of the program PLC types Availability...

Страница 1033: ...for programming this function have been declared in the POU header Body When the variable start is set to TRUE the function is carried out LD ST When programming with structured text enter the following IF DF start THEN F167_PulseOutput_Reset n_diPulseOutputChannel 0 s_diTargetValue 200 d_Y out_0 END_IF ...

Страница 1034: ...ration time The difference between target and initial speed determines the slope of the ramps General programming information Set any high speed counter allocated to a pulse output channel to Unused in the system registers When programs are being edited in RUN mode pulse output stops but resumes after the program changes have been downloaded If both the main program and the interrupt program conta...

Страница 1035: ...the special internal relay should be copied to a variable at the beginning of the program Running the FP0R in FP0 compatibility mode To run the FP0R in FP0 compatibility mode you can download an FP0 program to the FP0R Please note the following restrictions The FP0R supports signed 32 bit data for elapsed value and target value the FP0 supports signed 24 bit data In FP0 compatibility mode counting...

Страница 1036: ...executed Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST GVL In the global variable list you define variables that can be accessed by all POUs in the project DUT The DUT F168_PulseOutput_Trapezoidal_DUT is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in t...

Страница 1037: ...the home position designate a near home input and set bit 4 of the special data register storing the pulse output control code sys_wHscOrPulseControlCode to TRUE and back to FALSE again The value in the elapsed value area during a home return differs from the current value When the return is completed the elapsed value changes to 0 Select one of two different operation modes Type 1 The home input ...

Страница 1038: ... downloaded The high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag e g sys_bIsPulseChannel0Active are assigned to the same internal relay e g R903A Therefore when a high speed counter instruction or a pulse output instruction is executed both the high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag ...

Страница 1039: ... simultaneously taken into consideration The FP0R does not support the no counting setting Instead incremental counting is performed with the FP0 pulse output instructions set to no counting The maximum pulse output frequency is 10000Hz Make sure the pulse output instruction does not use an output that is also being used as a normal output For an FP0 program to be able to run in FP0 compatibility ...

Страница 1040: ...he FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF DF X0_bMotorSwitch THEN dutHome iInitialAndFinalSpeed iInitialAndFinalSpeed dutHome iTargetSpeed iTargetSpeed dutHome iAccelerationAndDecelerationTime iAccelerationTime END_IF IF DF X0_bMotorSwitch THEN F1...

Страница 1041: ...high speed counter instruction or a pulse output instruction is executed both the high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag e g sys_bIsPulseChannel0Active for the channel used are TRUE No other high speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE Pulse output stops when the upper limit of...

Страница 1042: ...river characteristics are simultaneously taken into consideration The FP0R does not support the no counting setting Instead incremental counting is performed with the FP0 pulse output instructions set to no counting The maximum pulse output frequency is 10000Hz Make sure the pulse output instruction does not use an output that is also being used as a normal output For an FP0 program to be able to ...

Страница 1043: ... variables used for programming this function have been declared in the POU header Body The comment fields explain the function of this example LD ST When programming with structured text enter the following IF X0_bMotorSwitch THEN dutJog ispeed 300 END_IF IF X0_bMotorSwitch THEN F169_PulseOutput_Jog s_dutDataTable dutJog n_iPulseOutputChannel 0 END_IF ...

Страница 1044: ...nel0Active for the channel used are TRUE No other high speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE At a point close to the minimum or maximum duty ratio the output is delayed which may cause the duty ratio to differ from the specified value The duty ratio can be changed for each scan The change becomes effective with the next pulse output The ...

Страница 1045: ...ble DT n_iPulseOutputChannel dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant channel number or values of the data table are outside the permissible range Data types Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST GVL In the global variable list you define variables that can be acce...

Страница 1046: ... When programming with structured text enter the following IF X6_bEnablePWM THEN dutPWMControl iPulseWidthModulationDuty iPulseWidthModulationDuty END_IF IF X6_bEnablePWM THEN F170_PulseOutput_PWM s_dutDataTable dutPWMControl n_iPulseOutputChannel 2 END_IF ...

Страница 1047: ...itial and final speed 4 Target value 2 Target speed 5 Pulse output control flag 3 Acceleration deceleration time 6 Execution condition The pulse output frequency changes according to the specified acceleration deceleration time The difference between target and initial speed determines the slope of the ramps General programming information If both the main program and the interrupt program contain...

Страница 1048: ...n RUN mode pulse output stops but resumes after the program changes have been downloaded FP Set any high speed counter allocated to a pulse output channel to Unused in the system registers FP X Set Pulse output for the desired channel in the system registers We strongly recommend that you incorporate a forced stop see page 1021 option in your positioning program The status of the high speed counte...

Страница 1049: ... the deceleration ramp Type 1 The difference between the maximum speed of 50kHz and the initial speed determines the slope of the acceleration ramp The difference between the maximum speed of 50kHz and the final speed determines the slope of the deceleration ramp Pulses are output using a duty of 25 With the pulse output method pulse direction pulses are output approx 300 s after the direction sig...

Страница 1050: ...d cannot be lower than the corrected final speed General programming information Warning As soon as you begin editing a program online i e in RUN mode using this instruction pulse output will stop If both the main program and the interrupt program contain code for the same channel make sure both are not executed simultaneously When a pulse output instruction is executed and pulses are being output...

Страница 1051: ...P0R PLC types Availability of F171_PulseOutput_Trapezoidal see page 1322 Variable Data type Function s_dutDataTable FP FP X F171_PulseOutput_Trapezoidal_DUT FP0R F171_PulseOutput_Trapezoidal_Type0_DUT F171_PulseOutput_Trapezoidal_Type1_DUT Starting address of area containing the data table n_iPulseOutputChannel decimal constant Pulse output channel FP 0 2 FP X R 0 1 FP X C14T 0 1 2 FP X C30T C60T ...

Страница 1052: ...All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF DF bMotorSwitch THEN dutTrapez diInitialAndFinalSpeed diInitialSpeed dutTrapez diTargetSpeed diTargetSpeed dutTrapez diAccelerationDecelerationTime diAccelerationTime dutTrapez diDeviationCounterClearSignalOutputTime 10 END_IF IF ...

Страница 1053: ...r home input and set bit 4 of the special data register storing the pulse output control code sys_wHscOrPulseControlCode to TRUE and back to FALSE again The deviation counter clear output can be set to TRUE when home return has been completed The value in the elapsed value area during a home return differs from the current value When the return is completed the elapsed value changes to 0 Select on...

Страница 1054: ...in program and the interrupt program contain code for the same channel make sure both are not executed simultaneously The deviation counter clear signal is allocated to dedicated output numbers specific to each PLC type When programs are being edited in RUN mode pulse output stops but resumes after the program changes have been downloaded FP X When a pulse output instruction is executed and pulses...

Страница 1055: ... proper execution of the program the status of the special internal relay should be copied to a variable at the beginning of the program PLC types Availability of F171_PulseOutput_Home see page 1322 Variable Data type Function s_dutDataTable F171_PulseOutput_Home_DUT Starting address of area containing the data table n_iPulseOutputChannel decimal constant Pulse output channel FP 0 2 FP X R 0 1 FP ...

Страница 1056: ...h structured text enter the following IF DF X0_bMotorSwitch THEN dutHome diInitialAndFinalSpeed diInitialSpeed dutHome diTargetSpeed diTargetSpeed dutHome diAccelerationDecelerationTime diAccelerationTime dutHome diDeviationCounterClearSignalOutputTime 10 END_IF Example for home position return IF DF X0_bMotorSwitch THEN F171_PulseOutput_Home s_dutDataTable dutHome n_iPulseOutputChannel 0 END_IF ...

Страница 1057: ...trol trigger input 4 Acceleration time 8 Pulse output control flag The pulse output frequency changes according to the specified acceleration time and the specified deceleration time The difference between target speed and initial speed determines the slope of the acceleration ramp The difference between target speed and final speed determines the slope of the deceleration ramp After the position ...

Страница 1058: ...is performed with the same slope as deceleration from the target speed Executing an emergency stop To perform an emergency stop set bit 3 of the data register storing the pulse output control code from FALSE to TRUE e g MOVE 16 108 sys_wHscOrPulseControlCode Note When stopping disable all pulse output functions for the channel used in the program JOG Operation Type 0 Use the following predefined D...

Страница 1059: ... F171_PulseOutput_Jog_Positioning_Type1_DUT The following parameters can be specified in the DUT Control code Initial and final speed Target speed 1 Acceleration time Target speed 2 Change time Deceleration time Target value Target speed 1 target speed 2 Target speed 1 target speed 2 t f 1 2 3 4 5 6 7 8 9 t f 1 2 3 4 5 6 7 8 9 1 Initial and final speed 6 Change time 2 Target speed 1 7 Deceleration...

Страница 1060: ...e a forced stop see page 1021 option in your positioning program The status of the high speed counter control flag or pulse output control flag may change while a scan is being carried out For example if the flag is used more than once as an input condition different statuses may exist within one scan To ensure proper execution of the program the status of the special internal relay should be copi...

Страница 1061: ...DUT The DUT F171_PulseOutput_Jog_Positioning_Type0_DUT is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF Start THEN dutJog diInitialAndFinalSpeed diInitialAndFinalSpeed END_IF IF Start THEN F171_PulseOutput_Jog_Positioning s_dutDataTable...

Страница 1062: ...ode Frequency Target value Pulse output characteristics The frequency and the target value can be changed in each scan The control code however cannot be changed during execution of the instruction Select one of two different operation modes Mode with no target value type 0 Pulses are output in accordance with the conditions set in the DUT as long as the execution condition is TRUE 300Hz 0Hz TRUE ...

Страница 1063: ...ion or a pulse output instruction is executed both the high speed counter control flag e g sys_bIsHscChannel0ControlActive and the pulse output control flag e g sys_bIsPulseChannel0Active for the channel used are TRUE No other high speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE FP Executing the circular interpolation control instruction F176 sets...

Страница 1064: ...ecution condition The pulse output frequency changes according to the specified acceleration time and the specified deceleration time The difference between the maximum speed of 50kHz and the initial speed determines the slope of the acceleration ramp The difference between the maximum speed of 50kHz and the final speed determines the slope of the deceleration ramp When the execution condition tur...

Страница 1065: ...e execution condition is FALSE t f 1 2 3 4 5 2 5 1 Initial and final speed 4 Pulse output control flag 2 Change of target speed 5 Decelerated stop 3 Execution condition Target value match stop mode type 1 Output stops when the target value is reached Set this mode in the control code and specify the target value an absolute value in the DUT A decelerated stop is performed when the target value has...

Страница 1066: ...m The status of the high speed counter control flag or pulse output control flag may change while a scan is being carried out For example if the flag is used more than once as an input condition different statuses may exist within one scan To ensure proper execution of the program the status of the special internal relay should be copied to a variable at the beginning of the program REFERENCE Plea...

Страница 1067: ...s Operands Error flags Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages DUT The DUT F172_PulseOutput_Jog_Type0_DUT_0 is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with...

Страница 1068: ...the permissible range while the instruction is being executed the resolution is adjusted to 100 When execution of the instruction begins no operation error is displayed If the duty is changed to 100 or higher while the instruction is being executed the frequency is adjusted to the maximum value at the specified resolution When execution of the instruction begins no operation error is displayed If ...

Страница 1069: ...system registers FP X FP0R Set PWM output for the desired channel in the system registers We strongly recommend that you incorporate a forced stop see page 1021 option in your positioning program The status of the high speed counter control flag or pulse output control flag may change while a scan is being carried out For example if the flag is used more than once as an input condition different s...

Страница 1070: ... LD and structured text ST The same POU header is used for all programming languages GVL In the global variable list you define variables that can be accessed by all POUs in the project DUT The DUT F173_PulseOutput_PWM_DUT is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with str...

Страница 1071: ...d Then the frequency changes to the second frequency value and pulse output continues until the second target value is reached and so forth Pulse output stops when the last target value is reached A frequency of 0 signifies the final frequency and stops pulse output General programming information FP X FP0R When a pulse output instruction is executed and pulses are being output the pulse output co...

Страница 1072: ...value is reached even if the execution condition is no longer TRUE During this time other pulse output instructions cannot be executed FP Set any high speed counter allocated to a pulse output channel to Unused in the system registers FP FP X If a periodic interrupt or high speed counter interrupt program is run or the PLC link function is used at the same time a frequency of 80kHz or less should ...

Страница 1073: ...ds Error flags Example In this example the function is programmed in ladder diagram LD The same POU header is used for all programming languages GVL In the global variable list you define variables that can be accessed by all POUs in the project DUT The DUT F174_PulseOutput_DataTable_8_Values_DUT is predefined in the FP Library and can be used as a sample POU header All input and output variables ...

Страница 1074: ...ult area of the DUT X axis initial and final speed X axis target speed Y axis initial and final speed Y axis target speed X axis frequency range Y axis frequency range X axis number of acceleration deceleration steps Y axis number of acceleration deceleration steps Pulse output characteristics 5000 2000 y x 5000 X axis target value channel 0 2000 Y axis target value channel 2 FP X channel 1 The tw...

Страница 1075: ... speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE FP Executing the circular interpolation control instruction F176 sets the circular interpolation control flag sys_bIsCircularInterpolationActive to TRUE The status of this flag is maintained until the target value is reached even if the execution condition is no longer TRUE During this time other pu...

Страница 1076: ...tput approx 300 s after the direction signal has been output the motor driver characteristics are simultaneously taken into consideration General programming information Pulse output stops when the target value is reached The target value for each axis must be within the range of 8388608 8388607 When this instruction is used in combination with other pulse output instructions e g F171_PulseOutput_...

Страница 1077: ...ta type Function n_iPulseOutputChannel Constant Pulse output channel FP 0 2 FP X R 0 1 FP X C14T 0 1 2 FP X C30T C60T 0 1 2 3 FP0R 0 1 2 3 For interpolation channel 0 and 1 or channel 2 and 3 are used as pairs You may only specify 0 or 2 for C14T 0 only s_dutDataTable FP FP X F175_PulseOutput_Linear_DUT_0 FP0R F175_PulseOutput_Linear_DUT_1 Starting address of area containing the data table For Rel...

Страница 1078: ...the FP The parameters for the FP0R are only slightly different DUT The DUT F175_PulseOutput_Linear_DUT_0 is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF DF bTrigger THEN F175_PulseOutput_Linear n_iPulseOutputChannel 0 s_dutDataTable du...

Страница 1079: ...ult area of the DUT Radius Pulse output characteristics X Fy Fv Fx r Y S Xs Ys O Xo Yo P Xp Yp E Xe Ye θ θ 1 Rotation direction Reverse 2 Rotation direction Forward Fv Composite speed O Xo Yo Center position Fx X axis speed S Xs Ys Current position Start Fy Y axis speed P Xp Yp Pass position r Radius E Xe Ye Target position End Description Pulses are output from two channels in accordance with the...

Страница 1080: ...21 to set the circular interpolation control flag sys_bIsCircularInterpolationActive to FALSE If Continue has been selected for the operation connection mode use a special flag sys_bIsCircularInterpolationOverwritingPossible to permit overwriting of the target value The relay is TRUE for one scan when the circular interpolation instruction is executed The target value for each axis must be within ...

Страница 1081: ...of F176_PulseOutput_Center see page 1322 Variable Data type Function n_iPulseOutputChannel decimal constant Pulse output channel 0 2 s_dutDataTable F176_PulseOutput_Center_DUT Starting address of area containing the data table For Relay T C Register Constant s_dutDataTable DT n_iPulseOutputChannel dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant channel n...

Страница 1082: ...ramming languages DUT The DUT F176_PulseOutput_Center_DUT is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF DF Trigger THEN F176_PulseOutput_Center n_iPulseOutputChannel 0 s_dutDataTable dutCenterData END_IF ...

Страница 1083: ... DUT Radius X axis center value Y axis center value Pulse output characteristics X Fy Fv Fx r Y S Xs Ys O Xo Yo P Xp Yp E Xe Ye θ θ 1 Rotation direction Reverse 2 Rotation direction Forward Fv Composite speed O Xo Yo Center position Fx X axis speed S Xs Ys Current position start Fy Y axis speed P Xp Yp Pass position Description Pulses are output from two channels in accordance with the parameters ...

Страница 1084: ...d To restart circular interpolation perform a forced stop stop pulse output see page 1021 to set the circular interpolation control flag sys_bIsCircularInterpolationActive to FALSE If Continue has been selected for the operation connection mode use a special flag sys_bIsCircularInterpolationOverwritingPossible to permit overwriting of the target value The relay is TRUE for one scan when the circul...

Страница 1085: ... type Function n_iPulseOutputChannel decimal constant Pulse output channel 0 2 s_dutDataTable F176_PulseOutput_Pass_DUT Starting address of area containing the data table For Relay T C Register Constant s_dutDataTable DT n_iPulseOutputChannel dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant channel number or values of the data table are outside the permis...

Страница 1086: ...used for all programming languages DUT The DUT F176_PulseOutput_Pass_DUT is predefined in the FP Library POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following IF DF Trigger THEN F176_PulseOutput_Pass n_iPulseOutputChannel 0 s_dutDataTable dutPassData END_IF ...

Страница 1087: ...signate a near home input and set bit 4 of the special data register storing the pulse output control code sys_wHscOrPulseControlCode to TRUE and back to FALSE again The deviation counter clear output can be set to TRUE when home return has been completed Select one of two different operation modes Type 0 The home input is effective regardless of whether or not there is a near home input whether d...

Страница 1088: ...n signal has been output the motor driver characteristics are simultaneously taken into consideration General programming information Set Pulse output for the desired channel in the system registers Even when home input has occurred executing this instruction causes pulse output to begin If the near home input is enabled while acceleration is in progress deceleration will start The deviation count...

Страница 1089: ... address of area containing the data table n_iPulseOutputChannel decimal constant Pulse output channel 0 3 For Relay T C Register Constant s_dutDataTable DT n_iPulseOutputChannel dec or hex No IEC address Set If R9007 MX0 900 7 permanently R9008 MX0 900 8 for an instant channel number or values of the data table are outside the permissible range initial speed target speed Data types Operands Error...

Страница 1090: ...eed dutHomeType1 diTargetSpeed diTargetSpeed dutHomeType1 diAccelerationTime diAccelerationTime dutHomeType1 diDecelerationTime diDecelerationTime dutHomeType1 diCreepSpeed diCreepSpeed dutHomeType1 diDeviationCounterClearSignalOutputTime 0 END_IF Example for home position return IF DF X0_bMotorSwitch THEN F177_PulseOutput_Home s_dutDataTable dutHomeType1 n_iPulseOutputChannel 0 END_IF ...

Страница 1091: ......

Страница 1092: ...Chapter 36 Analog unit instructions ...

Страница 1093: ...cal information please refer to the manual FP0A21AnalogIOUnitTechnicalManual_ARCT1F390 on your FPWIN Pro installation CD PLC types see page 1332 Input channel setting by DIP switches 1 2 3 and 5 0 5 V 0 20 mA 10 10 V averaging ON 1 2 3 4 5 no averaging see note 1 with averaging see note 2 no averaging see note 1 with averaging see note 2 Off On Off On Off On Off On 1 2 3 4 5 This function block re...

Страница 1094: ...channel 2 With averaging on each channel for each A D conversion the maximum and minimum values from the data of the last ten times are excluded and the data from the other eight times is averaged and the result set 3 If a thermocouple setting is used averaging is carried out regardless of the switch settings 4 After turning on the analog unit 20 minutes are required for the transient state to rea...

Страница 1095: ...al Thermocouple input when measured at temperature higher than the temperature of the terminal when measured at temperature lower than the temperature of the terminal V 0 I 0 V 1 I 1 COM V I COM IN OUT Thermocouple CH0 Thermocouple CH1 V 0 I 0 V 1 I 1 COM V I COM IN OUT Thermocouple CH0 Thermocouple CH1 Connect IN V terminal to the side of the thermocouple and connect IN COM terminal to the side o...

Страница 1096: ...pe Function iIOWordOffset The offset of the first WX WY address of the RTD unit according to its position FP0R FP0 FP Sigma use ExpansionUnitToIOWordOffset_FP0 see page 1128 or unit 1 address 2 unit 2 address 4 unit 3 address 6 FP X use ExpansionUnotToIOWordOffset_FPX_FP0 see page 1129 or FP0 adapter address of unit 1 address of unit 2 address of unit 3 1st unit 30 32 34 2nd unit 40 42 44 3rd unit...

Страница 1097: ...d structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header LD ST When programming with structured text enter the following Unit_AnalogInOut_FP0_A21 iOutChannel iOutChannel iModuleOffsetWX iModuleOffsetWX iInChannel0 iInChannel0 ...

Страница 1098: ...installation CD PLC types see see page 1333 Analog mode switch setting Use the DIP switches at the front of the unit to set the analog channels Input channels configured by DIP switches 1 and 2 0 5 V 0 20 mA see note 1 10 10 V 100 100 mV Off On Off On Off On Off On ON 1 2 3 4 5 1 2 3 4 5 or Description This function block reads data from the input channels of the FP0 A80 unit The result is stored ...

Страница 1099: ...ed by DIP switches 3 and 4 Off On Off On Off On Off On 1 2 3 4 5 channel for converted data 0 and 1 0 3 0 5 0 7 ON 1 2 3 4 5 number of input channel 2 4 6 8 Averaging configured by DIP switch 5 without averaging see note 3 with averaging see note 3 Off On Off On ON 1 2 3 4 5 1 2 3 4 5 ...

Страница 1100: ...nput instrument ch1 Input instrument ch2 Input instrument ch3 Input instrument ch4 Input instrument ch5 Input instrument ch6 Input instrument ch7 Connect input instrument between V and COM terminal First connect both V terminal and I terminal And then connect input instrument between it and COM terminal A D conversion values Input current mA A D conversion value 0 0 0 2 5 500 5 0 1000 7 5 1500 10 ...

Страница 1101: ...e ExpansionUnotToIOWordOffset_FPX_FP0 see page 1129 or FP0 adapter address of unit 1 address of unit 2 address of unit 3 1st unit 30 32 34 2nd unit 40 42 44 3rd unit 50 52 54 4th unit 60 62 64 5th unit 70 72 72 6th unit 80 82 84 7th unit 90 92 94 8th unit 100 102 104 Output variable iInChannel0 iInChannel7 INT input values on the corresponding output channel 0 7 0V 5V 0mA 20mA 0 4000 10V 10V 100mV...

Страница 1102: ... LD ST When programming with structured text enter the following Uint_AnalogInput iModuleOffsetWX iModuleOffsetWX iInChannel0 iInChannel0 iInChannel1 iInChannel1 iInChannel2 iInChannel2 iInChannel3 iInChannel3 iInChannel4 iInChannel4 iInChannel5 iInChannel5 iInChannel6 iInChannel6 ...

Страница 1103: ...needs to be replaced REFERENCE The online help only provides a short overview of DIP switch settings and wiring For technical information please refer to the manual FP0 RTD Unit ACGM0159 on your FPWIN Pro installation CD PLC types see 1333 Input range setting by DIP switches The DIP switches configure the analog channels You set the measurement range type of sensor or resistor and the sampling cyc...

Страница 1104: ...switch Off On Off On Off On Off On 0 1 2 1 2 ON 1 2 3 4 5 3 4 5 3 4 Measurement Pt100 Pt1000 Ni1000 Resistor Sampling cycle switch 5 switch Off On Off On 1 2 3 4 5 Sampling cycle 0 1 s 1 s Input wiring Wiring method CH0 CH4 CH3 CH2 CH1 CH5 Input line wiring RTD RTD resistance temperature detector ...

Страница 1105: ... 00 8000 80 00 8000 80 00 8000 80 01 80 01 80 01 80 01 Pt100 if input value exceeds the range RTD broken 8191 RTD broken 8191 range 200 0 C 300 0 C 328 0 F 572 0 F resolution 0 1 0 1 F analog input value C digital output value analog input value F digital output value 200 0 2000 328 0 3280 300 0 3000 572 0 5720 200 1 328 0 300 0 572 0 if input value exceeds the range RTD broken 8191 RTD broken 819...

Страница 1106: ...g input value C digital output value analog input value F digital output value 30 00 3000 22 00 2200 80 00 8000 80 00 8000 30 01 22 01 80 01 80 01 if input value exceeds the range RTD broken 8191 RTD broken 8191 range 20 2200 resolution 1 20 20 2200 2200 19 2201 if input value exceeds the range resistor broken 16383 range 20 0 163 0 20 0 200 1630 0 16300 19 9 1630 1 Resistor if input value exceeds...

Страница 1107: ...witchSetTo Resistor BOOL settings according to the RTD device FALSE if you have set the DIP switch to Pt100 Pt1000 Ni1000 TRUE if you have set the DIP switch to resistor Output variable iInChannel0 iInChannel5 INT stores the digital data from the corresponding input channels of the FP0 RTD6 unit Temperature low resolution 0 1 C or F according to settings e g 20 12 C channel value 201 outside range...

Страница 1108: ...nChannel1 bChannel2HighResolution bHighResolutionChannel2 bChannel3HighResolution bHighResolutionChannel3 bChannel4HighResolution bHighResolutionChannel4 bChannel5HighResolution bHighResolutionChannel5 bTemperatureInFahrenheit bHighResolutionChannel6 bChannel012DIPSwitchSetToResistor bSetToResistor012 bChannel345DIPSwitchSetToResistor bSetToResistor345 iChannel0 iIn1 iChannel1 iIn2 iChannel2 iIn3 ...

Страница 1109: ...D needs to be replaced REFERENCE The online help only provides a short overview of DIP switch settings and wiring For technical information please refer to the manual FP0 RTD Unit ACGM0159 on your FPWIN Pro installation CD PLC types see 1333 Input range setting by DIP switches The DIP switches configure the analog channels You set the measurement range type of sensor or resistor and the sampling c...

Страница 1110: ...switch Off On Off On Off On Off On 0 1 2 1 2 ON 1 2 3 4 5 3 4 5 3 4 Measurement Pt100 Pt1000 Ni1000 Resistor Sampling cycle switch 5 switch Off On Off On 1 2 3 4 5 Sampling cycle 0 1 s 1 s Input wiring Wiring method CH0 CH4 CH3 CH2 CH1 CH5 Input line wiring RTD RTD resistance temperature detector ...

Страница 1111: ... 00 8000 80 00 8000 80 00 8000 80 01 80 01 80 01 80 01 Pt100 if input value exceeds the range RTD broken 8191 RTD broken 8191 range 200 0 C 300 0 C 328 0 F 572 0 F resolution 0 1 0 1 F analog input value C digital output value analog input value F digital output value 200 0 2000 328 0 3280 300 0 3000 572 0 5720 200 1 328 0 300 0 572 0 if input value exceeds the range RTD broken 8191 RTD broken 819...

Страница 1112: ...g input value C digital output value analog input value F digital output value 30 00 3000 22 00 2200 80 00 8000 80 00 8000 30 01 22 01 80 01 80 01 if input value exceeds the range RTD broken 8191 RTD broken 8191 range 20 2200 resolution 1 20 20 2200 2200 19 2201 if input value exceeds the range resistor broken 16383 range 20 0 163 0 20 0 200 1630 0 16300 19 9 1630 1 Resistor if input value exceeds...

Страница 1113: ...itchSetTo Resistor bChannel345DIPSwitchSetTo Resistor BOOL settings according to the RTD device FALSE if you have set the DIP switch to Pt100 Pt1000 Ni1000 TRUE if you have set the DIP switch to resistor Output variable rInChannel0 rInChannel5 REAL stores the digital data from the corresponding input channels of the FP0 RTD6 unit as REAL values Temperature low resolution 0 1 C or F according to se...

Страница 1114: ...lution bHighResolutionChannel2 bChannel3HighResolution bHighResolutionChannel3 bChannel4HighResolution bHighResolutionChannel4 bChannel5HighResolution bHighResolutionChannel5 bTemperatureInFahrenheit bHighResolutionChannel6 bChannel012DIPSwitchSetToResistor bSetToResistor012 bChannel345DIPSwitchSetToResistor bSetToResistor345 rReal0 fbInstance7 rChannel0 rReal1 fbInstance7 rChannel1 rReal2 fbInsta...

Страница 1115: ...ing the CPU power to ON Changes of the DIP switches are not recognized until the next reset of the CPU power OFF ON Type of thermocouple configured by DIP switch 1 and 2 K type J type T type R type ON 1 2 3 4 5 Off On Off On Off On Off On 1 2 3 4 5 Description This function block reads the analog input data of the analog unit FP0 TC4 four analog input channels or FP0 TC8 eight analog input channel...

Страница 1116: ...F Off On Off On ON 1 2 3 4 5 1 2 3 4 5 Input channels configured by DIP switches 4 and 5 Off On Off On Off On Off On 1 2 3 4 5 channel for converted data 0 and 1 0 3 0 5 0 7 ON 1 2 3 4 5 number of input channel 2 4 6 8 Input wiring FP0 TC4 FP0 TC8 CH0 CH1 CH2 CH3 NC CH0 CH1 CH2 CH3 NC CH4 CH5 CH6 CH7 NC ...

Страница 1117: ...Type input temperature C digial value range 100 0 C 500 0 C 100 0 1000 500 0 5000 100 1 1001 500 1 5001 or 8000 K J if input value exceeds the range broken thermocouple 8000 range 100 0 C 400 0 C 100 0 1000 400 0 4000 100 1 1001 400 1 4001 or 8000 T if input value exceeds the range broken thermocouple 8000 range 100 0 C 1500 0 C 0 0 1500 0 15000 0 0 0 1500 1 15001 or 16000 R if input value exceeds...

Страница 1118: ... 7901 Range T type 100 1 C to 400 1 C 1001 to 4001 or 148 1 F to 752 1 F 1481 to 7521 Range R type 0 C to 1500 1 C 0 to 15001 or 32 F to 1590 1 F 320 to 15901 8000 when the thermocouple is broken This function block reads the analog input data from the FP0 TC4 TC8 unit and stores the digital values in the corresponding ínput channels Range C values digital values F values digital values K J Type 1...

Страница 1119: ...fbInstance10 iIOWordOffset iIOOffsetFP0 iIn1 fbInstance10 iChannel0 iIn2 fbInstance10 iChannel1 iIn3 fbInstance10 iChannel2 iIn4 fbInstance10 iChannel3 iIn5 fbInstance10 iChannel4 iIn6 fbInstance10 iChannel5 iIn7 fbInstance10 iChannel6 iIn8 fbInstance10 iChannel7 ...

Страница 1120: ...Reads data from the FPG A44 unit PLC types see page 1335 Wiring diagram EMC shield bar in proximity to the plug module Description This function block reads data from the FPG A44 unit The unit converts analog input data 0 10 V DC and 0 20 mA DC into 16 bit word digital output values ...

Страница 1121: ...98 12 00 39321 11 00 36044 10 00 32768 9 00 29491 8 00 26214 7 00 22937 6 00 19661 5 00 16384 4 00 13107 3 00 9830 2 00 6554 1 00 3277 0 00 0 Input voltage V range 0 00 10 00 V output value 10 00 65535 9 50 62258 9 00 58982 8 50 55705 8 00 52428 7 50 49151 7 00 45875 6 50 42598 6 00 39321 5 50 36044 5 00 32768 4 50 29491 4 00 26214 3 50 22937 3 00 19661 2 50 16384 2 00 13107 3 00 9830 2 00 6554 1 ...

Страница 1122: ...output type is set bSetOutChannel0ToCurrent bSetOutChannel3ToCurrent BOOL If TRUE the operation mode is set to the current output type for the corresponding output channel number Otherwise voltage output type is set Output variable uiInChannel0 uiInChannel3 UINT Stores the converted values from the corresponding channels Data types Example In this example the function has been programmed in ladder...

Страница 1123: ...Number 4 bSetInChannel0ToCurrent bSetInChannel0ToCurrent bSetInChannel1ToCurrent bSetInChannel1ToCurrent bSetInChannel2ToCurrent bSetInChannel2ToCurrent bSetInChannel3ToCurrent bSetInChannel3ToCurrent bSetOutChannel0ToCurrent bSetOutChannel0ToCurrent bSetOutChannel1ToCurrent bSetOutChannel1ToCurrent bSetOutChannel2ToCurrent bSetOutChannel2ToCurrent bSetOutChannel3ToCurrent bSetOutChannel3ToCurrent...

Страница 1124: ...nual FP0 Analog unit manual on your FPWIN Pro installation CD PLC types see see page 1333 Wiring of analog outputs I0 COM I1 COM I2 COM I3 COM NC A A A A OUTPUT A Analog device This function block reads data from the FP0 A04 current output type from the output channels 0 3 and stores the digital data in the input channels iOutChannel0 iOutChannel3 The valid range is from 4 20 mA 0 4000 ...

Страница 1125: ...0 values outside of range 1 4001 constant the converted value exactly is based on the latest valid input value Input variable Data type Function iIOWordOffset INT The offset of the first WX WY address of the RTD unit according to its position FP0R FP0 FP Sigma use ExpansionUnitToIOWordOffset_FP0 see page 1128 or unit 1 address 2 unit 2 address 4 unit 3 address 6 FP X use ExpansionUnotToIOWordOffse...

Страница 1126: ...ve been declared in the POU header Body If bEnable is set to TRUE the function block converts the digital data 0 4000 of the analog unit FP0 A04I with current output into analog data at the corresponding output channels 4 20mA LD ST IF bEnable THEN fbInstance2 iIOWordOffset iIOOffsetFP0 iOutChannel0 iOut1 iOutChannel1 iOut2 iOutChannel2 iOut3 iOutChannel3 iOut4 bPowerIsOn bOutPower2 bErrorChannel0...

Страница 1127: ...1333 The function block needs two PLC cycle scans to write all four channels into the FP0 A04V Unit Do not use pulse relay at EN input Wiring of analog outputs V0 COM V1 COM V2 COM V3 COM NC A A A A OUTPUT A Analog device Description This function block reads digital data from the FP0 A04 unit voltage output type from the output channels 0 3 and stores the analog data in the input channels iOutCha...

Страница 1128: ...est valid input value Input variable Data type Function iIOWordOffset INT The offset of the first WX WY address of the RTD unit according to its position FP0R FP0 FP Sigma use ExpansionUnitToIOWordOffset_FP0 see page 1128 or unit 1 address 2 unit 2 address 4 unit 3 address 6 FP X use ExpansionUnotToIOWordOffset_FPX_FP0 see page 1129 or FP0 adapter address of unit 1 address of unit 2 address of uni...

Страница 1129: ...der Body If bEnable is set to TRUE the function block converts the digital data 2000 2000 of the analog unit FP0 A04V with current output into analog data at the corresponding output channels 10 10V LD ST When programming with structured text enter the following IF bEnable THEN fbInstance4 iIOWordOffset iIOOffsetFP0 iOutChannel0 iOut1 iOutChannel1 iOut2 iOutChannel2 iOut3 iOutChannel3 iOut4 bPower...

Страница 1130: ...instruction calculates the word offset using an FP0 analog unit connected to an FP0 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body The function block conve...

Страница 1131: ...his instruction calculates the word offset using an FP0 analog unit connected to an FP X or FP X0 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body This instruct...

Страница 1132: ...FP0_A04I iIOWordOffset ExpansionUnitNumberToIOWordOffset_FPX_FP0 3 2 iOutChannel0 iAOutCh0 iOutChannel1 iAOutCh1 iOutChannel2 iAOutCh2 iOutChannel3 iAOutCh2 bPowerIsOn bPwrOn bErrorChannel0 bErrAOutCh0 bErrorChannel1 bErrAOutCh1 bErrorChannel2 bErrAOutCh2 bErrorChannel3 bErrAOutCh3 ...

Страница 1133: ......

Страница 1134: ...Chapter 37 GT panel instructions ...

Страница 1135: ...ation bit area dutGTWordArea GT_BasicComWordArea GT basic communication word area Output variable Data type Function bError BOOL Turns on when the screen is not switched within the communication timeout Description Function block to activate or change a specified GT screen from the PLC using the variables described in the table for data types Data types Example In this example the function has bee...

Страница 1136: ...ol Instructions LD ST fb_GT_ActivateScreen wScreenNum wNewPageNo tComTimeOut T 3s bDisableUserChange bHoldPage bActivateScreen bActivateNewPage dutGTBitArea g_GT_BitArea dutGTWordArea g_GT_WordArea bErrorActivateScreen bErrorActivateScreen ...

Страница 1137: ...TBitArea GT_BasicComBitArea GT basic communication bit area Output variable bError BOOL Turns on if the brightness value is out of range Description This instruction changes the backlight brightness of the GT Panel using the variables described in the table for data types Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU he...

Страница 1138: ...Chapter 38 High speed counter instructions ...

Страница 1139: ...se for beginners or users familiar with FPWIN GR Most of the information which is accessible via information and control functions is stored in special internal relays and special data registers These relays and registers can also be accessed using PLC independent system variables To take advantage of the features you prefer the instructions of both libraries can be mixed NOTE When programming wit...

Страница 1140: ...see page 1140 HscControl_CountingEnable see page 1142 HscControl_ElapsedValueContinue see page 1144 HscControl_ElapsedValueReset see page 1146 HscControl_HscInstructionClear see page 1148 HscControl_ResetInputDisable see page 1150 HscControl_ResetInputEnable see page 1151 HscControl_SetDefaults see page 1152 HscControl_WriteElapsedValue see page 1153 ...

Страница 1141: ...1327 Variable Data type Function iChannel INT High speed counter channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction disables counting on the high speed counter channel specified by iChannel Bit 1 of the high speed counter control code see page 891 is set to TRUE Data types Example In this example the function has been...

Страница 1142: ...igh speed counter instructions 1141 Part IV Tool Instructions ST When programming with structured text enter the following if DF bDisableCounting then HscControl_CountingDisable iChannel iChannel end_if ...

Страница 1143: ...el INT High speed counter channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction enables counting on the high speed counter channel specified by iChannel after counting has been disabled with HscControl_CountingDisable see page 1139 Bit 1 of the high speed counter control code see page 891 is set to FALSE Data types Examp...

Страница 1144: ...High speed counter instructions 1143 Part IV Tool Instructions ST When programming with structured text enter the following if DF bEnableCounting then HscControl_CountingEnable iChannel iChannel end_if ...

Страница 1145: ... Data type Function iChannel INT High speed counter channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction resumes counting on the channel specified by iChannel after a reset of the elapsed value using HscControl_ElapsedValueReset see page 1145 Bit 0 of the high speed counter control code see page 891 is set to FALSE Data...

Страница 1146: ... speed counter instructions 1145 Part IV Tool Instructions ST When programming with structured text enter the following if bElapsedValueContinue then HscControl_ElapsedValueContinue iChannel iChannel end_if ...

Страница 1147: ...e 1327 Variable Data type Function iChannel INT High speed counter channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction sets the elapsed value of the high speed counter channel specified by iChannel to 0 Bit 0 of the high speed counter control code see page 891 is set to TRUE Data types Example In this example the funct...

Страница 1148: ...igh speed counter instructions 1147 Part IV Tool Instructions ST When programming with structured text enter the following if bResetElapsedValue then HscControl_ElapsedValueReset iChannel iChannel end_if ...

Страница 1149: ...1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction cancels the execution of a high speed counter instruction on the channel specified by iChannel Bit 3 of the high speed counter control code see page 891 is set to TRUE and subsequently reset to FALSE Data types Example In this example the function has been programmed in ladder diagram LD and...

Страница 1150: ...gh speed counter instructions 1149 Part IV Tool Instructions When programming with structured text enter the following if bClearHscInstruction then HscControl_HscInstructionClear iChannel iChannel end_if ...

Страница 1151: ... X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction disables the reset input of the high speed counter channel specified by iChannel Bit 2 of the high speed counter control code see page 891 is set to TRUE Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming la...

Страница 1152: ...T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction enables the reset input of the channel specified by iChannel Bit 2 of the high speed counter control code see page 891 is set to FALSE Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages P...

Страница 1153: ...FP0 0 1 FP e 0 1 Description This instruction sets all bits of the high speed counter control code see page 891 of the channel specified by iChannel to 0 0 is the default setting Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for ...

Страница 1154: ...ramming window PLC types see page 1327 Variable Data type Function diElapsedValue DINT Elapsed value to be written into the channel specified by iChannel iChannel INT High speed counter channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction writes an elapsed value into the high speed counter channel specified by iChannel ...

Страница 1155: ...unter instructions 1154 Part IV Tool Instructions LD ST When programming with structured text enter the following if DF bWrite then HscControl_WriteElapsedValue diElapsedValue diElapsedValue iChannel iChannel end_if ...

Страница 1156: ...etControlCode see page 1156 HscInfo_GetCurrentSpeed see page 1157 HscInfo_IsActive see page 1158 HscInfo_IsChannelEnabled see page 1159 HscInfo_IsCountingDisabled see page 1160 HscInfo_IsElapsedValueReset see page 1161 HscInfo_IsResetInputDisabled see page 1162 HscInfo_ReadElapsedValue see page 1164 HscInfo_ReadTargetValue see page 1165 ...

Страница 1157: ...variable WORD Stores the control code Description This instruction returns the control code see page 891 of the high speed counter channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this f...

Страница 1158: ...nt speed of the channel specified by iChannel Description This instruction returns the current speed in Hz of the high speed counter channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this...

Страница 1159: ...e BOOL TRUE if the high speed counter channel specified by iChannel is active Description This instruction evaluates the high speed counter control flag and returns TRUE if the high speed counter channel specified by iChannel is active Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming lang...

Страница 1160: ...nnel specified by iChannel is enabled Description This instruction returns TRUE if the high speed counter channel specified by iChannel has been enabled in the system registers and is supported by the selected PLC type Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header ...

Страница 1161: ...T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable BOOL TRUE if counting on the channel specified by iChannel is disabled Description This instruction returns TRUE if counting on the channel specified by iChannel has been disabled Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming lang...

Страница 1162: ... 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable BOOL TRUE if the channel specified by iChannel has been reset Description This instruction returns TRUE if the elapsed value of the high speed counter channel specified by iChannel has been reset to 0 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all ...

Страница 1163: ... C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable BOOL TRUE if the reset input of the channel specified by iChannel is disabled Description This instruction returns TRUE if the reset input of the channel specified by iChannel has been disabled Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for al...

Страница 1164: ...High speed counter instructions 1163 Part IV Tool Instructions ...

Страница 1165: ... 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable DINT Stores the elapsed value from the channel specified by iChannel Description This instruction reads the elapsed value from the high speed counter channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU...

Страница 1166: ...he target value of the channel specified by iChannel Description This instruction reads the target value from the high speed counter channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this...

Страница 1167: ... speed counter instructions 1166 Part IV Tool Instructions 38 4 High speed counter target value match control In this section Hsc_TargetValueMatch_Reset see page 1167 Hsc_TargetValueMatch_Set see page 1169 ...

Страница 1168: ...s is an optional descriptor at the beginning and the end of the pattern Optiona l Fixed pattern Optional g_b Hsc_TargetValueMatch_ChannelA_Y11F _MotorOn This global variable generates the code for channel A and output Y11F PLC types See 1327 Input variable Data type Function bExecute BOOL A rising edge activates the function evaluate the high speed counter control flag using HscInfo_IsActive see p...

Страница 1169: ... output variables used for programming this function have been declared in the POU header Body Use HscInfo_IsActive see page 1157 to evaluate the channel specified by iChannel1 If a rising edge is detected at bReset and if bIsActive is not TRUE the instruction is executed The combination of channel number and output contact is validated in the global variable g_bHsc_TargetValueMatch_Channel1_Y7_Ye...

Страница 1170: ...s an optional descriptor at the beginning and the end of the pattern Optional Fixed pattern Optional g_b Hsc_TargetValueMatch_ChannelA_Y11F _MotorOn This global variable generates the code for channel A and output Y11F PLC types See 1327 Input variable Data type Function bExecute BOOL A rising edge activates the function evaluate the high speed counter control flag using HscInfo_IsActive see page ...

Страница 1171: ...nput and output variables used for programming this function have been declared in the POU header Body Use HscInfo_IsActive see page 1157 to evaluate the channel specified by iChannel1 If a rising edge is detected at bSet and if bIsActive is not TRUE the instruction is executed The combination of channel number and output contact is validated in the global variable g_bHsc_TargetValueMatch_Channel1...

Страница 1172: ...Chapter 39 Pulse output instructions ...

Страница 1173: ... beginners or users familiar with FPWIN GR Most of the information which is accessible via information and control functions is stored in special internal relays and special data registers These relays and registers can also be accessed using PLC independent system variables To take advantage of the features you prefer the instructions of both libraries can be mixed NOTE When programming with the ...

Страница 1174: ... see page 1174 PulseOutput_Home_FB see page 1177 PulseOutput_Jog_FB see page 1180 PulseOutput_Jog_Positioning0_FB see page 1182 PulseOutput_Jog_Positioning1_FB see page 1185 PulseOutput_Jog_TargetValue_FB see page 1187 PulseOutput_Linear_FB see page 1189 PulseOutput_Pass_FB see page 1192 PulseOutput_Trapezoidal_FB see page 1195 ...

Страница 1175: ...Use PulseInfo_IsActive see page 1223 to check if the control flag for the selected channel is FALSE PLC types see see page 1329 Description Pulses are output from two channels in accordance with the parameters in the function block and in the specified DUT so that the path to the target position forms an arc The radius of the circle is calculated by specifying the center position and the end posit...

Страница 1176: ...7 dutChannelConfiguration_X_Y Predefined system DUT for channel configuration PulseOutput_Channel_Configuration_DUT Channel 0 2 Output variable Data type Function bError BOOL Refers to an internal mismatch of input values to avoid a PLC error diRadius DINT Radius pulses Data types Example In this example the function has been programmed in ladder diagram LD Please refer to the online help for a st...

Страница 1177: ...Pulse output instructions 1176 Part IV Tool Instructions LD ...

Страница 1178: ...ol flag for the selected channel is FALSE Use PulseInfo_IsHomeInputTrue see page 1227 to check if the home input is TRUE Note the following to avoid malfunctions or an operation error Ensure to set the system register to pulse output mode with home input The home input may not be occupied by other instructions like pulse catch input interrupt input or high speed counter PLC types see page 1330 Des...

Страница 1179: ...in steps of 60 Acceleration deceleration time FP0 FP e 30ms 32760ms Acceleration time FP0R 1ms 32760ms diDecelerationTime Deceleration time FP0R 1ms 32760ms diCreepSpeed DINT Creep speed FP0R 1 to 50000 1Hz 50kHz dutChannelConfiguration Predefined system DUT for channel configuration PulseOutput_Channel_Configuration_DUT Output variable Data type Function bError BOOL Refers to an internal mismatch...

Страница 1180: ...Pulse output instructions 1179 Part IV Tool Instructions LD ...

Страница 1181: ...utput_Channel_Configuration_DUT FP FP X 1 to 9800 1 5Hz 9 8kHz 48 to 100000 48Hz 100kHz 191 to 100000 191 100kHz FP0R 1 to 50000 1Hz 50kHz FP0 FP e 40 to 5000 40Hz 5kHz diAccelerationTime Acceleration time FP0R 1ms 32760ms up to the maximum speed diDecelerationTime DINT Deceleration time FP0R 1ms 32760ms from the maximum speed dutChannelConfiguration Predefined system DUT for channel configuration...

Страница 1182: ...1181 Part IV Tool Instructions DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been declared in the POU header Body LD ...

Страница 1183: ...always otherwise an error is output diInitialAndFinalSpeed Initial and final speed FP0R 1 to 50000 1Hz 50kHz diTargetSpeed Target speed Set this value according to the frequency range selected in PulseOutput_Channel_Configuration_DUT FP FP X 1 to 9800 1 5Hz 9 8kHz 48 to 100000 48Hz 100kHz 191 to 100000 191 100kHz FP0R 1 to 50000 1Hz 50kHz FP0 FP e 40 to 5000 40Hz 5kHz diAccelerationTime Accelerati...

Страница 1184: ...tem registers or if bAbsolute is TRUE Example In this example the function has been programmed in ladder diagram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been...

Страница 1185: ...Pulse output instructions 1184 Part IV Tool Instructions LD ...

Страница 1186: ...always otherwise an error is output diInitialAndFinalSpeed Initial and final speed 1 to 50000 1Hz 50kHz diTargetSpeed1 Target speed 1 to 50000 1Hz 50kHz diAccelerationTime Acceleration time 1ms 32760ms diTargetSpeed2 Target speed 1 to 50000 1Hz 50kHz diChangeTime Change time 1ms 32760ms diDecelerationTime Deceleration time 1ms 32760ms diTargetValue DINT Target value pulses 2147483648 2147483647 du...

Страница 1187: ...diagram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been declared in the POU header LD ...

Страница 1188: ...o the frequency range selected in PulseOutput_Channel_Configuration_DUT FP FP X 1 to 9800 1 5Hz 9 8kHz 48 to 100000 48Hz 100kHz 191 to 100000 191 100kHz FP0R 1 to 50000 1Hz 50kHz FP0 FP e 40 to 5000 40Hz 5kHz diAccelerationTime Acceleration time FP0R 1ms 32760ms up to the maximum speed diDecelerationTime Deceleration time FP0R 1ms 32760ms from the maximum speed diTargetValue DINT Target value puls...

Страница 1189: ...agram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been declared in the POU header Body LD ...

Страница 1190: ...target value pulses 8388608 8388607 diTargetValue_Y DINT Y axis target value pulses 8388608 8388607 dutChannelConfiguration_X_Y Predefined system DUT for channel configuration PulseOutput_Channel_Configuration_DUT For interpolation channel 0 and 1 or channel 2 and 3 are used as pairs You may only specify 0 or 2 for C14T 0 only Output variable Data type Function bError BOOL Refers to an internal mi...

Страница 1191: ...r diagram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been declared in the POU header ...

Страница 1192: ...Pulse output instructions 1191 Part IV Tool Instructions LD ...

Страница 1193: ...ed Target speed Composite speed of both axes 100 20000 100Hz 20kHz diTargetValue_X diTargetValue_Y diPassValue_X diPassValue_Y DINT Target value pulses 8388608 8388607 dutChannelConfiguration_X_Y Predefined system DUT for channel configuration PulseOutput_Channel_Configuration_DUT Channel 0 2 Output variable Data type Function bError BOOL Refers to an internal mismatch of input values to avoid a P...

Страница 1194: ...r diagram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for programming this function have been declared in the POU header ...

Страница 1195: ...Pulse output instructions 1194 Part IV Tool Instructions LD ...

Страница 1196: ...l_Configuration_DUT FP FP X 1 to 9800 1 5Hz 9 8kHz 48 to 100000 48Hz 100kHz 191 to 100000 191 100kHz FP0R 1 to 50000 1Hz 50kHz FP0 FP e 40 to 5000 40Hz 5kHz diTargetSpeed Target speed Set this value according to the frequency range selected in PulseOutput_Channel_Configuration_DUT FP FP X 1 to 9800 1 5Hz 9 8kHz 48 to 100000 48Hz 100kHz 191 to 100000 191 100kHz FP0R 1 to 50000 1Hz 50kHz FP0 FP e 40...

Страница 1197: ... an internal mismatch of input values to avoid a PLC error Data types Example In this example the function has been programmed in ladder diagram LD Please refer to the online help for a structured text ST example The same POU header is used for all programming languages DUT Use the following predefined DUT PulseOutput_Channel_Configuration_DUT POU header All input and output variables used for pro...

Страница 1198: ...Pulse output instructions 1197 Part IV Tool Instructions LD ...

Страница 1199: ...tedStop see page 1203 PulseControl_ElapsedValueContinue see page 1205 PulseControl_ElapsedValueReset see page 1207 PulseControl_JogPositionControl see page 1209 PulseControl_NearHome see page 1210 PulseControl_PulseOutputContinue see page 1212 PulseControl_PulseOutputStop see page 1214 PulseControl_SetDefaults see page 1216 PulseControl_WriteElapsedValue see page 1217 Pulse_TargetValueMatchClear s...

Страница 1200: ...gramming window PLC types see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable BOOL TRUE if pulse counting has been disabled Description This instruction disables counting on the channel specified by iChannel Bit 1 of the pulse output control code see page 1021 is s...

Страница 1201: ...Pulse output instructions 1200 Part IV Tool Instructions ST When programming with structured text enter the following if DF bDisableCounting then PulseControl_CountingDisable iChannel iChannel end_if ...

Страница 1202: ...LC types see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction enables counting on the pulse output channel specified by iChannel after counting has been disabled with PulseControl_CountingDisable see page 1198 Bit 1 of the pulse output control code see ...

Страница 1203: ...Pulse output instructions 1202 Part IV Tool Instructions ST When programming with structured text enter the following if DF bEnableCounting then PulseControl_CountingEnable iChannel iChannel end_if ...

Страница 1204: ... Shift v in the programming window PLC types see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction performs a decelerated stop on the channel specified by iChannel When a decelerated stop is requested during acceleration deceleration is performed with th...

Страница 1205: ...Pulse output instructions 1204 Part IV Tool Instructions ST When programming with structured text enter the following if DF bDeceleratedStop then PulseControl_DeceleratedStop iChannel iChannel end_if ...

Страница 1206: ... press Ctrl Shift v in the programming window PLC types see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction resumes pulse counting on the channel specified by iChannel after a reset of the elapsed value using PulseControl_ElapsedValueReset see page 120...

Страница 1207: ...lse output instructions 1206 Part IV Tool Instructions ST When programming with structured text enter the following if bElapsedValueContinue then PulseControl_ElapsedValueContinue iChannel iChannel end_if ...

Страница 1208: ... Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction sets the elapsed value of the pulse output channel specified by iChannel to 0 Bit 0 of the pulse output control code see page 1021 is set to TRUE Use PulseControl_ElapsedValueContinue see page 1204 to continue counting on the pulse output channel Use Pul...

Страница 1209: ...Pulse output instructions 1208 Part IV Tool Instructions ST When programming with structured text enter the following if bElapsedValueReset then PulseControl_ElapsedValueReset iChannel iChannel end_if ...

Страница 1210: ...trol code see page 1021 to start position control on the channel specified by iChannel The position control trigger is used with the JOG operation instructions PulseOutput_Jog_Positioning0_FB see page 1181 and PulseOutput_Jog_Positioning1_FB see page 1184 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for ...

Страница 1211: ...v in the programming window PLC types see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction starts deceleration on the channel specified by iChannel when near the home input by setting bit 4 of the pulse output control code see page 1021 to TRUE and back...

Страница 1212: ...Pulse output instructions 1211 Part IV Tool Instructions ST When programming with structured text enter the following if DF bSetNearHome then PulseControl_NearHome iChannel iChannel end_if ...

Страница 1213: ...pes see page 1329 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction continues pulse output at the channel specified by iChannel after pulse output has been stopped using PulseControl_PulseOutputStop see page 1213 Bit 3 of the pulse output control code see page 102...

Страница 1214: ...se output instructions 1213 Part IV Tool Instructions ST When programming with structured text enter the following if DF bContinuePulseOutput then PulseControl_PulseOutputContinue iChannel iChannel end_if ...

Страница 1215: ...e Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction stops the pulse output on the channel specified by iChannel by setting bit 3 of the pulse output control code see page 1021 to TRUE Use PulseControl_PulseOutputContinue see page 1211 to continue pulse output after the int...

Страница 1216: ...Pulse output instructions 1215 Part IV Tool Instructions When programming with structured text enter the following if DF bStopPulseOutput then PulseControl_PulseOutputStop iChannel iChannel end_if ...

Страница 1217: ...0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction sets all bits of the pulse output control code see page 1021 of the channel specified by iChannel to 0 0 is the default setting Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming la...

Страница 1218: ...Recently used from the context menu or press Ctrl Shift v in the programming window PLC types see page 1329 Variable Data type Function diElapsedValue DINT Elapsed value to be written into the channel specified by iChannel iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction writes an elapsed v...

Страница 1219: ...tructions 1218 Part IV Tool Instructions LD ST When programming with structured text enter the following if DF bWriteElapsedValue then PulseControl_WriteElapsedValue ElapsedValue diElapsedValue iChannel iChannel end_if ...

Страница 1220: ...C types see page 1335 Variable Data type Function iChannel INT Pulse output channel FP 0 2 FP X R 0 1 FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction clears the target value match control on the channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The s...

Страница 1221: ... see page 1226 PulseInfo_IsElapsedValueReset see page 1227 PulseInfo_IsHomeInputTrue see page 1228 PulseInfo_IsPulseOutputStopped see page 1229 PulseInfo_IsTargetValueMatchActive see page 1230 PulseInfo_ReadAccelerationForbiddenAreaStartingPosition see page 1231 PulseInfo_ReadCorrectedFinalSpeed see page 1232 PulseInfo_ReadCorrectedInitialSpeed see page 1233 PulseInfo_ReadElapsedValue see page 123...

Страница 1222: ... Stores the control code Description This instruction returns the control code see page 1021 of the pulse output channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been ...

Страница 1223: ...1 FP e 0 1 dutMemory PulseInfo_GetCurrentSpeed_DUT diCurrentSpeed DINT Current speed in Hz Description This instruction returns the current speed in Hz of the pulse output channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages DUT Use the following predef...

Страница 1224: ...ions 1223 Part IV Tool Instructions ST When programming with structured text enter the following if bGetCurrentSpeed then PulseInfo_GetCurrentSpeed iChannel iChannel dutMemory Memory_DUT diCurrentSpeed diCurrentSpeed end_if ...

Страница 1225: ...active Description This instruction evaluates the pulse output control flag and returns TRUE if the pulse output channel specified by iChannel is active Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function ...

Страница 1226: ...specified by iChannel is enabled Description This instruction returns TRUE if the pulse output channel specified by iChannel has been enabled in the system registers and is supported by the selected PLC type Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input a...

Страница 1227: ... FP X 16K C14T 0 1 2 FP X 32K C30T C60T 0 1 2 3 FP0R 0 1 2 3 FP0 0 1 FP e 0 1 Description This instruction returns TRUE if counting on the channel specified by iChannel has been disabled Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables u...

Страница 1228: ...FP0 0 1 FP e 0 1 Output variable BOOL TRUE if the channel specified by iChannel has been reset Description This instruction returns TRUE if the elapsed value of the pulse output channel specified by iChannel has been reset to 0 Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages PO...

Страница 1229: ...This instruction returns TRUE if the home input of the channel specified by iChannel is TRUE Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this function have been declared in the POU header Body LD ST When program...

Страница 1230: ... returns TRUE if pulse output has been stopped e g with PulseControl_DeceleratedStop see page 1202 or PulseControl_PulseOutputStop see page 1213 Use PulseControl_PulseOutputContinue see page 1211 to resume pulse output Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header ...

Страница 1231: ...0 0 1 FP e 0 1 Output variable BOOL TRUE if target value match control is active Description This instruction returns TRUE if target value match control see page 1237 is active on the channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All i...

Страница 1232: ...den area Description This instruction reads the starting position of an acceleration forbidden area If the elapsed value crosses over this position when the speed is being changed acceleration cannot be continued any more Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU head...

Страница 1233: ... Stores the value of the corrected final speed Description This instruction returns the value of the corrected final speed on the channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this fu...

Страница 1234: ...tores the value of the corrected initial speed Description This instruction returns the value of the corrected initial speed on the channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programming this ...

Страница 1235: ...psed value from the channel specified by iChannel Description This instruction reads the elapsed value from the pulse output channel specified by iChannel Use PulseControl_WriteElapsedValue see page 1216 to modify the elapsed value and PulseControl_ElapsedValueReset see page 1206 to set the elapsed value to 0 Data types Example In this example the function has been programmed in ladder diagram LD ...

Страница 1236: ...INT Stores the target value of the channel specified by iChannel Description This instruction reads the target value from the pulse output channel specified by iChannel Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST The same POU header is used for all programming languages POU header All input and output variables used for programmin...

Страница 1237: ...P0R 0 1 2 3 FP0 0 1 FP e 0 1 Output variable DINT Stores the output control target value Description This instruction returns the output control target value of the pulse output channel specified by iChannel The output control target value is used by the target value match instructions Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST T...

Страница 1238: ...Pulse output instructions 1237 Part IV Tool Instructions 39 5 Pulse output target value match control In this section Pulse_TargetValueMatch_Reset see page 1238 Pulse_TargetValueMatch_Set see page 1241 ...

Страница 1239: ...hannel d must be a pulse output channel number enabled in the system registers Y d must be an explicit output address supported by the PLC FP FP0 FP e Y0 Y7 FP V3 1 or higher FP0R Y0 Y1F FP X Y0 Y29F s is an optional descriptor at the beginning and the end of the pattern Y d must be an explicit output address supported by the PLC FP FP0 FP e Y0 Y7 FP V3 1 or higher FP0R Y0 Y1F FP X Y0 Y29F s is an...

Страница 1240: ...set does not match a valid combination of channel number and output relay as determined by the global variable Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST ST The same POU header is used for all programming languages GVL In the global variable list you define variables that can be accessed by all POUs in the project POU header All ...

Страница 1241: ...ST bIsActive PulseInfo_IsTargetValueMatchActive iChannel1 Pulse_TargetValueMatch_Reset bExecute DF bReset AND NOT bIsActive iChannel iChannel1 pYOutput GetPointer g_bPulse_TargetValueMatch_Channel1_Y19_Motor1_On diTargetValue diTargetValue1 bError bErrorReset ...

Страница 1242: ...nnel d must be a pulse output channel number enabled in the system registers Y d must be an explicit output address supported by the PLC FP FP0 FP e Y0 Y7 FP V3 1 or higher FP0R Y0 Y1F FP X Y0 Y29F s is an optional descriptor at the beginning and the end of the pattern Y d must be an explicit output address supported by the PLC FP FP0 FP e Y0 Y7 FP V3 1 or higher FP0R Y0 Y1F FP X Y0 Y29F s is an o...

Страница 1243: ...Offset does not match a valid combination of channel number and output relay as determined by the global variable Data types Example In this example the function has been programmed in ladder diagram LD and structured text ST ST The same POU header is used for all programming languages GVL In the global variable list you define variables that can be accessed by all POUs in the project POU header A...

Страница 1244: ...ons ST bIsActive PulseInfo_IsTargetValueMatchActive iChannel1 Pulse_TargetValueMatch_Set bExecute DF bSet AND NOT bIsActive iChannel iChannel1 pYOutput GetPointer g_bPulse_TargetValueMatch_Channel1_YA_Horn1_On diTargetValue diTargetValue0 bError bErrorSet ...

Страница 1245: ......

Страница 1246: ...Chapter 40 Appendix Programming Information ...

Страница 1247: ...uctions GetPointer Provides pointer information AreaOffs_ToVar Copies the content of an address specified by memory area and address offset to a variable with Enable Var_ToAreaOffs Copies the value of a variable to an address specified by memory area and address offset to a variable with Enable Is_AreaDT Yields TRUE if the memory area of a variable is a DT area with Enable Is_AreaFL Yields TRUE if...

Страница 1248: ...t control a specific SFC StartStopSfc StartStopSfcAndInitData Stops and restarts a specific Sequential Function Chart SFC program ControlSfc ControlSfcAndData Controls a specific Sequential Function Chart SFC program ActivateStepsOfStoppedSfc Continues a Sequential Function Chart SFC program that has been stopped Instructions that reveal the statuses of a specific SFC SfcStopped Indicates whether ...

Страница 1249: ...nt data subtract SUB F312_FMUL Floating point data multiply MUL F313_FDIV Floating point data divide DIV F314_FSIN Floating point Sine operation SIN F315_FCOS Floating point Cosine operation COS F316_FTAN Floating point Tangent operation TAN F317_ASIN Floating point Arcsine operation ASIN F318_ACOS Floating point Arccosine operation ACOS F319_ATAN Floating point Arctangent operation ATAN F320_LN F...

Страница 1250: ...x Programming Information 1249 Name Function Equivalent IEC function used with EN ENO F345_FCMP Floating point data compare GE GT EQ LE LT NE F347_FLIMT Floating point data upper and lower limit control LIMIT ...

Страница 1251: ...nt value Example Modifying a memory area address Address Base address value in IX IY IZ through ID Modifying DT11 IXDT11 11 11 11 DT11 DT21 DT1 0 10 10 Base address Target address IX value When the index register is used as an address modifier be sure to check that the shifted address does not exceed its last address If the shifted address exceeds its last address an operation error occurs When a ...

Страница 1252: ...issa 23 bit 0 positive 1 negative Sign bit Numbers which can be used are 1 175494 x 10 38 to 3 402823 x 1038 40 4 2 BCD Type Constant BCD type floating point constants are processed as three words as shown below Example DTx DTx 1 DTx 2 Sign 0 when positive 1 when negative Integer Decimal Numbers which can be used are as follows 9999 9999 to 9999 9999 The principal instructions which allow use of B...

Страница 1253: ...n in the diagram Binary 16 bit processing 32767 7FFF 1 0 1 16 0001 16 0000 16 FFFF 32767 8000 IX value Max value Min value Overflow Underflow Maximum and minimum values form a loop Example 1 32767 1 overflow The result of processing will be K 32768 and the carry flag will turn ON Example 2 32768 1 underflow The result of processing will be 32767 and the carry flag will turn ON BCD 4 digit processi...

Страница 1254: ...1011 0000 0000 0000 1001 0000 0000 0000 1000 16 17 18 19 20 21 22 23 0000 0000 0001 0000 0000 0000 0001 0001 0000 0000 0001 0010 0000 0000 0001 0011 0000 0000 0001 0100 0000 0000 0001 0101 0000 0000 0001 0110 0000 0000 0001 0111 0000 0000 0001 0110 0000 0000 0001 0111 0000 0000 0001 1000 0000 0000 0001 1001 0000 0000 0010 0000 0000 0000 0010 0001 0000 0000 0010 0010 0000 0000 0010 0011 0000 0000 0...

Страница 1255: ...d special internal relays use the PLC independent system variables You can insert system variables directly into the POU body Use the Variables dialog without entering a declaration in the POU header REFERENCE Please refer to the FPWIN Pro online help for detailed information on using system variables ...

Страница 1256: ...d internally as a flag Memory area words Available address area Type Memory size F P IEC Function External input relays 13 WX0 WX12 IW0 IW12 Code for specifying 16 external input points as one word 16 bits of data External output relays 13 WY0 WY12 QW0 QW12 Code for specifying 16 external output points as one word 16 bits of data Internal relays 1 63 WR0 WR62 MW0 0 MW0 62 Code for specifying 16 in...

Страница 1257: ... counter number Timer counter elapsed value area 1 2 72 DEV0 DEV142 MD4 0 MD4 142 Data memory for storing the elapsed values during operation of timers or counters The values are stored by timer counter number Special data registers 56 DDT90000 DDT90110 MD5 90000 MD5 90110 Data memory for storing settings and error codes Index registers 1 DI0 MD6 0 Data memory used to modify constants and memory a...

Страница 1258: ... MX2 1008 MX2 1023 Turn on when the value set with a TM instruction for the timer with the same number has reached 0 Counter relays 2 3 1024 C1008 C1023 T0 T1007 MX2 1008 MX2 1023 MX1 0 MX1 1007 Turn on when the value set with a CT instruction for the counter with the same number has reached 0 Special internal relays 224 R9000 R913F MX0 900 0 MX0 913 15 Turn on or off based on specific conditions ...

Страница 1259: ...Y0 DWY108 QD0 QD108 Code for specifying 32 external output points as a double word 32 bits of data Internal relays 2 128 DWR0 DWR254 MD0 0 MD0 254 Code for specifying 32 internal relay points as a double word 32 bits of data Link relays 64 DWL0 DWL126 MD7 0 MD7 126 Code for specifying 32 link relay points as a double word 32 bits of data C10 C14 C16 6157 DDT0 DDT12311 MD5 0 MD5 12311 Data register...

Страница 1260: ...15 Turn on or off based on external input External output relays 1 1184 Y0 Y73F QX0 0 QX73 15 Turn on or off external outputs based on the operation result Internal relays 2 4096 R0 R255F MX0 0 MX0 255 15 Used internally by the PLC program to store bit information Link relays 2 2048 L0 L127F MX7 0 0 MX7 63 15 Shared by multiple PLCs connected using PLC link Timer relays 2 3 1024 T0 T1007 C1008 C10...

Страница 1261: ...g 32 external input points as a double word 32 bits of data External output relays 1 37 DWY0 DWY72 QD0 QD72 Code for specifying 32 external output points as a double word 32 bits of data Internal relays 2 128 DWR0 DWR254 MD0 0 MD0 254 Code for specifying 32 internal relay points as a double word 32 bits of data Link relays 64 DWL0 DWL126 MD7 0 MD7 126 Code for specifying 32 link relay points as a ...

Страница 1262: ... QX0 0 QX109 15 Turn on or off external outputs based on the operation result Internal relays 2 4096 R0 R255F MX0 0 0 MX0 255 15 Used internally by the PLC program to store bit information Link relays 2 2048 L0 L127F MX7 0 0 MX7 127 15 Shared by multiple PLCs connected using PLC link Timer relays 2 3 1024 T0 T1007 C1008 C1023 MX1 0 MX1 1007 MX2 1008 MX2 1023 Turn on when the value set with a TM in...

Страница 1263: ...1 55 DWX0 DWX108 ID0 ID108 Code for specifying 32 external input points as a double word 32 bits of data External output relays 1 55 DWY0 DWY108 QD0 QD108 Code for specifying 32 external output points as a double word 32 bits of data Internal relays 2 128 DWR0 DWR254 MD0 0 MD0 254 Code for specifying 32 internal relay points as a double word 32 bits of data Link relays 64 DWL0 DWL126 MD7 0 MD7 126...

Страница 1264: ...ee 3 The number of points for timer and counter relays can be changed using system register 5 The numbers in the table are the default settings 40 7 5 Relays and memory areas for FP e Relays bits Available address area Type Memory size F P IEC Function External input relays 1 208 X0 X12F IX0 0 IX12 15 Turn on or off based on external input External output relays 1 208 Y0 Y12F QX0 0 QX12 15 Turn on...

Страница 1265: ...dex registers 2 IX IY MW6 0 MW6 1 Data memory used to modify constants and memory area addresses Memory area double words Available address area Type Memory size F P IEC Function External input relays 1 6 DWX0 DWX11 ID0 ID11 Code for specifying 32 external input points as a double word 32 bits of data External output relays 1 6 DWY0 DWY11 QD0 QD11 Code for specifying 32 external output points as a...

Страница 1266: ... relays Non hold type Non hold type From specified value to C139 Counter relays Hold type Non hold type 4 points elapsed values C140 C143 1 Non hold type 976 points R0 R60F 61 words WR0 WR60 Internal relays Hold type 32 points R610 R62F 2 words WR61 WR62 Non hold type 1652 words DT0 DT1651 Data registers Hold type 8 words DT1652 DT1659 1 A battery must be installed 40 7 6 Relays and memory areas f...

Страница 1267: ... units one word Link registers 1 256 LD0 LD255 MW8 0 MW8 255 Data memory shared by multiple PLCs connected using PLC link Data is handled in 16 bit units one word Timer counter set value area 1 1024 SV0 SV1023 MW3 0 MW3 1023 Data memory for storing the set values of timers or counters The values are stored by timer counter number Timer counter elapsed value area 1 1024 EV0 EV1023 MW4 0 MW4 1023 Da...

Страница 1268: ...1022 Data memory for storing the elapsed values during operation of timers or counters The values are stored by timer counter number 12k type 7166 DFL0 DFL14331 MD9 0 MD9 14331 File registers 1 3 32k type expanded 15358 DFL0 DFL30715 MD9 0 MD9 30715 Data memory used in a program Data is handled in 16 bit units one word Special data registers 128 DDT90000 DDT90254 MD5 90000 MD5 90254 Data memory fo...

Страница 1269: ...larm relays 2048 E0 E127F MX10 0 0 MX10 127 15 Turns on in the event of error The error history is stored in dedicated data registers Special internal relays 176 R9000 R910F MX0 900 0 MX0 910 15 Turn on or off based on specific conditions Used internally as a flag Memory area words Available address area Type Memory size F P IEC Function External input relays 512 WX0 WX127 IW0 IW127 Code for speci...

Страница 1270: ...ouble word 32 bits of data Internal relays 2 443 DWR0 DWR885 MD0 0 MD0 885 Code for specifying 32 internal relay points as a double word 32 bits of data Link relays 320 DWL0 DWL638 MD7 0 MD7 638 Code for specifying 32 link relay points as a double word 32 bits of data Data registers 2 5120 DDT0 DDT10238 MD5 0 MD5 10238 Data memory used in a program Data is handled in 32 bit units double word Link ...

Страница 1271: ...lly by the PLC program to store bit information Link relays 1 10240 L0 L639F MX7 0 0 MX7 639 15 Shared by multiple PLCs connected using PLC link Timer relays 1 2 3072 T0 T2999 C3000 C3071 MX1 0 MX1 2999 MX2 3000 MX2 3071 Turn on when the value set with a TM instruction for the timer with the same number has reached 0 Counter relays 1 2 3072 C3000 C3071 T0 T2999 MX2 3000 MX2 3071 MX1 0 MX1 2999 Tur...

Страница 1272: ... program Special data registers 512 DT90000 DT90511 MW5 90000 MW5 90511 Data memory for storing settings and error codes Index registers 14 I0 ID MW6 0 MW6 13 Data memory used to modify constants and memory area addresses Memory area double words Available address area Type Memory size F P IEC Function External input relays 1 256 DWX0 DWX510 ID0 ID510 Code for specifying 32 external input points a...

Страница 1273: ...data registers 265 DDT90000 DDT90510 MD5 90000 MD5 90510 Data memory for storing settings and error codes Index registers 7 DI0 DID MD6 0 MD6 13 Data memory used to modify constants and memory area addresses 1 There are two memory types the hold type that saves the conditions that exist just before turning the power off or changing from RUN to PROG mode and the non hold type that resets them The h...

Страница 1274: ... are always in the hold area and used by the compiler 1 2 3 Procedure 1 Double click PLC 2 Double click System Registers A list with all system registers will be displayed The number indicated in parentheses is identical to the system register number In Memory Size 0 3 you define the memory sizes for machine programs for example You will find a list with all system registers and the memory size of...

Страница 1275: ...meout when MEWNET F slave stations are connected PLC Link These settings are for using link relays and link registers in MEWNET W0 PLC link communication Note that PLC Link is not the default setting PROFIBUS MEWNET H Set the data size to be processed during one scan High Speed Counter Pulse Catch Input Interrupt Input When using the high speed counter function pulse catch function or interrupt fu...

Страница 1276: ...on PLC type 16k 32k type Act on Error No Name Default Values 4 Battery error indication Disable Disable When a battery error occurs a self diagnostic error is not issued and the ERROR LED will not flash Enable When a battery error occurs a self diagnostic error is issued and the ERROR will LED flash 4 DF P function leading falling edge detection Holds result Holds result disregards result 20 Dupli...

Страница 1277: ...sters Send area Number of words to send 0 0 127 words High Speed Counter Pulse Catch Input Interrupt Input Transistor types No Name Default Values 400 401 High speed counter Channel 0 Unused Incremental input X0 Incremental input X0 Reset input X6 Decremental input X0 Decremental input X0 Reset input X6 Two phase input X0 X1 Two phase input X0 X1 Reset input X6 Incremental input X0 Decremental inp...

Страница 1278: ...ut Y2 402 401 Pulse output Channel 2 Unused Pulse output Y4 Y5 Pulse output Y4 Y5 Home input X6 PWM output Y4 402 401 Pulse output Channel 3 32k type only Unused Pulse output Y6 Y7 Pulse output Y6 Y7 Home input X7 PWM output Y6 403 Pulse catch input X0 Disable Disable Enable 403 Pulse catch input X1 Disable Disable Enable 403 Pulse catch input X2 Disable Disable Enable 403 Pulse catch input X3 Dis...

Страница 1279: ...me input has been set as high speed counter input pulse catch input or interrupt input the following order of precedence is effective High speed counter Pulse catch Interrupt High Speed Counter Pulse Catch Input Interrupt Input Relay types No Name Default Values 402 High speed counter Channel 0 Unused Incremental input X0 Decremental input X0 Two phase input X0 X1 402 High speed counter Channel 1 ...

Страница 1280: ...cremental input X200 Decremental input X200 Reset input X202 Incremental input X200 Decremental input X201 Incremental input X200 Decremental input X201 Reset input X202 Counter input X200 Incremental decremental control input X201 Counter input X200 Incremental decremental control input X201 Reset input X202 401 High speed counter Channel B with pulse I O cassette Unused Incremental input X201 In...

Страница 1281: ...ng edge Falling edge 404 405 Interrupt input X7 Interrupt 7 Unused Rising edge Falling edge 404 406 Interrupt input X100 Interrupt 8 Unused Rising edge Falling edge 404 406 Interrupt input X101 Interrupt 9 Unused Rising edge Falling edge 404 406 Interrupt input X102 Interrupt 10 Unused Rising edge Falling edge 404 406 Interrupt input X200 Interrupt 11 Unused Rising edge Falling edge 404 406 Interr...

Страница 1282: ...d as reset inputs for channels 8 to B System registers 404 406 apply when the pulse I O cassette is used Time Constants No Name Default Values 430 Time constant of input X0 430 Time constant of input X1 430 Time constant of input X2 430 Time constant of input X3 431 Time constant of input X4 431 Time constant of input X5 431 Time constant of input X6 431 Time constant of input X7 432 Time constant...

Страница 1283: ...de reception done condition CR CR CR LF ETX Non e 420 TOOL port receive buffer starting address 4096 0 12282 16k type 0 32762 32k type 421 TOOL port receive buffer capacity 0 words 0 2048 words 412 TOOL port modem connection Disable Disable Enable COM Port No Name Default Values 412 COM port 1 communication mode MEWTOCOL COM Master Slave MEWTOCOL COM Master Slave Progra m controlled PLC Link Modbu...

Страница 1284: ...ng start code1 No STX No STX STX 414 COM port 2 sending end code reception done condition1 CR CR CR LF ETX Non e 418 COM port 2 receive buffer starting address 2048 0 12282 16k type 0 32762 32k type 419 COM port 2 receive buffer capacity 0 words 0 2048 words 412 COM port 2 modem connection Disable Disable Enable 1 For PLC Link the communication format and baud rate settings are fixed Data length 8...

Страница 1285: ... Battery error indication Disable Disable When a battery error occurs a self diagnostic error is not issued and the ERROR LED will not flash Enable When a battery error occurs a self diagnostic error is issued and the ERROR will LED flash 4 DF P function leading falling edge detection Holds result Holds result disregards result 20 Duplicate output Enable Fixed 23 I O verification error Stop Stop C...

Страница 1286: ...rupt Input No Name Default Values 400 High speed counter Channel 0 Unused Two phase input X0 X1 Two phase input X0 X1 Reset input X2 Incremental input X0 Incremental input X0 Reset input X2 Decremental input X0 Decremental input X0 Reset input X2 Incremental input X0 Decremental input X1 Incremental input X0 Decremental input X1 Reset input X2 Counter input X0 Incremental decremental control input...

Страница 1287: ...Falling edge 403 Interrupt input X7 Interrupt 7 Unused Rising edge Falling edge If the same input has been set as high speed counter input pulse catch input or interrupt input the following order of precedence is effective High speed counter Pulse catch Interrupt If reset input settings overlap for channel 0 and channel 1 the channel 1 setting takes precedence If reset input settings overlap for c...

Страница 1288: ...0 0 baud 413 COM port 1 sending data length 8 bits 7 bits 8 bits 413 COM port 1 sending parity check1 With Odd None With Odd With Even 413 COM port 1 sending stop bit 1 bit 1 bit 2 bits 413 COM port 1 sending start code1 No STX No STX STX 413 COM port 1 sending end code reception done condition1 CR CR CR LF ETX Non e 416 COM port 1 receive buffer starting address 0 0 32762 417 COM port 1 receive b...

Страница 1289: ...ype Hold on off 1 No Name Default Values 5 Counter start address 1008 0 1024 6 Timer Counter hold area start address 1008 Fixed 0 10243 7 Internal relay hold area start address in word units 248 Fixed 0 2563 8 Data register hold area start address 12000 324502 Fixed 0 327633 10 Link relay hold area start address for PLC Link 0 in word units 64 Fixed 0 643 11 Link relay hold area start address for ...

Страница 1290: ...link 0 Link relays Send area Start sending from this word address 0 0 63 43 PLC link 0 Link relays Send area Number of words to send 0 0 64 words 41 PLC link 0 Link registers Send receive area Number of words shared by all linked PLCs 0 0 128 words 44 PLC link 0 Link registers Send area Start sending from this word address 0 0 127 45 PLC link 0 Link registers Send area Number of words to send 0 0 ...

Страница 1291: ...set input X5 Incremental input X3 Decremental input X4 Incremental input X3 Decremental input X4 Reset input X5 Counter input X3 Incremental decremental control input X4 Counter input X3 Incremental decremental control input X4 Reset input X5 400 High speed counter Channel 3 Unused Incremental input X4 Incremental input X4 Reset input X5 Decremental input X4 Decremental input X4 Reset input X5 401...

Страница 1292: ... Unused Rising edge Falling edge Rising and falling edge 404 405 Interrupt input X3 Interrupt 3 Unused Rising edge Falling edge Rising and falling edge 404 405 Interrupt input X4 Interrupt 4 Unused Rising edge Falling edge Rising and falling edge 404 405 Interrupt input X5 Interrupt 5 Unused Rising edge Falling edge Rising and falling edge 404 405 Interrupt input X6 Interrupt 6 Unused Rising edge ...

Страница 1293: ...tputs Time Constants No Name Default Values 430 Time constant of input X0 430 Time constant of input X1 430 Time constant of input X2 430 Time constant of input X3 431 Time constant of input X4 431 Time constant of input X5 431 Time constant of input X6 431 Time constant of input X7 4321 Time constant of input X8 4321 Time constant of input X9 4321 Time constant of input XA 4321 Time constant of i...

Страница 1294: ...nk Modbus RTU Master Slave 410 COM port 1 station number 1 1 99 415 COM port 1 baud rate1 9600 baud 115200 57600 38400 19200 9600 4800 240 0 baud 413 COM port 1 sending data length 8 bits 7 bits 8 bits 413 COM port 1 sending parity check1 With Odd None With Odd With Even 413 COM port 1 sending stop bit 1 bit 1 bit 2 bits 413 COM port 1 sending start code1 No STX No STX STX 413 COM port 1 sending e...

Страница 1295: ...ive if the optional backup battery is installed If no backup battery is used do not change the default settings Otherwise proper functioning of hold non hold values cannot be guaranteed 1 Depending on PLC type 2 7k type 5k type 10k type 2 Depending on PLC type Fixed value 2 7k 5k types variable values 10k type Act on Error No Name Default Values 20 Duplicate output Enable Fixed 23 I O verification...

Страница 1296: ...l input X3 Reset input X5 Incremental input X3 Decremental input X4 Incremental input X3 Decremental input X4 Reset input X5 Counter input X3 Incremental decremental control input X4 Counter input X3 Incremental decremental control input X4 Reset input X5 401 High speed counter Channel 3 Unused Incremental input X4 Incremental input X4 Reset input X5 Decremental input X4 Decremental input X4 Reset...

Страница 1297: ...Name Default Values 410 TOOL port station number 1 1 32 411 TOOL port modem connection Disable Disable Enable 411 TOOL port sending data length 8 bits 7 bits 8 bits 414 TOOL port baud rate 19200 baud 19200 9600 baud COM Port No Name Default Values 412 COM port 1 communication mode MEWTOCOL CO M Slave MEWTOCOL COM Slave Program controlled 415 COM port 1 station number 1 1 32 414 COM port 1 baud rat...

Страница 1298: ... installed If no backup battery is used do not change the default settings Otherwise proper functioning of hold non hold values cannot be guaranteed Act on Error No Name Default Values 4 Battery error indication Disable Disable When a battery error occurs a self diagnostic error is not issued and the ERROR LED will not flash Enable When a battery error occurs a self diagnostic error is issued and ...

Страница 1299: ...l input X3 Reset input X5 Incremental input X3 Decremental input X4 Incremental input X3 Decremental input X4 Reset input X5 Counter input X3 Incremental decremental control input X4 Counter input X3 Incremental decremental control input X4 Reset input X5 401 High speed counter Channel 3 Unused Incremental input X4 Incremental input X4 Reset input X5 Decremental input X4 Decremental input X4 Reset...

Страница 1300: ...pt inputs can only be specified in the system registers TOOL Port No Name Default Values 410 TOOL port station number 1 1 32 411 TOOL port modem connection Disable Disable Enable 411 TOOL port sending data length 8 bits 7 bits 8 bits 414 TOOL port baud rate 19200 baud 19200 9600 baud COM Port No Name Default Values 412 COM port 1 communication mode MEWTOCOL CO M Slave MEWTOCOL COM Slave Program co...

Страница 1301: ... Link register hold area start address for PLC Link 1 256 128 256 141 Step ladder hold non hold Non hold Hold Non hold 1 These settings are effective if the optional backup battery is installed If no backup battery is used do not change the default settings Otherwise proper functioning of hold non hold values cannot be guaranteed 2 Depending on PLC type 16k 32k type FP2SH FP10SH No Name Default Va...

Страница 1302: ...flash 4 Internal relay R 4 Link relay L 4 Timer counter T C SV EV 4 Data register DT 4 Link register LD 4 File register FL 4 Index register I 41 Error alarm relay E Clear Clear Don t clear 4 DF P function leading falling edge detection Holds result Holds result disregards result 41 Timer instruction operation Synchronou s Synchronous Asynchronous 4 Index modifier check On On Off 20 Duplicate outpu...

Страница 1303: ...ink No Name Default Values 46 PLC Link 0 and 1 allocation setting Normal Normal Reverse 471 PLC link 0 Highest station number in network 16 1 16 40 PLC link 0 Link relays Send receive area Number of words shared by all linked PLCs 0 0 64 words 42 PLC link 0 Link relays Send area Start sending from this word address 0 0 63 43 PLC link 0 Link relays Send area Number of words to send 0 0 64 words 41 ...

Страница 1304: ...baud 115200 57600 38400 19200 9600 4800 2400 1200 baud COM Port FP2 FP2SH No Name Default Values 412 COM port 1 communication mode MEWTOCOL COM Slave MEWTOCOL COM Slave Program controlled 415 COM port 1 station number 1 1 32 414 COM port 1 baud rate FP2 19200 baud FP2SH 9600 baud 115200 57600 38400 19200 9600 4800 2400 1200 baud 413 COM port 1 sending data length 8 bits 7 bits 8 bits 413 COM port ...

Страница 1305: ...starting No 0 0 127 430 WL CPU2 sending capacity 0 0 128 words 431 WL CPU2 send starting No 0 0 127 432 DT CPU1 sending capacity 0 0 1024 words 433 DT CPU1 send starting No 0 0 2047 434 DT CPU2 sending capacity 0 0 1024 words 435 DT CPU2 send starting No 0 0 2047 436 LD CPU1 sending capacity 0 0 256 words 437 LD CPU1 send starting No 0 0 255 438 LD CPU2 sending capacity 0 0 256 words 439 LD CPU2 s...

Страница 1306: ...Appendix Programming Information 1305 ...

Страница 1307: ...written to a specific area main program area or subprogram area has been written to a different area for example a subroutine SUB to RET is placed before an ED instruction Change to PROG mode and enter the instruction into the correct area E6 Compile memory full error Available PLC FP FP X FP2SH FP10SH Stops The program stored in the PLC is too large to compile in the program memory Change to PROG...

Страница 1308: ...f the ERROR turned off rewrite the master memory as its contents are damaged and use it again If the ERROR does not turn off please contact your dealer FP0 FP e FP FP1 C14 C16 Probably an abnormality in the built in ROM Please contact your dealer E26 User s ROM error Stops All FP Ms and FP1 C24 C40 C56 and C72 Probably an abnormality in the memory unit or master memory unit Program the memory unit...

Страница 1309: ...n the slave station of the MEWNET F link system is installed on the slave station Remove the illegal unit from the slave station E36 MEWNET F limitation error Stops The number of slots or I O points used for MEWNET F exceeds the limitation Re configure the system so that the number of slots and I O points is within the specified range E37 MEWNET F I O mapping error Stops I O overlap or I O setting...

Страница 1310: ...rs DT9010 and DT9011 DT90010 and DT90011 and locate the erroneous unit Then check the unit and correct the wiring Selection of operation status using system register 23 to continue operation set K1 CONT to stop operation set K0 STOP E43 System watching dog timer error Selectable Scan time required for program execution exceeds the setting of the system watchdog timer Check the program and modify i...

Страница 1311: ... the backup battery and then replace battery if necessary By setting the system register 4 in K0 NO you can disregard this error However the BATT LED turns on E51 MEWNET F terminal station error Continues Terminal station settings were not properly performed Check stations at both ends of the communication path and set them in the terminal station using the dip switches E52 MEWNET F I O update syn...

Страница 1312: ...y be a problem with the ROM or IC memory card When loading the specified contents exceeded the capacity 256 KB Write error occurs ROM or IC memory card is not installed ROM or IC memory card does not conform to specifications Check the contents of the ROM or IC memory card E65 Protect error Stops Transfer was attempted during ROM operation or IC memory card operation Switch the mode and execute on...

Страница 1313: ... the wrong program area main program area or subprogram area Change to PROG mode and correct the error This error is also detected during online editing No changes will be downloaded and operation will continue E6 see note Compile memory full error Stops The program stored in the PLC is too large to compile in the program memory Change to PROG mode and correct the error E7 see note High level inst...

Страница 1314: ...fy error Selectable The connection condition of an I O unit has changed compared to that at the time of power up Check the error using sys_wVerifyErrorUnit_0_15 and locate the faulty I O unit Set the operation status using system register 23 to continue operation E45 Operation error Selectable Operation became impossible when a high level instruction was executed The causes of calculation errors v...

Страница 1315: ...processed was executed during RUN mode 64 External memory error An abnormality occurred when loading RAM to ROM IC memory card There may be a problem with the ROM or IC memory card When loading the specified contents exceeded the capacity Write error occurs ROM or IC memory card is not installed ROM or IC memory card does not conform to specifications 65 Protect error A program or system register ...

Страница 1316: ...elapsed value area RK Reads the timer counter elapsed value Write timer counter elapsed value area WK Writes the timer counter elapsed value Register or Reset contacts monitored MC Registers the contact to be monitored Register or Reset data monitored MD Registers the data to be monitored Monitoring start MG Monitors a registered contact or data using MD and MC Preset contact area fill command SC ...

Страница 1317: ...1 0001 0000 0000 0001 0010 0000 0000 0001 0011 0000 0000 0001 0100 0000 0000 0001 0101 16 17 18 19 20 21 22 23 0010 0011 0012 0013 0014 0015 0016 0017 0000 0000 0001 0000 0000 0000 0001 0001 0000 0000 0001 0010 0000 0000 0001 0011 0000 0000 0001 0100 0000 0000 0001 0101 0000 0000 0001 0110 0000 0000 0001 0111 0000 0000 0001 0110 0000 0000 0001 0111 0000 0000 0001 1000 0000 0000 0001 1001 0000 0000...

Страница 1318: ... 0 1 1 1 1 b3 b2 b1 b0 b6 b5 b4 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 8 9 A B C D E F b4 b5 b6 SP AC E DEL LF VT FF CR SO SI DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z b7 b7 Most significant digit Least significant digit...

Страница 1319: ...D_TIME 330 ADD_TOD_TIME 283 Adr_Of_Var 1331 Adr_Of_VarOffs 1331 AdrDT_Of_Offs 1331 AdrFL_Of_Offs 1331 AdrLast_Of_Var 1331 AllSfcsStopped 1246 ALT 888 AreaOffs_ToVar 1246 ASIN 71 ATAN 76 ATAN2_YX 77 BOOL_TO_DINT 168 BOOL_TO_DWORD 132 BOOL_TO_INT 145 BOOL_TO_STRING 210 BOOL_TO_UDINT 180 BOOL_TO_UINT 157 BOOL_TO_WORD 120 BOOL16_TO_WORD 121 BOOL32_TO_DWORD 133 BOOLS_TO_DWORD 134 BOOLS_TO_WORD 122 BRK ...

Страница 1320: ... DF 884 DFI 886 DFN 885 DINT_TO_BCD_DWORD 245 DINT_TO_BOOL 117 DINT_TO_DWORD 138 DINT_TO_INT 149 DINT_TO_REAL 195 DINT_TO_STRING 221 DINT_TO_STRING_LEADING_ZEROS 225 DINT_TO_TIME 203 DINT_TO_UDINT 186 DINT_TO_UINT 162 DINT_TO_WORD 126 DIV_TIME_DINT 333 DIV_TIME_INT 332 DIV_TIME_REAL 334 DT_TO_DATE 206 DT_TO_STRING 217 DT_TO_TOD 208 DT_TO_UDINT 191 DWORD_BCD_TO_DINT 170 DWORD_BCD_TO_UDINT 183 DWORD...

Страница 1321: ..._LEADIN G_ZEROS 236 EXP 81 ExpansionUnitNumberToIOWordOffset_FP 0 1129 ExpansionUnitNumberToIOWordOffset_FP X_FP0 1130 EXPT 82 F_TRIG 313 F0_MV 806 F1_DMV 808 F10_BKMV 820 F10_BKMV_NUMBER 822 F10_BKMV_NUMBER_OFFSET 824 F10_BKMV_OFFSET 823 F100_SHR 558 F101_SHL 560 F102_DSHR 562 F103_DSHL 564 F105_BSR 566 F106_BSL 568 F108_BITR 570 F109_BITL 572 F11_COPY 825 F110_WSHR 574 F111_WSHL 576 F112_WBSR 57...

Страница 1322: ...44 F137_STMR 934 F138_TIMEBCD_TO_SECBCD 866 F139_SECBCD_TO_TIMEBCD 867 F14_PGRD 833 F140_STC 998 F141_CLC 999 F142_WDT 1000 F143_IORF 843 F145_SEND 787 F145_WRITE_DATA 767 F145_WRITE_DATA_TYPE_OFFS 770 F145F146_MODBUS_COMMAND 778 F145F146_MODBUS_MASTER 780 F146_READ_DATA 773 F146_READ_DATA_TYPE_OFFS 775 F146_RECV 789 F147_PR 845 F148_ERR 1001 F149_MSG 1003 F15_XCH 836 F150_READ 848 F151_WRT 851 F1...

Страница 1323: ...seOutput_Jog 1040 F17_SWAP 839 F170_PulseOutput_PWM 1043 F171_PulseOutput_Home 1052 F171_PulseOutput_Jog_Positioning 1056 F171_PulseOutput_Trapezoidal Except FP X 16k L14 FP X 32k L30 L60 1046 F172_PulseOutput_Jog Except FP X 16k L14 FP X 32k L30 L60 1061 F173_PulseOutput_PWM Except FP X 16k L14 FP X 32k L30 L60 1067 F174_PulseOutput_DataTable Except FP X 16k L14 FP X 32k L30 L60 1070 F175_PulseOu...

Страница 1324: ... 536 F22_ADD2 346 F23_DADD2 348 F230_DTBCD_TO_SEC 872 F231_SEC_TO_DTBCD 873 F235_GRY 665 F236_DGRY 666 F237_GBIN 667 F238_DGBIN 668 F240_COLM 669 F241_LINE 671 F25_SUB 366 F250_BTOA 673 F251_ATOB 677 F252_ACHK 682 F26_DSUB 368 F27_SUB2 370 F270_MAX 451 F271_DMAX 453 F272_MIN 457 F273_DMIN 459 F275_MEAN 463 F276_DMEAN 465 F277_SORT 501 F278_DSORT 503 F28_DSUB2 372 F282_SCAL 469 F283_DSCAL 472 F284_...

Страница 1325: ... F31_DMUL 392 F310_FADD 1246 F311_FSUB 1246 F312_FMUL 1246 F313_FDIV 410 F314_SIN 1246 F315_COS 1246 F316_TAN 1246 F317_ASIN 1246 F318_ACOS 1246 F319_ATAN 1246 F32_DIV 402 F320_LN 1246 F321_EXP 1246 F322_LOG 1246 F323_PWR 1246 F324_FSQR 1246 F325_FLT 684 F326_DFLT 685 F327_INT 687 F328_DINT 689 F329_FIX 1246 F33_DDIV 404 F330_DFIX 1246 F331_ROFF 1246 F332_DROFF 1246 F333_FINT 691 F334_FRINT 693 F3...

Страница 1326: ...F356_PID_PWM Except FP X 16k L14 FP X 32k L30 L60 945 F36_DINC 360 F37_DEC 382 F373_DTR 616 F374_DDTR 618 F38_DDEC 384 F39_DMULD 396 F4_GETS 814 F40_BADD 350 F41_DBADD 352 F410_SET_INDEXREG_BANK F411_CHANGE_INDEXREG_BANK F412_RESTORE_INDEXREG_BANK F414_SET_FILEREG_BANK F415_CHANGE_FILEREG_BANK F416_RESTORE_FILEREG_BANK F42_BADD2 354 F43_DBADD2 356 F45_BSUB 374 F46_DBSUB 376 F47_BSUB2 378 F48_DBSUB...

Страница 1327: ... 522 F68_XNR 524 F69_WUNI 526 F7_MV2 816 F70_BCC 412 F71_HEX2A 622 F72_A2HEX 625 F73_BCD2A 628 F74_A2BCD 631 F75_BIN2A 635 F76_A2BIN 638 F77_DBIN2A 641 F78_DA2BIN 644 F8_DMV2 818 F80_BCD 647 F81_BIN 649 F82_DBCD 651 F83_DBIN 653 F84_INV 545 F85_NEG 447 F86_DNEG 449 F87_ABS 429 F88_DABS 431 F89_EXT 655 F90_DECO 657 F91_SEGT 659 F92_ENCO 660 F93_UNIT 547 F94_DIST 549 F95_ASC 662 F96_SRC 479 F97_DSRC...

Страница 1328: ...InstructionClear 1148 HscControl_ResetInputDisable 1150 HscControl_ResetInputEnable 1151 HscControl_SetDefaults 1152 HscControl_WriteElapsedValue 1153 HscInfo_GetControlCode 1156 HscInfo_GetCurrentSpeed 1157 HscInfo_IsActive 1158 HscInfo_IsChannelEnabled 1159 HscInfo_IsCountingDisabled 1160 HscInfo_IsElapsedValueReset 1161 HscInfo_IsResetInputDisabled 1162 HscInfo_ReadElapsedValue 1164 HscInfo_Rea...

Страница 1329: ...sDataUnitTypeSupported 1331 IsF145F146Error 783 IsF145F146NotActive 782 IsFileRegisterAreaSupported 1331 IsHscChannelEnabled 1331 IsInstructionSupported 1331 IsPlcLink 725 IsProgramControlled 726 IsPulseChannelEnabled 1331 IsReceptionDone 761 IsReceptionDoneByTimeOut 762 IsSystemVariableSupported 1331 IsTransmissionDone 764 JP 1010 KEEP 508 LBL 1014 LEFT 264 LEN 262 LIMIT 86 LN 79 LOG 80 LOOP 1013...

Страница 1330: ...seControl_PulseOutputStop 1214 PulseControl_SetDefaults 1216 PulseControl_TargetValueMatchClear 1331 PulseControl_WriteElapsedValue 1217 PulseInfo_GetControlCode 1221 PulseInfo_GetCurrentSpeed 1222 PulseInfo_IsActive 1224 PulseInfo_IsChannelEnabled 1225 PulseInfo_IsCountingDisabled 1226 PulseInfo_IsElapsedValueReset 1227 PulseInfo_IsHomeInputTrue 1228 PulseInfo_IsPulseOutputStopped 1229 PulseInfo_...

Страница 1331: ...TO_DINT 175 REAL_TO_DWORD 141 REAL_TO_INT 152 REAL_TO_STRING 229 REAL_TO_TIME 204 REAL_TO_UDINT 187 REAL_TO_UINT 164 ReceiveCharacters 753 ReceiveData 751 REPLACE 278 RIGHT 266 ROL 100 ROR 98 RS 308 RST 509 SCALE_INT 956 SCALE_INT_UINT 958 SCALE_REAL 960 SCALE_UINT 962 SCALE_UINT_INT 964 SCLR_CLEAR_MULTIPLE_STEPS 1331 SEL 258 SendCharacters 738 SendCharactersAndClearString 740 SET 509 SET_RTC_DT 2...

Страница 1332: ...ta 1246 StartStopSfc 1246 StartStopSfcAndInitData 1246 STPE_STEP_LADDER_END STRING_TO_DINT 178 STRING_TO_DINT_STEPSAVER 179 STRING_TO_DWORD 143 STRING_TO_DWORD_STEPSAVER 144 STRING_TO_ETLANADDR 250 STRING_TO_ETLANADDR_STEPSAVER 251 STRING_TO_INT 155 STRING_TO_INT_STEPSAVER 156 STRING_TO_IPADDR 248 STRING_TO_IPADDR_STEPSAVER 249 STRING_TO_REAL 199 STRING_TO_UDINT 189 STRING_TO_UINT 166 STRING_TO_UI...

Страница 1333: ...TO_UDINT 192 TOF 324 TON 326 TP 328 TRUNC_TO_DINT 176 TRUNC_TO_INT 153 TRUNC_TO_UDINT 188 TRUNC_TO_UINT 165 UDINT_TO_BCD_DWORD 247 UDINT_TO_BOOL 119 UDINT_TO_DATE 207 UDINT_TO_DINT 174 UDINT_TO_DT 205 UDINT_TO_DWORD 140 UDINT_TO_INT 151 UDINT_TO_REAL 197 UDINT_TO_STRING 223 UDINT_TO_STRING_LEADING_ZEROS 226 UDINT_TO_TOD 209 UDINT_TO_UINT 163 UDINT_TO_WORD 128 UINT_TO_BCD_WORD 246 UINT_TO_BOOL 118 ...

Страница 1334: ...nalogInput_FP0_A80 1097 Unit_AnalogInput_FP0_RTD_INT 1102 Unit_AnalogInput_FP0_RTD_REAL 1108 Unit_AnalogInput_FP0_TC4_TC8 1114 Unit_AnalogOutput_FP0_A04I 1123 Unit_AnalogOutput_FP0_A04V 1126 Var_ToAreaOffs 1246 WITHIN_LIMITS 112 WORD_BCD_TO_INT 147 WORD_BCD_TO_UINT 159 WORD_TO_BOOL 114 WORD_TO_BOOL16 238 WORD_TO_BOOLS 240 WORD_TO_DINT 169 WORD_TO_DWORD 136 WORD_TO_INT 146 WORD_TO_STRING 212 WORD_T...

Страница 1335: ...e Description of Changes ACGM0313V2EN July 2012 Complete update in accordance with software version 6 4 For details on the new information see the section new in this version 6 4 in the online help ACGM0313V1EN FEB 2011 First edition ...

Страница 1336: ...ructions 103 603 CONCAT 270 CONCAT_DATE_INT 284 CONCAT_DATE_TOD 285 CONCAT_DT_INT 286 CONCAT_TIME_INT 331 CONCAT_TOD_INT 288 Constants 39 Conversion instructions 113 621 COS 72 Counter instructions 315 701 CRC16 84 Creating DUTs 51 CT 705 CT_FB 702 CTD 318 CTU 316 CTUD 320 D Data exchange with flexible network 798 Data Registers DT 28 Data transfer in master slave mode MEWTOCOL Modbus RTU 766 Data...

Страница 1337: ...instuctions 938 EXPT 82 External input X and output relays Y 37 F F_TRIG 313 F0_MV 806 F1_DMV 808 F10_BKMV 820 F10_BKMV_NUMBER 822 F10_BKMV_NUMBER_OFFSET 824 F10_BKMV_OFFSET 823 F100_SHR 558 F101_SHL 560 F102_DSHR 562 F103_DSHL 564 F105_BSR 566 F106_BSL 568 F108_BITR 570 F109_BITL 572 F11_COPY 825 F110_WSHR 574 F111_WSHL 576 F112_WBSR 578 F113_WBSL 580 F115_FIFT 484 F116_FIFR 488 F117_FIFW 492 F11...

Страница 1338: ...DD 344 F215_DAND 528 F216_DOR 530 F217_DXOR 532 F218_DXNR 534 F219_DUNI 536 F22_ADD2 346 F23_DADD2 348 F230_DTBCD_TO_SEC 872 F231_SEC_TO_DTBCD 873 F235_GRY 665 F236_DGRY 666 F237_GBIN 667 F238_DGBIN 668 F240_COLM 669 F241_LINE 671 F25_SUB 366 F250_BTOA 673 F251_ATOB 677 F252_ACHK 682 F26_DSUB 368 F27_SUB2 370 F270_MAX 451 F271_DMAX 453 F272_MIN 457 F273_DMIN 459 F275_MEAN 463 F276_DMEAN 465 F277_S...

Страница 1339: ...51 F83_DBIN 653 F84_INV 545 F85_NEG 447 F86_DNEG 449 F87_ABS 429 F88_DABS 431 F89_EXT 655 F90_DECO 657 F91_SEGT 659 F92_ENCO 660 F93_UNIT 547 F94_DIST 549 F95_ASC 662 F96_SRC 479 F97_DSRC 481 F98_CMPR 496 F99_CMPW 499 File Registers FL 29 Find 274 Flag operation in program controlled communication 757 Floating Point Constant f 1251 Floating Point Instructions 1248 FNS_InitConfigDataTable 799 Forma...

Страница 1340: ...ALID_DT_INT 292 IS_VALID_TOD_INT 294 IsCommunicationError 765 IsF145F146Error 783 IsF145F146NotActive 782 IsPlcLink 725 IsProgramControlled 726 IsReceptionDone 761 IsReceptionDone for a special COM port via the corresponding System Variable 782 IsReceptionDoneByTimeOut 762 IsTransmissionDone 764 J JP 1010 K KEEP 508 L LBL 1014 LE 109 LEFT 264 LEN 262 LIMIT 86 Link Relays and Registers L LD 29 LN 7...

Страница 1341: ...8_DXNR 534 P219_DUNI 536 P230_DTBCD_TO_SEC 872 P231_SEC_TO_DTBCD 873 P235_GRY 665 P236_DGRY 666 P237_GBIN 667 P238_DGBIN 668 P240_COLM 669 P241_LINE 671 P25_SUB 366 P26_DSUB 368 P270_MAX 451 P271_DMAX 453 P272_MIN 457 P273_DMIN 459 P275_MEAN 463 P276_DMEAN 465 P277_SORT 501 P278_DSORT 503 P282_SCAL 469 P283_DSCAL 472 P285_LIMT 878 P286_DLIMT 880 P287_BAND 433 P289_ZONE 440 P3_DMVN 812 P300_BSIN 41...

Страница 1342: ...opped 1229 PulseInfo_IsTargetValueMatchActive 1230 PulseInfo_ReadAccelerationForbiddenAreaStarting Position 1231 PulseInfo_ReadCorrectedFinalSpeed 1232 PulseInfo_ReadCorrectedInitialSpeed 1233 PulseInfo_ReadElapsedValue 1234 PulseInfo_ReadTargetValue 1235 PulseInfo_ReadTargetValueMatchValue 1236 PulseOutput_Center_FB 1174 PulseOutput_Home_FB 1177 PulseOutput_Jog_FB 1180 PulseOutput_Jog_Positioning...

Страница 1343: ...249 STRING_TO_REAL 199 STRING_TO_UDINT 189 STRING_TO_UINT 166 STRING_TO_UINT_STEPSAVER 167 STRING_TO_WORD 130 STRING_TO_WORD_STEPSAVER 131 Strings general 45 SUB 63 SUB_DATE_DATE 300 SUB_DT_DT 301 SUB_DT_TIME 302 SUB_TIME 339 SUB_TOD_TIME 303 SUB_TOD_TOD 304 SYS1 980 SYS2 994 System register instructions 979 System registers 1273 System registers for FP0 1294 System registers for FP0R 1288 System ...

Страница 1344: ... 1102 Unit_AnalogInput_FP0_RTD_REAL 1102 Unit_AnalogInput_FP0_TC4_TC8 1114 Unit_AnalogOutput_FP0_A04I 1123 Unit_AnalogOutput_FP0_A04V 1126 Using DUTs in a POU header 52 Using DUTs in the global variable list 51 V Values When Overflow Underflow Occurs 1252 W WITHIN_LIMITS 112 WORD 42 Word representation of relays WX WY WR and WL 37 WORD_BCD 56 WORD_BCD_TO_INT 147 WORD_BCD_TO_UINT 159 WORD_TO_BOOL 1...

Страница 1345: ... 1107 Unit_AnalogInput_FP0_RTD_REAL 1107 Unit_AnalogInput_FP0_TC4_TC8 1119 Unit_AnalogOutput_FP0_A04I 1128 Unit_AnalogOutput_FP0_A04V 1131 Using DUTs in a POU header 37 Using DUTs in the global variable list 36 V Values When Overflow Underflow Occurs 1260 W WITHIN_LIMITS 103 WORD 28 Word representation of relays WX WY WR and WL 24 WORD_BCD 41 WORD_BCD_TO_INT 139 WORD_BCD_TO_UINT 152 WORD_TO_BOOL 1...

Отзывы: