InTouch 2017 Historical Alarm Fitler by date and time

pisoj

Member
Join Date
Jul 2018
Location
Osijek
Posts
10
Hello to all of you!

I am working with InTouch 2017 application for HMI.
So far, so good - configuration is simple, there is two clients, each client has his own SQL database from which we read alarms.

Alarms are working, historical alarms are also working on both of them.

BUT i would like to have an option to have a filter of Historical alarms by date and time ( starting date and time and end date and time) to show only ones that appeared in selected timespan.

So far, I did not manage to make it work.

I can paste here a script i have on a button.


//////////////////////////////////////////////////////////////////////////////////

DIM txtVariable AS MESSAGE;
DIM StartTime AS MESSAGE;
DIM EndTime AS MESSAGE;
DIM HistStartTime AS MESSAGE;
DIM HistEndTime AS MESSAGE;
DIM IsValid AS DISCRETE;

IsValid = 1;
GetPropertyM ("txtStartMonth", txtVariable );
StartTime = Text(StringToIntg(txtVariable),"00");
HistStartTime = Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 1 OR StringToIntg(txtVariable) > 12 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtStartDay", txtVariable );
StartTime = StartTime + "/" + Text(StringToIntg(txtVariable),"00");
HistStartTime = Text(StringToIntg(txtVariable),"00") + "/" + HistStartTime;
IF StringToIntg(txtVariable) < 1 OR StringToIntg(txtVariable) > 31 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtStartYear", txtVariable );
StartTime = StartTime + "/" + Text(StringToIntg(txtVariable),"0000");
HistStartTime = HistStartTime + "/" + Text(StringToIntg(txtVariable),"0000");
IF StringToIntg(txtVariable) < 2000 OR StringToIntg(txtVariable) > 2036 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtStartHour", txtVariable );
StartTime = StartTime + " " + Text(StringToIntg(txtVariable),"00");
HistStartTime = HistStartTime + " " + Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 0 OR StringToIntg(txtVariable) > 23 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtStartMin", txtVariable );
StartTime = StartTime + ":" + Text(StringToIntg(txtVariable),"00");
HistStartTime = HistStartTime + ":" + Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 0 OR StringToIntg(txtVariable) > 59 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtEndMonth", txtVariable );
EndTime = Text(StringToIntg(txtVariable),"00");
HistEndTime = Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 1 OR StringToIntg(txtVariable) > 12 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtEndDay", txtVariable );
EndTime = EndTime + "/" + Text(StringToIntg(txtVariable),"00");
HistEndTime = Text(StringToIntg(txtVariable),"00") + "/" + HistEndTime;
IF StringToIntg(txtVariable) < 1 OR StringToIntg(txtVariable) > 31 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtEndYear", txtVariable );
EndTime = EndTime + "/" + Text(StringToIntg(txtVariable),"0000");
HistEndTime = HistEndTime + "/" + Text(StringToIntg(txtVariable),"0000");
IF StringToIntg(txtVariable) < 2000 OR StringToIntg(txtVariable) > 2050 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtEndHour", txtVariable );
EndTime = EndTime + " " + Text(StringToIntg(txtVariable),"00");
HistEndTime = HistEndTime + " " + Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 0 OR StringToIntg(txtVariable) > 23 THEN
IsValid = 0;
ENDIF;

GetPropertyM ("txtEndMin", txtVariable );
EndTime =EndTime + ":" + Text(StringToIntg(txtVariable),"00");
HistEndTime = HistEndTime + ":" + Text(StringToIntg(txtVariable),"00");
IF StringToIntg(txtVariable) < 0 OR StringToIntg(txtVariable) > 59 THEN
IsValid = 0;
ENDIF;

IF IsValid == 1 THEN
#EveDbViewCtrl.EndTime = EndTime;
#EveDbViewCtrl.StartTime = StartTime;
#AlmDbViewCtrl.EndTime = EndTime;
#AlmDbViewCtrl.StartTime = StartTime;
#EveDbViewCtrl.Refresh();
#AlmDbViewCtrl.Refresh();
m_HistStartTime = StringLeft(HistStartTime,16);
m_HistEndTime = StringLeft(HistEndTime,16);
HideSelf;
ENDIF;

//////////////////////////////////////////////////////////////////////////////

so far, all of the alarms from history are displayed, no matter what i write in the filter :)

Maybe it is not even possible to do this without some ActiveX control or something.

If anyone ha any hint or idea, I would be grateful!

Thanks , cheers!
 
I managed to make it work, as nobody was interested to participate, i will post solution if someone needs it. Cheers.
 

Similar Topics

Hi everyone, I have activated Intouch 2017 in Schneider Electric License Manager. After that I reinstalled window and Intouch. I tried to...
Replies
5
Views
6,554
Hello everyone. Please help me to solve this issue with Intouch 2017. I get notice “ Failed to open Intouch Application” when I try to open my...
Replies
4
Views
4,680
Greetings, I am a junior engineer, I am about to take the CSI exam to get certified in InTouch 2017 to apply for a job. Can anyone who has taken...
Replies
0
Views
1,038
Hi! We are currently updating our Intouch 2012 (v10.5 and v10.6) and Intouch 2014 (v11.1) to Intouch 2017 (v17.3). We were using workstations as...
Replies
10
Views
4,360
I have generally not been required to implement security in InTouch applications, so if there has ever been a need, then have used the InTouch...
Replies
2
Views
2,892
Back
Top Bottom