Home : Products : Hach WIMS : Interfaces : Hach WIMS Direct Server-Side Interface to Wonderware InTouch HMI : Documentation : Topics specific to the operation of this interface : Supported variable configurations for interface Q12097
Q12126 - HOWTO: Supported variable configurations for interface Q12097

Variable Setup for the Hach WIMS Direct Server-Side Interface to WonderWare InTouch.

To configure a variable to get values from WonderWare InTouch, select Edit/View Variables in the WIMS client and select the Interface tab.

Then click Interface To radio button. The drop down box next to the option is now enabled, click the drop down arrow and choose the WonderWare InTouch interface name (name given when configuring the interface).

Now you are ready to configure a signal tag for the WonderWare InTouch historian system. The Tag name and a Statistic are all that are mandatory.

  • This is the tag name in the WonderWare InTouch historian system. The historian referres to it as the Tagname.
  •  This is a listing of all the statistics supported by this interface. This includes the following statistics for a specified time period. For the example queries, we used filename '09232008', date of '09/23/2008' and tag name used is 'NR1_LVL':

    AVERAGE

    Take the average of the data points

    select AVG([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and [NR1_LVL] is not null  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)

    TOTAL

    Take the sum total of all values

    select SUM([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null

    MINIMUM

    Get the minimum value

    select MIN([NR1_LVL] + 0) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null 

    MAXIMUM

    Get the maximum value

    select MAX([NR1_LVL] + 0) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null

    FIRST

    Get the first value

    select TOP 1 ([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null  Order by [$date], [$time]

    LAST

    Get the last value

    select TOP 1 ([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null  Order by [$date] DESC, [$time] DESC

    DIFF

    Calculate the difference between the first and last values. If the first value is larger than the second then it will perform the following calculation: (10 ^ (Ceil(LOG(first_value) / LOG(10)))) - first_value + last_value

    Ceil will cause the value to round up

    1. Get FIRST value
    2. Get LAST value
    3. RESULT = LAST - FIRST
    4. IF RESULT < 0 THEN (10 ^ (Ceil(LOG(first_value) / LOG(10)))) - first_value + last_value

    RANGE

    Calculate the absolute value of the difference between the minimum and maximum values

    1. Get MIN value
    2. Get MAX value
    3. Get ABS(MIN - MAX)

    COUNT

    Counts the number of data points.

    select COUNT([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #12:00:48# AND [$time] <= #23:59:00#)  and [NR1_LVL] is not null

    TIMEGT(x)

    Counts the number of data points greater then 'x'. NOTE: You must know the data logging frequency in the CSV files to understand the units this function returns.  Typically, data is logged minutely in the CSV files, therefore this function returns the number of minutes.  However, if data in the CSV files is logged every 5 minutes, this function returns the number of 5 minute periods the value is greater than x.  You could use a Scale Factor of 5 to convert to minutes.   

    select COUNT([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #12:00:48# AND [$time] <= #23:59:00#)  and [NR1_LVL] is not null AND [NR1_LVL] > x

    TIMELT(x)

    Counts the number of data points less than 'x'. NOTE: You must know the data logging frequency in the CSV files to understand the units this function returns.  Typically, data is logged minutely in the CSV files, therefore this function returns the number of minutes.  However, if data in the CSV files is logged every 5 minutes, this function returns the number of 5 minute periods the value is less than x.  You could use a Scale Factor of 5 to convert to minutes.   

    select COUNT([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #12:00:48# AND [$time] <= #23:59:00#)  and [NR1_LVL] is not null AND [NR1_LVL] < x

    TIMEEQ(x)

    Counts the number of data points equal to 'x'.  NOTE: You must know the data logging frequency in the CSV files to understand the units this function returns.  Typically, data is logged minutely in the CSV files, therefore this function returns the number of minutes.  However, if data in the CSV files is logged every 5 minutes, this function returns the number of 5 minute periods the value is equal to x.  You could use a Scale Factor of 5 to convert to minutes.   

    select COUNT([NR1_LVL]) from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #12:00:48# AND [$time] <= #23:59:00#)  and [NR1_LVL] is not null AND [NR1_LVL] = x

    INVENTORY

    Running total of used volume. Only decreases in value are counted. Use the DEADBAND option in Hach WIMS variable setup to eliminate erroneous readings due to noise or vibrations.


    select [NR1_LVL] from [09232008.CSV]  where ([$date] >= #09/23/2008# AND [$date] <= #09/23/2008#)  and ([$time] > #00:00:00# AND [$time] <= #23:59:59#)  and [NR1_LVL] is not null

    Goes through each record to determine whether to add the value to a running total or not. Based on whether the value has decreased and the decrease was greater than the DEADBAND.

    MAXTIME The time the maximum value occurred (formatted as mm/dd/yyyy hh:mm:ss).  ONLY works with Text Parameters.
    MINTIME The time the minimum value occurred (formatted as mm/dd/yyyy hh:mm:ss).  ONLY works with Text Parameters.


 

  • This is the value to multiply the result by when using parameter variable types. Commonly used to convert from one unit base to another. For example to convert gallons per minute (GPM) to gallons per day (GPD), set the scale factor to 1440 (1440 minutes per day).

  • All three fields must have numeric values or the word None (as shown). The Low Range and High Range will crop data from the source. For example to eliminate negative numbers from a particular tag, set the Low Range to 0 (zero) - this will get any values equal to or greater than 0 (zero). The Deadband is used for the statistic Inventory and will elliminate noise levels up to the value specified. For example, if you enter .5 next to Deadband, any value change of .5 or less, will be ignored.


    • Start Time will set the beginning of the time slot for this variable.
    • Stop Time will set the ending time for the time slot.
    • Same Day as Start is only used by daily variables and it means the stop time is on the same day as the start time.
    • Day After Start is also only used by daily variables and it means the stop time is a day after the start time.

  •  Allows you to filter data based on another tag. For example, flow rate while not in backwash, but during backwash we don't want flow rates uploaded to Hach WIMS.
    • Node:Tag.Field is the node, tag, and field associated with what you want to filter by, in our example it would be the backwash state.
    • Middle field is the filter operator. This can be <, >, =, <=, >=, <>, or CYCLESTO.
    • Last fiedl is the filter value. So when the 'backwash state' is greater than 0 (not backwashing) then our system will get values. When the value drops to zero or negative, do not get values.

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 4/8/2009 9:12 AM.
Last Modified on 3/14/2012 12:02 PM.
Last Modified by Scott Dorner.
Article has been viewed 3668 times.
Rated 7 out of 10 based on 5 votes.
Print Article
Email Article