NT21_Reference Manual (V069-E1-1) (986756), страница 59
Текст из файла (страница 59)
All of the calculation results are written at the same time after the last calculation is executed. (Only calculation results that have changed are written.)Start PT operationThe PT reads the operands of all ofthe formulas in the mathematicaltable.Mathematicaltable entrynumber 0Mathematicaltable entrynumber 1Calculation execution(1)(2)Calculation executionLast mathematicalCalculation executiontable entryThe previous results arecompared to the new results.(3)Results that have changed areoverwritten with the new results.(4)(5)1, 2, 3...2821. Before executing the calculations, the PT examines all of the formulas andreads all of the values to be used as operands.2. The PT executes the calculations registered in the mathematical table.
Thecalculations are executed in the order that they are registered.3. Once all of the calculations registered in the mathematical table have beenexecuted, the PT determines which results have changed since the last timeSection 2-18Mathematical Functionthat the calculations were performed. (All of the calculation results are examined.)4. If any results have changed, the new results are written to the correspondingnumeral memory table entry or word allocated in the host.The host will not be notified that new results have been written to the numeral memory table entry, but the same results will be written to words in thehost if words have been allocated for the numeral memory table entry in thehost.5. Once all of the results have been written, the PT returns to step 1 and readsall of the values to be used as operands again.While the PT is operating, the processing in steps 1 through 5 is repeated cyclically.
Execution of the calculations cannot be stopped during operation.2-18-3 Precautions When Using the Mathematical FunctionCombining One-wordand Two-word OperandsWhen both one-word and two-word operands have been used in the same formula, the calculation will be performed using two-word operands and the calculation result will be stored using the same number of words as the last calculation result.If the result cannot be stored in the number of words used in the last calculationresult (overflow or underflow), the result will not be stored and the last result willremain valid.Whenever possible, use the same size operands within each formula. In the following example, the size of the operands or result refers to the number of words.• Example: Size of result = Largest operand in the formulaN0000 = N0001 + N0002(1 word)(1 word)(1 word)The calculation on the right is performed as a one-word calculation and the result is stored as one word.
If the calculation results in an overflow or underflow(F000 + 1234 for example), the result will not be stored and the last storableresult will remain valid.• Example: Size of result < Largest operand in the formulaN0000 = N0001 + N0002(1 word) (2 words) (1 word)The calculation on the right is performed as a two-word calculation and the result is stored as one word. If the calculation results in an overflow or underflow(F000 + 1234 for example), the result will not be stored and the last storableresult will remain valid.• Example: Size of result > Largest operand in the formulaN0000 = N0001 + N0002(2 words) (1 word)(1 word)The calculation on the right is performed as a one-word calculation and the result is stored as two words.
In this case, an overflow or underflow will not occurin the calculation result.Calculation ErrorsIf a calculation error occurs, the calculation will be invalid and the result won’t berefreshed. (The last result will remain valid.) The host will not be notified in thiscase either, but it is possible to monitor the calculation results at the host andverify that the calculation was executed if necessary.• Division by 0 (/ or %)An error will occur if the denominator (b in a÷b) of a calculation is 0. When thedenominator is specified in a numeral table entry or host word, be sure that the283Section 2-18Mathematical Functioncontent is non-zero. (When the denominator is specified from the SupportTool, an error message will be displayed if you attempt to specify 0.)• OverflowAn error will occur if the calculation result exceeds the maximum value that canbe stored in the number of words in the result.
The maximum value that can bestored depends upon the data type and number of words set in the memorytable entry or host. (See the following table for allowed ranges.)• UnderflowAn error will occur if the calculation result is below the minimum value that canbe stored in the number of words in the result. The minimum value that can bestored depends upon the data type and number of words set in the memorytable entry or host. (See the following table for allowed ranges.)Data typeBCDBinaryyNumber of wordsAllowed range1212–999 to 9,999*–9,999,999 to 99,999,999*8000 to 7FFF hexadecimal8000 0000 to 7FFF FFFF hexadecimal* When the host is notified, the leftmost digit is set to F to indicate a negative value.For example, –999 is expressed as F999 and –9,999,999 is expressed asF999 9999.Using CalculationResults in LaterCalculationsThe mathematical function reads all of the operands before starting to performthe calculations, so calculation results from one calculation cannot be used in alater calculation in the same cycle.Mathematical table entry 0C=A+BA calculation result cannot be used as alater calculation’s operand.Mathematical table entry 7E=C+DMathematical table entry 7 uses the value of Cthat was read before mathematical table entry 0was executed.The mathematical function’s processing cycle does not match the PC’s cycletime, so results from two calculations may not be from the same processingcycle.Recursive Operations284It is possible to specify the same numeral memory table entry or PC word forboth the operands and calculation result.
For example, the operationD02000 = D02000 + 1 increments the contents of D02000 by 1 each time thatthe operation is repeated. Since the calculations are always executed while thePT is operating, D02000 will be incremented each processing cycle while the PTis operating.Section 2-19PT Configuration Settings2-19 PT Configuration SettingsApart from the settings of the memory switches at the PT itself, the basic operation of the PT is also determined by the PT Configuration settings made at theSupport Tool.This section describes the settings made under PT Configuration. However,note that the operations at the Support Tool are not described. For details onthese operations, refer to the NT-series Support Tool Version 4.6 for WindowsOperation Manual (V061-E1-j).2-19-1 PT Configuration SettingsThere are the following PT Configuration settings.PT ModelSet the type of PT to be connected.
(Refer to 3-1 Screen Creation Procedure(page 288).)NT20S Compatible Mode (NT21 Only)When you want to use screen data from an NT20S in an NT21 PT, you can setNT20S compatible mode to improve compatibility and reduce the editing required to make the screen data and the user program compatible.The screen data will be checked by default when screen data from the NT20S isconverted for use in a NT21 PT. Refer to Appendix C for details on the NT20Sand NT30/620 compatible modes.NT30/620 Compatible Mode (NT31/NT31C and NT631/NT631C Only)When you want to use screen data from an earlier PT (NT30, NT30C, NT620C,or NT625C) in an NT31, NT31C, NT631, or NT631C, you can set NT30/620compatible mode to improve compatibility and reduce the editing required tomake the screen data and the user program compatible.The screen data will be checked by default when screen data from an earlier PT(NT30, NT30C, NT620C, or NT625C) is converted for use in a V2 version of anNT31/NT31C or NT631/NT631C PT.
Refer to Appendix C for details on theNT20S and NT30/620 compatible modes.PC VendorSet the direct connection type to one of the options in the following table.SettingDirect access typeOMRONOMRONMitsubishi_AMitsubishi_FxABGESiemensModiconMEMLINKMitsubishi AMitsubishi FXAllen-BradleyGE FanucSiemensModiconMemory linkRemarks--The specialpsystemypprogramgpprovidedwithi h theh SSupport TTooll iis requiredi d(NT31/NT31C and NT631/NT631Conly).---Font TypeSet the display font to one of the options in the following table.SettingFont typeCP437Code Page 437ISO 8859-1ISO 8859/1For details, refer to the keycode tables in Appendix E (page 467).CommentsSet a comment relating to screen data here. This comment is displayed on thescreen on manual transmission of Memory Unit.285PT Configuration SettingsSection 2-19PT Control Area/PT Notify AreaSet the allocated words for the PT status control area, PT status notify area andwindow control area here.
Refer to 2-2 Areas for Control/Notification (page 52).Initial ScreenSet the screen number of the screen that is displayed when PT operation starts.However, note that the screen set here is displayed as the initial screen onlywhen the setting made for the screen switch setting word in the PT status controlarea is not a correct screen number. For details, refer to Functions of the PT Status Control Area (page 53).History SettingSet the processing method when the record areas for the display history functionand alarm history function become full.
Refer to Alarm list/history function (page89).Number of Table EntriesSet the numbers of numeral memory table entries, character string memorytable entries, and bit memory table entries here. For details on the numbers thatcan be set, refer to 2-3 Memory Table (page 72).Numeral Storage TypeSet whether the contents of words allocated to the following table entries will behandled as BCD data or binary data.• Values in words allocated to numeral memory table entries(The numeric value storage method set here is only valid when System is setfor Storage Type for each numeral memory table entry concerned. For details,refer to 2-3-1 Numeral Memory Table (page 72).)• Screen numbers in the word allocated to the PT status control area’s screenswitch setting• Memory table entry numbers in the words allocated to the PT status controlarea’s copy source and copy destination memory table entries• Memory table entry numbers in the words allocated to the PT status notifyarea’s updated memory table entry286SECTION 3How to Use the PTThis section describes how to use the functions provided by the PT.3-13-2Screen Creation Procedure .