Hello All,
Let me start by saying that I am new to access and also new to forums and the problem I am about to write about is difficult to explain but I will try my best..... Here goes.
OK I work with a database called the 'Online Archive' it works in Access '97. To help you understand what the database is used for I will quickly describe the function of my Job.
I work as a SCADA Operator (Supervisory Control and Data acquisitioner). I have several terminals running Win CC. This program monitors an automated warehouse, more specifically it monitors un-explained stoppages. If a stoppage occurs I get alerted in two ways. Firstly, graphically the equipment will go red and secondly I get an 'Alarm' which provides details about the stoppages (time/location/reason etc). There are 3 states to each alarm. Error occurred is the start time, error acknowledged is when I click to say that the alarm has been noted and appropriate response has been given. Alarm solved is the final state.
Going back to my database. The WinCC system mentioned above logs all this data and via an OBDC linked table exports all these alarms along with the details to the Online Archive. Its then my job to fill in reasons why these stoppages occurred. At the end of the day all the days errors are exported to an excel file and used in another database.
My Problem:
Each alarm has the following data:
Date/Time/MsgNr/Time/Diff/Status/Counter
The data I want to concentrate on here is contained within Time Diff, Status and counter. The other columns are irrelevant for this issue.
Time Diff For each alarm there will be 3 of these 1 for each status. The time diff for a status 1 alarm is always 0. The time diff for a status 2 alarm is the time difference between status 1 and status 2 of that alarm. The time diff for a status 3 alarm is the time difference between status 1 and status 3 of that Alarm.
Status is 1, 2 or 3. 1 = Alarm Occurred 2 = Alarm Acknowledged and 3 = Alarm solved.
Counter is a unique number generated by WinCC and cannot be changed
I Appreciate this may be a little hard to follow so here is an example of one alarm.
14/07/2010 00:06:05/51040/0/14646185/1
14/07/2010 00:07:00/51040/55/14646186/2
14/07/2010 00:07:08/51040/63/14646187/3
As you can see this error was solved in 63 seconds and acknowledged after 55 seconds.
Now, in the data that is used at the end of the day every alarm that never reached the 3 minute mark is not counted yet we still have to fill them in. There are a lot of these alarms that don’t reach the minimum time and I feel it is a waste of our time filling them in so I was looking at a query which could identify the time difference between the status 1 and status 3 alarm and 'autofill' the data accordingly but it is proving to be an impossible task due to the following.
The Online Archive has a Graphical form where we fill in the reasons for the errors, these alarms then get stored in another table with the reason ALWAYS assigned to the Status 1 part of the alarm. The time difference of status1 part of the alarm is always 0 since this is when the alarm occurred, which rules out a less than 3 minute type of query!
The counter never really has any sequence. Since several errors can occur at any one time and the counter goes up by 1 for every update to any alarm. So I cannot simply write a query which looks at the alarm by using the counters.
The query needs to do the following:
Look at the alarms, identify which status belongs to which alarm. The same alarm can only ever be active once at any one time but there is a possibility of it happening several times a day. By this I mean that error 51000 can only be active once at any one time but it could have been in error 15 times throughout that day, so the query would have to work this out. I think this bit maybe quite simple but I cannot for the life of me work it out.
The next bit is it needs to work out the time diff between status 1 and status 3 and if it is below 3 minutes (180 seconds) then It needs to assign the reason to the status 1 part of that alarm. It would also need to take into account that this error could have been active more than once and thus not alter the other ones.
It is worth noting that nothing can be changed about how the data comes into access. The WinCC project does not have that feature, I have looked!
I think for now I will leave it at that, chances are this makes no sense what-so-ever. I hope someone can help.
If any more details are needed then please ask and I will try my best.
Thanks very much
Finchy!
Let me start by saying that I am new to access and also new to forums and the problem I am about to write about is difficult to explain but I will try my best..... Here goes.
OK I work with a database called the 'Online Archive' it works in Access '97. To help you understand what the database is used for I will quickly describe the function of my Job.
I work as a SCADA Operator (Supervisory Control and Data acquisitioner). I have several terminals running Win CC. This program monitors an automated warehouse, more specifically it monitors un-explained stoppages. If a stoppage occurs I get alerted in two ways. Firstly, graphically the equipment will go red and secondly I get an 'Alarm' which provides details about the stoppages (time/location/reason etc). There are 3 states to each alarm. Error occurred is the start time, error acknowledged is when I click to say that the alarm has been noted and appropriate response has been given. Alarm solved is the final state.
Going back to my database. The WinCC system mentioned above logs all this data and via an OBDC linked table exports all these alarms along with the details to the Online Archive. Its then my job to fill in reasons why these stoppages occurred. At the end of the day all the days errors are exported to an excel file and used in another database.
My Problem:
Each alarm has the following data:
Date/Time/MsgNr/Time/Diff/Status/Counter
The data I want to concentrate on here is contained within Time Diff, Status and counter. The other columns are irrelevant for this issue.
Time Diff For each alarm there will be 3 of these 1 for each status. The time diff for a status 1 alarm is always 0. The time diff for a status 2 alarm is the time difference between status 1 and status 2 of that alarm. The time diff for a status 3 alarm is the time difference between status 1 and status 3 of that Alarm.
Status is 1, 2 or 3. 1 = Alarm Occurred 2 = Alarm Acknowledged and 3 = Alarm solved.
Counter is a unique number generated by WinCC and cannot be changed
I Appreciate this may be a little hard to follow so here is an example of one alarm.
14/07/2010 00:06:05/51040/0/14646185/1
14/07/2010 00:07:00/51040/55/14646186/2
14/07/2010 00:07:08/51040/63/14646187/3
As you can see this error was solved in 63 seconds and acknowledged after 55 seconds.
Now, in the data that is used at the end of the day every alarm that never reached the 3 minute mark is not counted yet we still have to fill them in. There are a lot of these alarms that don’t reach the minimum time and I feel it is a waste of our time filling them in so I was looking at a query which could identify the time difference between the status 1 and status 3 alarm and 'autofill' the data accordingly but it is proving to be an impossible task due to the following.
The Online Archive has a Graphical form where we fill in the reasons for the errors, these alarms then get stored in another table with the reason ALWAYS assigned to the Status 1 part of the alarm. The time difference of status1 part of the alarm is always 0 since this is when the alarm occurred, which rules out a less than 3 minute type of query!
The counter never really has any sequence. Since several errors can occur at any one time and the counter goes up by 1 for every update to any alarm. So I cannot simply write a query which looks at the alarm by using the counters.
The query needs to do the following:
Look at the alarms, identify which status belongs to which alarm. The same alarm can only ever be active once at any one time but there is a possibility of it happening several times a day. By this I mean that error 51000 can only be active once at any one time but it could have been in error 15 times throughout that day, so the query would have to work this out. I think this bit maybe quite simple but I cannot for the life of me work it out.
The next bit is it needs to work out the time diff between status 1 and status 3 and if it is below 3 minutes (180 seconds) then It needs to assign the reason to the status 1 part of that alarm. It would also need to take into account that this error could have been active more than once and thus not alter the other ones.
It is worth noting that nothing can be changed about how the data comes into access. The WinCC project does not have that feature, I have looked!
I think for now I will leave it at that, chances are this makes no sense what-so-ever. I hope someone can help.
If any more details are needed then please ask and I will try my best.
Thanks very much
Finchy!