Skip to main content
InSource Solutions

InTouch AlmDBViewCtrl: Adding time and date selection

insource logo large.jpg

                           TECH NOTE                    

 

Description

Describes one method for adding drop down boxes to an InTouch window so that the user can select the times and dates of alarms to display.

  • Author: Dillon Perera
  • Published: 12/31/2014
  • Applies to: InTouch

How and When to Use this Guide

This guide is intended for use with InTouchs Alarm Database Viewer Control (AlmDBViewCtrl).

Instructions

  1. Create a new Window.
  2. Go to Wizards > ActiveX and add an AlarmDBView Control to your window.
  3. Double click on the AlarmDBView control
    1. On the Database tab enter the information for where your Alarm database is.
    2. On the Selection tab select the default time frame that you want to show (I think you wanted to set this to last 3 days)
    3. On the Control Name tab, note the name of the control as we’ll need to use this in scripts.  (Mine is named AlmDBViewCtrl5)
  4. Go to Special Menu > Configure > Wizard/ActiveX installation
    1. Go to the ActiveX Control Installation tab
    2. The list at the bottom of the screen lists all of the ActiveX’s installed on your PC.  This list will be different based on what software you have installed.  From the list I selected the “Microsoft Date and Time Picker Control, version 6.0”.  Once selected hit Install, to add it to the top of the list.
      Note: Because these controls are not Wonderware controls, we can’t guarantee they’ll work, and we don’t have a lot of documentation on them.  The Microsoft controls you can usually find a lot of information online about though.


      InTouchAlmDBViewCtrl_AddDateTimePicker.png

       
  5. Go to Wizards, and in the ActiveX tab you should now see DTPicker.  Add four of these to the screen, one for start Date and Time, one for end Date and Time.  Also add a button that will be used for refreshing the control with the new dates.
    1. Here is what my window looks like:

      InTouchAlmDBViewCtrl_ExampleWindow.png
       
  6. Double click on the DateTime pickers to bring up the Properties window.
    1. On the ControlName tab of each, name them DTPicker1Date, DTPicker1Time, DTPicker2Date, DTPicker2Time.
    2. On the General Tab for the two Date fields, set the Format to 1-dtpShortDate.  For the two Time Fields, set the Format to 2-dtpTime.
    3. Once you’ve done this it’ll look like this (Times shown now, instead of 4 dates).

      InTouchAlmDBViewCtrl_SetFormat.png
       
  7. Double click the Refresh button, and add the following action script:
    InTouchAlmDBViewCtrl_Script.png

 

  • Was this article helpful?