NT21_Reference Manual (V069-E1-1) (986756), страница 42
Текст из файла (страница 42)
To display anumeric value that has a decimal fraction in a numeral setting input field, set theDecimal setting to 1 or higher to specify the number of places after the decimalpoint. A decimal point is then automatically inserted.194Section 2-12Inputting Numeric ValuesNote that if the number of digits of the numeric value is greater than the total ofthe settings for Integer and Decimal, an error occurs and ∗ is displayed for all thedigits.Example: Displaying 123456• Setting for Integer = 8; setting for Decimal = 0:Resulting display: 00123456• Setting for Integer = 4; setting for Decimal = 4:Resulting display: 0012.3456• Setting for Integer = 2, setting for Decimal = 4:Resulting display: 12.3456• Setting for Integer = 1, setting for Decimal = 4:Resulting display: ∗∗∗∗∗∗For hexadecimal display, only the number of digits of the integral part is specified.Input Numeric Value and Stored DataThe range of numeric values that can be input and the conversion method forstorage depend on the following settings.• Display Type (Decimal/Hexadecimal)• Display Sign (whether or not negative values are displayed)Conversion Depending on Display TypeThe data is converted for storage in a numeral memory table entry as followsdepending on the setting for Display Type:• Decimal:The numeric value input in decimal is converted to signed binary data andstored in the numeral memory table entry.• Hexadecimal:The numeric value input in hexadecimal is stored in the numeral memorytable entry without alteration.When the word allocated in the host is input to a 1-word memory tableentry, the input value is treated as 4-digit (16-bit) signed binary data so it isconverted to 8-digit signed binary data before being stored.For example, if a value of 8001 hexadecimal is input to a 1-word numeralmemory table entry, it is recognized as a negative value because the mostsignificant bit is ON.
The value actually stored in the numeral memorytable entry is FFFF 8001 hexadecimal.Reference: Numeral memory table entries store numeric values as signed binary data.Permissible Input RangeWhen inputting values into numeral memory table entries, the permissible inputrange is affected not just by the Display Type and Display Sign but also the Storage Type and Words settings. (When words are not allocated for the numeralmemory table entry in the host, the Words setting is treated as 2 words.)195Section 2-12Inputting Numeric ValuesThe permissible input range is determined as shown below depending on theseproperties. If input of a value outside this range is attempted, the PT checks andprevents the input.StorageWordsTypeDisplayTypeDecimal1SignPermissible Input RangeUnsigned0 to 9999Signed–999 to 9999–FC19 to FFFFH (negative numbers)0 to 270FH (positive numbers)Unsigned0 to 99999999Signed–9999999 to 99999999–FF676981 to FFFFFFFFH(negative numbers)0 to 5F5E0FFH (positive numbers)Unsigned0 to 32767*Signed–32768 to 32767–0 to FFFFHUnsigned0 to 2147483647*Signed–2147483648 to 2147483647–0 to FFFFFFFFHHexadecimalBCDDecimal2HexadecimalDecimal1HexadecimalBinaryDecimal2Hexadecimal* Note that the values are different from those of the numeral display range.
Innumeral display, since negative numbers are displayed as absolute values whendisplaying unsigned decimal values, 32768 and 2147483648, which cannot beinput, may be displayed.Relationship Between Input Numeric Values and Contents of Host WordsWhen inputting a numeric value to a word allocated for a numeral memory tableentry in the host, the value is first converted to signed binary in accordance withthe settings for Display Type and Display Sign settings and stored in the numeralmemory table entry, and then written to the host word in accordance with theWords and Storage Type settings for the numeral memory table entry.
Thereforethe result also differs according to the settings made for Words and StorageType (BCD or Binary).Numeral memory table entries8-digit hexadecimal(Can’t be read externally.)DecimalBCDBinaryBCDHexadecimalSet the data format in whichthe values input at the PT willbe stored in the numeralmemory table entries.(Set in the Numeral Inputproperties.)196BinarySet the data format in which thenumeral memory table valueswill be stored in the PC.(Set with the numeral memorytable entry.)Section 2-12Inputting Numeric ValuesNumeric valuestored in numeral memorytableWords000004D2H1 word12340000007BH1 word0123000004D2H2words00001234000004D2H1 word1234FFFFFF85H(FF85H)1 word–1234FFFFFB2EH2wordsF0001234000004D2000004D2H1 word1234FFFFFF85H(FF85H)1 wordF123FFFFFB2EH2wordsF000123400001234H1 word12340FFFEDCCH2words0FFFEDCC00001234H1 word1234FFFF8000H(8000H)*1 word8000–268430796F0001234H2words123400001234H1 word1234FFFFF123H(F123H)*1 wordF123F0001234H2wordsF0001234Input numeric valueDisplayTypeSign1234123Unsignedid12341234Decimal–123FFFFFF85gSignedHexadecimal–FFFFFB2E4660UnUnsigned2684307964660Decimal–32768F123F0001234SignedgHexadecimal–StorageTypeContentsof word athostF123BCDBinaryF0001234* The figures in parentheses are the values immediately after input.
When data isread from the host after input, it is converted to a 32-bit negative number and thevalue in the numeral memory table entry changes.Reference: When the Storage Type is BCD, the numeral memory table entry’s signed binarydata is converted to data for storage in the host word (BCD data) and written tothe host.
If the value is negative the most significant digit in the word is set as F.This means that the maximum number of digits for a negative number (integerpart + decimal fraction part) is seven.When the Storage Type is Binary, the contents of the numeral memory tableentry are written without alteration to the host word.However, when a negative number is written to a numeral memory table entrywhose number of allocated words at the host is one, it is stored immediately afterinput as a 16-bit negative number.The data is stored in the numeral memory table entry as a 32-bit negative number in this case as well.Upper/Lower (Max./Min.) Limit CheckThe PT has a function to check the correctness of an input numeric value to prevent a numeric value outside the allowable range from being input so that theinput of an illegal value will not adversely affect the system.197Section 2-12Inputting Numeric ValuesFor a numeric key type numeral setting input field, the check is executed whenan attempt is made to confirm a numeric value.
If the value is higher than theupper limit or lower than the lower limit, the buzzer sounds three times and theinput value is cleared (the status returns to that before input was attempted).Note To ensure greater safety for numeric inputs, use the upper/lower limit settingfunction. Otherwise the system may operate unpredictably.Reference: Since values input at the PT are handled as signed binary data, be sure to observe the following upper/lower limit settings at the Support Tool when numbersare being input in hexadecimal with its unlimited input range.• The following values are recognized internally in the PT.1 word:8000H ↔ 0000H ↔ 7FFFH (–32,768 ↔ 0 ↔ 32,767 decimal)2 words: 8000 0000H ↔ 0000 0000H ↔ 7FFF FFFFH(–2,147,483,648 ↔ 0 ↔ 2,147,483,647 decimal)• In the Support Tool, the upper/lower limits are set in decimal.
(The $ prefix canbe added to input hexadecimal values.Using the figures above, the following table shows the upper/lower limits to beset at the Support Tool.Desired inputrangeLower limit to setUpper limit to set0 to FFFFH–32,768 ($8000)32,767 ($7FFF)0 to FFFFFFFFH–2,147,483,648 ($8000 0000)2,147,483,647 ($7FFF FFFF)Interlock FunctionA numeral input can be controlled (enabled/disabled) from the PC by setting theinterlock function for the numeral input and allocating an interlock bit in a PC dataarea.
The status of the allocated interlock bit is read and its status determineswhether the input is enabled or disabled.The following table shows how the PT operates when the interlock function isused or not used.InterlockfunctionUsedOperationNumerical values can be input only while the interlock bit is ON.If you attempt to input a value while the interlock bit is OFF, the buzzerwill sound and the input field will not change. When an input is madefrom a temporary input field to the interlocked numeral input while theinterlock bit is OFF, the buzzer will sound when the value in thetemporary input field is confirmed and the destination numeral inputfield will not change.Not usedValues can be input and confirmed at any time.The PT continuously reads the status of the corresponding interlock bit while anumeral input field that uses the interlock function is being displayed on thescreen.
if the interlock bit’s status changes, the numeral input field is disabled orenabled according to the interlock bit’s status.Reference: If the touch switch input sound has been turned OFF with the PT’s memoryswitch setting, the buzzer won’t sound when you attempt to input a value in aninterlocked input field.198Section 2-12Inputting Numeric ValuesInterlock Bit AllocationInterlock bits can be allocated in the following host (PC) areas.SymbolC-series PCsAllocationCV-series PCsAllocationCS/CJ-series PCsAllocationNoneIR AreaOKCIO AreaOKCIO AreaOKHHR AreaOK------HR AreaNot withHost LinkAAR AreaOKAuxiliary AreaNoAR AreaOKLLR AreaOK------LR Area*1Not withHost LinkTTC Area,Timer PVsNoTimer Area,Timer PVsNoTC Area,Timer PVsNoTU------------TC Area,Timer Completion FlagsCTC Area,Counter PVsNoCounter Area,Counter PVsNoTC Area,Counter PVsCU------------TC Area,Counter Completion FlagsNot withHost LinkW------------WR AreaNot withHost LinkTK------------Task FlagsNot withHost LinkDDM AreaOKDM AreaOKDM AreaEEM Area *2,current bankOKEM Area,current bankE0_ toEC_---------Not withHost Link---Not withHost LinkNoOKEM Area,current bankNot withHost LinkEM Area,EM banks 0 to CNot withHost Link*1: LR 00000 to LR 00199 are converted to CIO 01000 to CIO 01199.*2: The EM Area is supported only by the C200HX/HG/HE(-Z)E PCs.Since the Auxiliary Area of the CVM1/CV-series PCs is allocated to system functions, and it cannot be used for purposes other than system use.The range of each memory area differs according to the PC.
Refer to Appendix DPC Memory Maps on page 441.When a DM Area or EM Area address is specified, add a bit number (00 to 15) tothe end of the word address.Display Attributes and Drawing ResultAttributeStandardDrawing ResultThe character string input field is displayed with thespecified foreground color and background color.12345678FlashRepeated alternation of the standard display and nodisplay.12345678Inverse Flash⇔Repeated exchange of the foreground color andbackground color.12345678⇔12345678199Section 2-12Inputting Numeric ValuesDisplay FunctionsNumeric values are displayed in the numeral setting input field in accordancewith the General settings.For details on the method of display according to the General settings, refer toCommon Attributes (page 193).Input Functions• Numeric values are input into numeral setting input fields by using the controlcode input key touch switches.• When a numeral input field using the interlock function is being displayed onthe screen, the PT continuously reads the status of the corresponding interlockbit allocated in the PC.Output FunctionsNumeral setting input fields only write input numeric values to numeral memorytable entries; they have no function for directly outputting data to external destinations (if a value is written to a numeral memory table entry for which wordshave been allocated in the host, the data can be output to the host indirectly).However, the input of a numeric value is notified to the host via the PT statusnotify area.Processing FunctionsWith numeral setting input fields, input numeric values are converted to signedbinary data in accordance with the Settings property.For details on the method of conversion depending on the Settings property, refer to Common Attributes (page 193).Relationship with Other Elements• Numeral displays (page 140) use the same conversion method and displaymethod as numeral setting input fields.• For details on how numeric values are stored in numeral memory table entries,refer to 2-3-1 Numeral Memory Table (page 72).• Input and confirmation touch switches are required in order to use numeral setting input fields.