TO: Date: All interested parties CCC/Customer Central From: Customer Central Software Support 1/1/00 Subject: Totalizer Function Block This memo is a detailed description of how the Totalizer function block operates. It is meant as a supplement for the Concept IEC Block Library. The document will define each input and output pin of the function block. I will then discuss each element of the input and output pin when necessary. Capabilities: The following capabilities are available in the Totalizer function block: 1. The integration of IN can either be suspended or reinitialized to zero. 2. The block allows the integration of small input values. 3. A cutoff parameter is provided, which sets a minimum value that must be fed to the IN input for the block to integrate. 4. A detotalizing mode is provided. In this use, the OUT output begins to detotalize at the THLD value. You will find this EFB in the CONT_CTL library under the Conditioning group. ****Note: The function block integrates once every second **** Input Parameters: EN Input EN Data Type Bool Detailed Description This parameter is optional. When you select this input you also get the ENO output. When the EN input is set to one, the block is activated and can solve the function blocks algorithm. When EN is set to zero, the block is deactivated 1 and won’t solve the function blocks algorithm. This parameter can be turned on or off by double clicking on the function block itself. The function block has EN/ENO parameter that you can check or uncheck in this screen. IN Input IN Data Type Real Detailed Description This is the value that is being fed into the Totalizer block. The variable being integrated must be > 0.If a value of <= 0 is fed into the IN input, the block will not integrate. The IN input will integrate the value being fed into the input once a second. MODE Input MODE Data Type Mode_TOTALIZER Element Hold Data Type Bool Rst Bool Detailed Description This input is used for suspending and reinitializing the Totalizer function block. It contains two elements. Detailed Description Commonly referred to as hold mode. This element, when set to one, suspends the integration of the block. All values in the block will be held at there current value. When set to zero, integration of the block continues where it left off. This element takes the lowest priority. If rst or TR_S are set high at the same time hold is set high, rst or TR_S will take priority. Commonly referred to as reset mode. This element, when set to one, will reset outputs OUT, OUTC, and CTER back to zero (OUTC and CTER are parts of the INFO output). When the RST input is set back to zero, integration of the block will resume at their reinitialized values. If rst is set high the same time TR_S is set high, TR_S will take priority. PARA Input PARA Data Type Para_Totalizer Element Thld Data Type Real Cutoff Real Inc_dec Bool Detailed Description This input contains the parameters used in configuring the block. It contains three elements. Detailed Description This input is the threshold, meaning the maximum value you want the block to integrate up too. When the OUT output exceeds the THLD value, OUT will roll over and start at zero again. This element applies to a characteristic of the process such as the volume of the container. When the value of THLD is left at zero, the block will not integrate. This is the minimum value being accepted by the IN input. i.e. Lets say you set the CUTOFF input for a value of 20.4. Any value being fed to the IN input must be >= 20.4 or the Totalizer block will not integrate. The CUTOFF value must be >= 0. If the CUTOFF element is set to a value < 0, it will generate an online event error and generate an error in the STATUS output. Errors will be discussed in the STATUS output description. The INC_DEC element decides whether the block takes a totalizing or detotalizing operation. When this element is set to one. The Totalizer function block performs a detotalizing function. Basically the OUT output is set to the THLD value. When operating, the OUT value will begin to decrease until it reaches a negative value. When OUT reaches a negative value, the DONE element will be set to one and the CTER element will increment by one (DONE and CTER are part of the INFO output). The OUT output will roll 2 over to the THLD value and begin detotalizing again. The detotalizing function uses the following formula when decrementing OUT (new) = OUT (old) – IN * T. The detotalizing function uses the following formula when it reaches a negative value OUT = OUT + THLD. When the INC_DEC element is set to zero. The Totalizer function block performs a totalizing function. Basically the OUT output is set to the zero. When operating, the OUT value will begin to increase until it reaches the THLD value. When OUT exceeds the THLD value, the DONE element will be set to one and the CTER element will increment by one (DONE and CTER are part of the INFO output). The OUT output will roll over to zero and begin totalizing again. The totalizing function uses the following formula when incrementing OUT (new) = OUT (old) + IN * T. The totalizing function uses the following formula when it exceeds the THLD value OUT = OUT – THLD. T = time elapsed since the last execution of the block. TR_I Input TR_I Data Type Real Detailed Description This input is used in conjunction with the input TR_S. If you needed to adjust the value stored in the OUT, OUTC, and CTER. You would place the desired value in this input. The value stored in TR_I will not be moved until TR_S is set to one. Data Type Bool Detailed Description Commonly referred to as tracking mode. When this input is set to one, the value of TR_I is copied over to OUTC. i.e. Lets say TR_I is set for 1111.2 and the THLD is set for 100. When TR_S is set to one, the value 1111.2 from TR_I will be copied to the element OUTC. OUTC will then have a value of 1111.2. The element CTER will contain a value of 11 because the value 1111.2 has passed the value of the THLD eleven times. The OUT output will contain the value of 11.2 because that is the remainder of OUT = TR_S – (THLD * CTER). IF TR_S is set high the same time the elements RST or HOLD are set high. TR_S will take priority. TR_S Input TR_S Output Parameters: ENO Output ENO Data Type Bool Detailed Description The first output you have is ENO. This parameter is optional. When you select this output you also get the EN input. The ENO output when a selected gets activated upon successful completion of the function blocks algorithm. This parameter can be turned on or off by double clicking on the function block itself. The function block has EN/ENO parameter that you can check or uncheck in this screen. Data Type Real Detailed Description This output is the result of the integration of IN limited to the value of the OUT Output OUT 3 THLD value. In a totalizing mode, OUT begins at a zero value. When OUT exceeds the value of THLD, OUT will rollover and return to zero. OUT uses the formula OUT = OUT – THLD when it exceeds the THLD value in a totalizing mode. The OUT output is calculated using the following formula OUT (new) = OUT (old) + IN * T. In a detotalizing mode, OUT begins at the value of THLD. When OUT reaches a negative value, OUT will rollover and return to the value of THLD. OUT uses the formula OUT = OUT + THLD when it reaches a negative value in a detotalizing mode. The OUT input is calculated using the following formula in detotalizing mode OUT (new) = OUT (old) - IN * T. T = time elapsed since the last execution of the block. INFO Output Info Data Type Info_TOTALIZER Element Outc Data Type Real Cter UINT done Bool Detailed Description This output of the Totalizer block contains information regarding the integration of IN. It contains three elements. Detailed Description Commonly referred to as a global accumulator. The element OUTC contains the total integration of IN. While the block is functioning in a totalizing mode. It is calculated with the formula OUTC = (THLD * CTER) + OUT. When the block is functioning in a detotalizing mode. It is calculated with the following formula OUTC = THLD * CTER + (THLD – OUT). The CTER element is totals the number of times that OUT has exceeded the THLD value in a totalizing mode. In a detotalizing mode, CTER totals the number of times that OUT has reached a negative value. Every time the DONE element is set high, CTER will use the following formula to calculate CTER = CTER + 1. While the Totalizer function block is in a totalizing mode, the DONE element is set to one every time OUT exceeds the THLD value. If the Totalizer function block is in a detotalizing mode, the DONE element is set to one every time OUT reaches a negative value. This elements stays set to one until the next execution of the function block. STATUS Bit Bit = 1 Bit = 2 Bit = 3 Bit = 4 Bit = 6 Meaning Error in a floating point operation Illegal value detected in one of the floating point inputs Division by zero in a floating point operation The input TR_I or one of the parameters THLD or CUTOFF are negative: for its calculations the block will use the value zero The counter CTER has reached it maximum value (65535): CTER will remain locked at this value and the output OUTC is no longer significant. The outputs OUT and DONE, however, are still usable. 4