TN IT134 InTouch AlmDBViewCtrl: Adding time and date selection
Description
Want to use the AlmDBViewCtrl in InTouch to look at Alarms, but want to specify time and date for the Start and End times.
- Author: Dillon Perera
- Published: 05/29/2015
- Applies to: InTouch, with AlmDBViewCtrl ActiveX
Details
- Create a new Window.
- Go to Wizards > ActiveX and add an AlarmDBView Control to your window.
- Double click on the AlarmDBView control
- On the Database tab enter the information for where your Alarm database is.
- 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)
- On the Control Name tab, note the name of the control as we’ll need to use this in scripts. (Mine is named AlmDBViewCtrl5)
- Go to Special Menu > Configure > Wizard/ActiveX installation
- Go to the ActiveX Control Installation tab
- 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.
- 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.
- Double click on the DateTime pickers to bring up the Properties window.
- On the ControlName tab of each, name them DTPicker1Date, DTPicker1Time, DTPicker2Date, DTPicker2Time.
- 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.
- Once you’ve done this it’ll look like this (Times shown now, instead of 4 dates).
- Double click the Refresh button, and add the following action script: