To have Alarm On, Ack, and Off Timestamps on the same line

7 Posts
4 Users
0 Likes
55 Views
KASI
 KASI
(@k-simanjalamarcinfo-com)
Posts: 134
Estimable Member
Topic starter
 

Hello,

As per the help document, it is possible to display Alarm On, Ack, and Off Timestamps on the same line.

I know we already have all the alarm state recorded in Log Table, but each state is a single line in Log Viewer.

But is it possible to achieve the same in the database archive? I mean to have all 3 information in the same table row?

Background of this request, I have a customer who did a migration from FactoryLink Scada to PcVue 15.
In FactoryLink DB, the alarms table has the time alarm occurred, time alarm was turned on and turned off. They need to make the table exactly the same.

So they want to know if there is any way they can continue doing archive from PcVue into the same table.

I have attached also the file "Arc문의" from the user. Here, the table of course also contains some other columns that PcVue does not provide, for example, SEQ, AID, etc.

Alternatively, has anyone done any SQL query to make it a view containing the above information in a single line instead? I believe if this is possible, maybe the user can make a periodic update to sync the view with their destination table.

Thanks for all your help.

Regards,
Kantha

 
Posted : 10/05/2022 11:48 am
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

Hi, there is a "trick" for that.

First look at this page for the method:
https://www.pcvuesolutions.com/support/ProductHelp/Content/Extras/21CFR_Logging_the_previous_value_of_a_register.php

You can then replace "PreviousControlValue" by:
- AlarmOnTimeStamp
- AlarmOffTimeStamp
- AlarmAckTimeStamp

With this you can store the timestamps in extended attributes. But it creates new records, it does not update the existing one.

 
Posted : 10/05/2022 4:41 pm
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

Hi, there is a "trick" for that.

First look at this page for the method:
https://www.pcvuesolutions.com/support/ProductHelp/Content/Extras/21CFR_Logging_the_previous_value_of_a_register.php

You can then replace "%PreviousControlValue%" by:
- AlarmOnTimeStamp
- AlarmOffTimeStamp
- AlarmAckTimeStamp

With this you can store the timestamps in extended attributes. But it creates new records, it does not update the existing one.

 
Posted : 10/05/2022 4:42 pm
LM
 LM
(@l-micaudarcinfo-com)
Posts: 383
Member Admin
 

Another trick would be to use Dream Report 😉
I don’t know how it does, but it is able to display our archived alarms into one line.

 
Posted : 10/05/2022 5:20 pm
KASI
 KASI
(@k-simanjalamarcinfo-com)
Posts: 134
Estimable Member
Topic starter
 

Hi Florent, thank you so much for the suggestion, I didn't know it could be customized other than PreviousControlValue. I will give a try your method and will update again.

Hi Ludo, thank you for the sharing. I found the DR table as well, but unfortunately using DR Debug log, it only gives the SQL used to extract raw data from PcVue HDs, but it did not expose the SQL that it uses within DR to make that table =.="

 
Posted : 10/05/2022 6:22 pm
(@admin_doc72)
Posts: 493
Member Admin
 

Hi Florent

No more magic keywords ?

 
Posted : 11/05/2022 7:19 pm
KASI
 KASI
(@k-simanjalamarcinfo-com)
Posts: 134
Estimable Member
Topic starter
 

Hello All,

As per Florent's suggestion, I managed to get the data into the extended text attribute.

Some remarks :
1. The keyword doesn't need to start and end with %. In case it is not clear from Florent's reply.
2. The text attributes will contain the timestamps in Chrono. So some work must be done to convert it into BIGINT and eventually to timestamp from SQL. To format it for display on the mimic, I didn't figure out how to achieve this.
3. For HDS, must remember to add the text attributes to the database column so that it can start recording.
4. If the archive unit is made for this purpose, make sure on Log Filter to keep only alarm-related events, otherwise, there will be too many events to filter.

I did a SQL query based on Google's guidance, to get only 1 row out from the log table for each variable alarm event until the next alarm occurs. I tested it with a small sample of data, and it works. You may need to amend it according to your need.
**I am not an SQL expert, so the performance when running on a large sample needs to be taken into consideration and tuned accordingly.
**The SQL is based on TATT3=OnTime TATT4=OffTime TATT5=AckTime

Kantha

 
Posted : 23/05/2022 6:30 pm