Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

SIEMENS Version: 0.

1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Application Note for MIS Reports in Excel


Department : I IA AS SP E&C
Project / System: Application Note for MIS Reports in Excel
Document No: G71052 / MIS / AN1
Document Version: V0.1
Release Date:
Status: Draft
Draft for Review
Approved / Released for Approval
Void / withdrawn and replaced by

Document Name Function Date Signature


Prepared by Parag Dawda System Engineer
(SIEMENS)
Reviewed by Tanmay Deokule Team Lead – E&C
(SIEMENS)
Reviewed by Sandeep Patkar Manager – E&C
(SIEMENS)
Approved by Samson Samuel Department Head E&C
(SIEMENS)

The reproduction, transmission or use of this document or its contents is not


permitted without express written authority.

Offenders will be liable for damages. All rights, including rights created by patent
grant or registration of a utility model or design, are reserved.

Page 1 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Document History

Version Version Author Reason for Modification Reference


Date
V0.1 20.08.09 Parag Dawda First Draft NA

Page 2 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Table of Contents 

Document History .................................................................... 2


Purpose .......................................................................................................................... 4
Scope .............................................................................................................................. 4
1. Introduction ....................................................................... 5
Overview: ....................................................................................................................... 5
2. Client Requirements............................................................ 6
3. Solution ............................................................................. 8
Requirements for PCS7: .............................................................................................. 8
Creating a template: .................................................................................................... 8
Script for reading tag values from PCS7 to Excel: .................................................. 9
Script Functioning: ..................................................................................................... 14
Configuring Reports: .................................................................................................. 15
4. Additional Features: .......................................................... 17
Reset of Tag Value:.................................................................................................... 17
Auto Reset: .................................................................................................................. 19
 

Page 3 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Purpose
The purpose of this document is to act as a reference for the
development and implementation of the Daily/Batch report system
for production, consumption etc. for a plant/process. This
document will be helpful for the system engineers as a quick
reference and a ready solution that can be easily implemented with
less engineering effort & cost.

Scope
This application note explains the procedure of implementation of
the MIS reports in excel for the daily production and consumption
of the products. It gives an hourly record of the products
consumption status. The implementation procedure herein includes
the basic scripting used for the generation of such report from
WinCC.

Page 4 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

1. Introduction
Overview:

The enormous growth of the automation in the process industry in


recent years there has been always the requirement for the
reporting system (MIS) for the production, consumption, material
supply etc. on daily basis or for a batch production. For this
requirement it has become necessary that there should be an easy
and a cost effective way of implementing such reporting system.
The application note here will give an easy solution for such type of
requirements.

The document includes the sample of the MIS reports implemented


for a daily production and consumption of the products for a
continuous production plant. Also it gives an over view of the
similar reporting for the batch process.

However this document only includes generation of reports in form


of excel document.

Page 5 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

2. Client Requirements

As per the customer there is a requirement of generating an excel


sheet t the end of the day. The report should start the first entry at
10:00 PM and end at 10:00 PM next day. There should be an excel
sheet generated for every day automatically from the DCS provided
from their plant.

The format of the report is as shown below.

Page 6 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Here in this report we need to login the details of the flow totalizers
at the end of every hour as seen in the format above. At the every
day 10:00 PM the excel sheet has to be generated with that date.
The column of total will give the consumption at any point of time.
For e.g. if the excel sheet is opened at 11:30 AM then the total will
show the consumption till 11:00 AM.

Page 7 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

3. Solution
Requirements for PCS7:

The solution provided for the above requirement from the client will
also have some prerequisites for the PCS7 system from where the
report is to be generated.
The prerequisites are as follows:

• The system must be the PCS7 OS Station continuously


running.
• The system must be pre installed with the MS Office
application.
• The global script in the Runtime must be enabled in the
computer properties – - > startup in WinCC Explorer.

Creating a template:

Create an excel sheet similar to the format provided. The equation


of updating the total value is also mentioned in this excel sheet and
the respective cells are kept hidden. The sample excel sheet is as
shown below which will be used as the reference for generation of
the daily report.

Page 8 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Script for reading tag values from PCS7 to Excel:

A VB Script is written to get the online values of tags from the


WinCC. The script is triggered at the start of every hour. The script
can be split in 4 different parts for better understanding. The script
with the comments is as below.

Page 9 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

‘****** Declaration *******


Option Explicit
Function action

Dim RowNo
Dim a
Dim M2_MODE, M3_MODE,M4_MODE, DEL
Dim objExcelApp,objExcelApp2
Dim fso
Dim fso1, f,fName
Dim i,x,y,z,p,q
Dim FileNameX

i = Hour(Now())
x = Day(Now())
y = Month(Now())
z = Year(Now())

Set fso = CreateObject("Scripting.FileSystemObject")

• Part1: Checking & creating the active excel file to update the tag values.

'************ Check whether working file (HOURLY_RPT.xls) exists ***********

If (fso.FileExists("D:\HOURLY_RPT.xls")) Then
Else

'****** If working file (HOURLY_RPT.xls) does not exists then create it *********

Set objExcelApp = CreateObject("Excel.Application")


objExcelApp.Visible = False

'****** Open the Template (Read only & Hidden file on the mentioned path) ******

objExcelApp.Workbooks.Open "D:\DAILY_RPT.xlt"
objExcelApp.DisplayAlerts = False

'******* Save the template as working file (HOURLY_RPT.xls) ****************

objExcelApp.ActiveWorkbook.Saveas"D:\HOURLY_RPT.xls"
'objExcelApp.ActiveWorkbook.Save '"D:\HOURLY_RPT.xls"
objExcelApp.DisplayAlerts = False
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing
End If

Page 10 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

• Part 2: Updating & Saving the report at 10:00 PM

If i = 22 Then

Set objExcelApp = CreateObject("Excel.Application")


objExcelApp.Visible = False
objExcelApp.Workbooks.Open "D:\HOURLY_RPT.xls"

RowNo = 34

‘****************** Updating Date & Time **************************

objExcelApp.Cells(RowNo,2) = Date()

objExcelApp.Cells(RowNo,3) = Time()

‘******************Updating Tag Values **************************

objExcelApp.Cells(RowNo,4).Value =HMIRuntime.Tags("FI7800/FI_7800_TOTAL.V").Read

objExcelApp.Cells(RowNo,5).Value =HMIRuntime.Tags("FI7851/FI_7851_TOTAL.V").Read

objExcelApp.Cells(RowNo,6).Value =HMIRuntime.Tags("FI7852/FI_7852_TOTAL.V").Read

objExcelApp.Cells(RowNo,7).Value =HMIRuntime.Tags("FI7853/FI_7853_TOTAL.V").Read

objExcelApp.Cells(RowNo,8).Value =HMIRuntime.Tags("FI7854/FI_7854_TOTAL.V").Read

'objExcelApp.Cells(RowNo,9).Value =HMIRuntime.Tags("TAGNAME").Read

objExcelApp.Cells(RowNo,10).Value =HMIRuntime.Tags("FI6800/FI_6800_TOTAL.V").Read

objExcelApp.Cells(RowNo,11).Value =HMIRuntime.Tags("FI2040/FI_2040_TOTAL.V").Read

objExcelApp.Cells(RowNo,12).Value =HMIRuntime.Tags("FI6951/FI6951_TOTAL.V").Read

objExcelApp.Cells(RowNo,13).Value =HMIRuntime.Tags("FI6952/FI6952_TOTAL.V").Read

objExcelApp.Cells(RowNo,14).Value =HMIRuntime.Tags("FI6852/FI_6852_TOTAL.V").Read

'objExcelApp.Cells(i,15).Value =HMIRuntime.Tags("TAGNAME").Read

'objExcelApp.Cells(i,16).Value =HMIRuntime.Tags("TAGNAME").Read

Page 11 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

‘************ Saving the Report With file name MIS_DD-MM-YYYY ********

FileNameX = "D:\MIS\MIS_" & x & "-" & y & "-" & z & ".xls"

objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs (FileNameX)
objExcelApp.DisplayAlerts = False
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing
End If

• Part 3: Updating & Saving the report at every trigger.

'** Select the particular row of excel sheet to be updated based of the current hour *

Select Case i
Case 22 : RowNo = 10
Case 23 : RowNo = 11
Case 0 : RowNo = 12
Case 1 : RowNo = 13
Case 2 : RowNo = 14
Case 3 : RowNo = 15
Case 4 : RowNo = 16
Case 5 : RowNo = 17
Case 6 : RowNo = 18
Case 7 : RowNo = 19
Case 8 : RowNo = 20
Case 9 : RowNo = 21
Case 10 : RowNo = 22
Case 11 : RowNo = 23
Case 12 : RowNo = 24
Case 13 : RowNo = 25
Case 14 : RowNo = 26
Case 15 : RowNo = 27
Case 16 : RowNo = 28
Case 17 : RowNo = 29
Case 18 : RowNo = 30
Case 19 : RowNo = 31
Case 20 : RowNo = 32
Case 21 : RowNo = 33
End Select

'***************** Write the data into excel sheet ************************

Set objExcelApp = CreateObject("Excel.Application")


objExcelApp.Visible = False

Page 12 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

objExcelApp.Workbooks.Open "D:\HOURLY_RPT.xls"

‘****************** Updating Date & Time **************************

objExcelApp.Cells(RowNo,2) = Date()

objExcelApp.Cells(RowNo,3) = Time()

‘******************Updating Tag Values **************************

objExcelApp.Cells(RowNo,4).Value =HMIRuntime.Tags("FI7800/FI_7800_TOTAL.V").Read

objExcelApp.Cells(RowNo,5).Value =HMIRuntime.Tags("FI7851/FI_7851_TOTAL.V").Read

objExcelApp.Cells(RowNo,6).Value =HMIRuntime.Tags("FI7852/FI_7852_TOTAL.V").Read

objExcelApp.Cells(RowNo,7).Value =HMIRuntime.Tags("FI7853/FI_7853_TOTAL.V").Read

objExcelApp.Cells(RowNo,8).Value =HMIRuntime.Tags("FI7854/FI_7854_TOTAL.V").Read

'objExcelApp.Cells(RowNo,9).Value =HMIRuntime.Tags("TAGNAME").Read

objExcelApp.Cells(RowNo,10).Value =HMIRuntime.Tags("FI6800/FI_6800_TOTAL.V").Read

objExcelApp.Cells(RowNo,11).Value =HMIRuntime.Tags("FI2040/FI_2040_TOTAL.V").Read

objExcelApp.Cells(RowNo,12).Value =HMIRuntime.Tags("FI6951/FI6951_TOTAL.V").Read

objExcelApp.Cells(RowNo,13).Value =HMIRuntime.Tags("FI6952/FI6952_TOTAL.V").Read

objExcelApp.Cells(RowNo,14).Value =HMIRuntime.Tags("FI6852/FI_6852_TOTAL.V").Read

'objExcelApp.Cells(i,15).Value =HMIRuntime.Tags("TAGNAME").Read

'objExcelApp.Cells(i,16).Value =HMIRuntime.Tags("TAGNAME").Read

objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.Save
objExcelApp.DisplayAlerts = False
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing

• Part 4: Refreshing the active Excel to clear all the entries other than 10:00
PM.

'*********** For Flushing The Hourly Report After Saving *************

Page 13 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

If i = 22 Then

Set objExcelApp2 = CreateObject("Excel.Application")

objExcelApp2.Visible = False

objExcelApp2.Workbooks.Open "D:\HOURLY_RPT.xls"
For p=11 To 37
For q=1 To 16
objExcelApp2.Cells(p,q).Value =""
Next
Next
objExcelApp2.ActiveWorkbook.Save
objExcelApp2.Workbooks.Close
objExcelApp2.Quit
Set objExcelApp2 =Nothing
End If

End Function

‘**************************** End ***************************

Script Functioning:

The above script checks for the availability of the current excel file
to be updated (HOURLY_RPT.xls) at every trigger. If the file is not
found it creates the file with the name “HOURLY_RPT.xls” in the
“D:\” drive. With respect to the hour at which the script is
triggered it selects the specific row and as per the template
updates the values of the respective tags in the cells of the row
selected. At 10:00 PM every day script updates the entry in the
cells of Row no. 34 and then saves the file with the name
“MIS_DD-MM-YYYY.xls” at the location “D:\MIS\”. Also at
10:00 PM after saving the file it selects the Row no. as per the hour
and updates the respective cells. It also clears all the remaining
entries in the current excel file.

Page 14 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Configuring Reports:

• From the format received from the client an excel template


file is made with the name DAILY_RPT.xlt and is saved in
“D:\” drive. Enable the read-only and hidden properties of
this template file so that no one can just delete the file.
• Create the folder name MIS on the “D:\” drive to save the
daily report.
• Copy the script as the Global VB Script (Action) and compile
and save the same as shown in the figure below.

Page 15 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

• Set a cyclic trigger to the script so that the excel report gets
updated every hour. The same is shown in the figure below.

• Put the WinCC to runtime.


• The above script will generate a file at 10:00 PM every day
with the name “MIS_DD-MM-YYYY.xls”.

Page 16 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

4. Additional Features:
Reset of Tag Value:

The additional to the client requirement an additional row of the


reset is provided which gives the flexibility to the client for resetting
the tag values once in a day. There are reset buttons provided
besides each tag on the OS screen. A VB Script is attached with
each reset button which captures the value of the tag at the time
of resetting. It also calculates the difference of the of the tag value
at the time of reset with the value captured during the last hour.
This difference is then added to the consumption total in the excel
sheet.

• Script: The Commented script is as follows.

‘**************************** Start ***************************


Sub OnClick(ByVal Item)

Dim i,Rowno
Dim ObjExcelApp

‘********************* Initializing Rest Bit ******************************

HMIRuntime.Tags("FI7800/RST_FI7800_TOTAL.I0").Write 0

‘*************** Transfer the Value of Tag before Resetting *****************

Set objExcelApp = CreateObject("Excel.Application")


objExcelApp.Visible = False
objExcelApp.Workbooks.Open "D:\HOURLY_RPT.xls"

objExcelApp.Cells(36,2).Value = "Reset"

objExcelApp.Cells(36,4).Value =HMIRuntime.Tags("FI7800/FI_7800_TOTAL.V").Read

‘************* Check the Hour to compare the last value in the Excel *********

i = Hour(Now())

Select Case i
Case 22 : RowNo = 10
Case 23 : RowNo = 11
Case 0 : RowNo = 12

Page 17 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Case 1 : RowNo = 13
Case 2 : RowNo = 14
Case 3 : RowNo = 15
Case 4 : RowNo = 16
Case 5 : RowNo = 17
Case 6 : RowNo = 18
Case 7 : RowNo = 19
Case 8 : RowNo = 20
Case 9 : RowNo = 21
Case 10 : RowNo = 22
Case 11 : RowNo = 23
Case 12 : RowNo = 24
Case 13 : RowNo = 25
Case 14 : RowNo = 26
Case 15 : RowNo = 27
Case 16 : RowNo = 28
Case 17 : RowNo = 29
Case 18 : RowNo = 30
Case 19 : RowNo = 31
Case 20 : RowNo = 32
Case 21 : RowNo = 33
End Select

objExcelApp.Cells(37,4).Value = objExcelApp.Cells(36,4).Value - objExcelApp.Cells(RowNo,4)

‘******************** Reset tag Value **********************************

HMIRuntime.Tags("FI7800/RST_FI7800_TOTAL.I0").Write 1

MsgBox( RowNo )

objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.Save
objExcelApp.DisplayAlerts = False
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing

End Sub
‘**************************** END ***************************

For different tags different reset buttons were created. The same
script was used by changing the respective tag name and the cell
reference for the reset value and the difference value to be
updated as per the template.

Page 18 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Auto Reset:

Along with the manual reset provided for individual tags, there is a
script in function which will reset the tag values at a specific date
and time every month/year. This script will also update the same
Reset row with the tag values at the time of reset and will
calculate the total considering the difference in the reset value and
value captured during the last hour.

• Script: The Commented script is as follows.

‘**************************** Start ***************************


Option Explicit
Function action

Dim i
Dim RowNo
Dim objExcelApp

‘********************* Initializing Rest Bit ******************************

HMIRuntime.Tags("FI7800/RST_FI7800_TOTAL.I0").Write 0

HMIRuntime.Tags("FI7851/RST_FI7851_TOTAL.I0").Write 0

HMIRuntime.Tags("FI7854/RST_FI7854_TOTAL.I0").Write 0

HMIRuntime.Tags("FI7852/RST_FI7852_TOTAL.I0").Write 0

HMIRuntime.Tags("FI7853/RST_FI7853_TOTAL.I0").Write 0

HMIRuntime.Tags("FI2040/RST_FI2040_TOTAL.I0").Write 0

HMIRuntime.Tags("FI6800/RST_FI6800_TOTAL.I0").Write 0

HMIRuntime.Tags("FI6951/RST_FI6951_TOTAL.I0").Write 0

HMIRuntime.Tags("FI6852/RST_FI6852_TOTAL.I0").Write 0

HMIRuntime.Tags("FI6952/RST_FI6952_TOTAL.I0").Write 0

‘*************** Transfer the Value of Tag before Resetting *****************

Set objExcelApp = CreateObject("Excel.Application")


objExcelApp.Visible = False

Page 19 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

objExcelApp.Workbooks.Open "D:\HOURLY_RPT.xls"

objExcelApp.Cells(36,2).Value = "Reset"

objExcelApp.Cells(36,4).Value =HMIRuntime.Tags("FI7800/FI_7800_TOTAL.V").Read

objExcelApp.Cells(36,5).Value =HMIRuntime.Tags("FI7851/FI_7851_TOTAL.V").Read

objExcelApp.Cells(36,6).Value =HMIRuntime.Tags("FI7852/FI_7852_TOTAL.V").Read

objExcelApp.Cells(36,7).Value =HMIRuntime.Tags("FI7853/FI_7853_TOTAL.V").Read

objExcelApp.Cells(36,8).Value =HMIRuntime.Tags("FI7854/FI_7854_TOTAL.V").Read

'objExcelApp.Cells(36,9).Value =HMIRuntime.Tags("TAGNAME").Read

objExcelApp.Cells(36,10).Value =HMIRuntime.Tags("FI6800/FI_6800_TOTAL.V").Read

objExcelApp.Cells(36,11).Value =HMIRuntime.Tags("FI2040/FI_2040_TOTAL.V").Read

objExcelApp.Cells(36,12).Value =HMIRuntime.Tags("FI6951/FI6951_TOTAL.V").Read

objExcelApp.Cells(36,13).Value =HMIRuntime.Tags("FI6952/FI6952_TOTAL.V").Read

objExcelApp.Cells(36,14).Value =HMIRuntime.Tags("FI6852/FI_6852_TOTAL.V").Read

'objExcelApp.Cells(36,15).Value =HMIRuntime.Tags("TAGNAME").Read

'objExcelApp.Cells(36,16).Value =HMIRuntime.Tags("TAGNAME").Read

‘************* Check the Hour to compare the last value in the Excel *********

i = Hour(Now())

Select Case i
Case 22 : RowNo = 10
Case 23 : RowNo = 11
Case 0 : RowNo = 12
Case 1 : RowNo = 13
Case 2 : RowNo = 14
Case 3 : RowNo = 15
Case 4 : RowNo = 16
Case 5 : RowNo = 17
Case 6 : RowNo = 18
Case 7 : RowNo = 19
Case 8 : RowNo = 20
Case 9 : RowNo = 21
Case 10 : RowNo = 22

Page 20 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

Case 11 : RowNo = 23
Case 12 : RowNo = 24
Case 13 : RowNo = 25
Case 14 : RowNo = 26
Case 15 : RowNo = 27
Case 16 : RowNo = 28
Case 17 : RowNo = 29
Case 18 : RowNo = 30
Case 19 : RowNo = 31
Case 20 : RowNo = 32
Case 21 : RowNo = 33
End Select

objExcelApp.Cells(37,4).Value = objExcelApp.Cells(36,4).Value - objExcelApp.Cells(RowNo,4)

objExcelApp.Cells(37,5).Value = objExcelApp.Cells(36,5).Value - objExcelApp.Cells(RowNo,5)

objExcelApp.Cells(37,6).Value = objExcelApp.Cells(36,6).Value - objExcelApp.Cells(RowNo,6)

objExcelApp.Cells(37,7).Value = objExcelApp.Cells(36,7).Value - objExcelApp.Cells(RowNo,7)

objExcelApp.Cells(37,8).Value = objExcelApp.Cells(36,8).Value - objExcelApp.Cells(RowNo,8)

'objExcelApp.Cells(37,9).Value = objExcelApp.Cells(36,9).Value - objExcelApp.Cells(RowNo,9)

objExcelApp.Cells(37,10).Value = objExcelApp.Cells(36,10).Value - objExcelApp.Cells(RowNo,10)

objExcelApp.Cells(37,11).Value = objExcelApp.Cells(36,11).Value - objExcelApp.Cells(RowNo,11)

objExcelApp.Cells(37,12).Value = objExcelApp.Cells(36,12).Value - objExcelApp.Cells(RowNo,12)

objExcelApp.Cells(37,13).Value = objExcelApp.Cells(36,13).Value - objExcelApp.Cells(RowNo,13)

objExcelApp.Cells(37,14).Value = objExcelApp.Cells(36,14).Value - objExcelApp.Cells(RowNo,14)

'objExcelApp.Cells(37,15).Value = objExcelApp.Cells(36,15).Value - objExcelApp.Cells(RowNo,15)

‘******************** Reset tag Value **********************************

HMIRuntime.Tags("FI7800/RST_FI7800_TOTAL.I0").Write 1

HMIRuntime.Tags("FI7851/RST_FI7851_TOTAL.I0").Write 1

HMIRuntime.Tags("FI7854/RST_FI7854_TOTAL.I0").Write 1

HMIRuntime.Tags("FI7852/RST_FI7852_TOTAL.I0").Write 1

Page 21 of 22
SIEMENS Version: 0.1
Application Note:  
I IA AS SP E&C
MIS Reports in Excel

HMIRuntime.Tags("FI7853/RST_FI7853_TOTAL.I0").Write 1

HMIRuntime.Tags("FI2040/RST_FI2040_TOTAL.I0").Write 1

HMIRuntime.Tags("FI6800/RST_FI6800_TOTAL.I0").Write 1

HMIRuntime.Tags("FI6951/RST_FI6951_TOTAL.I0").Write 1

HMIRuntime.Tags("FI6852/RST_FI6852_TOTAL.I0").Write 1

HMIRuntime.Tags("FI6952/RST_FI6952_TOTAL.I0").Write 1

MsgBox( RowNo )

objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.Save
objExcelApp.DisplayAlerts = False
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp = Nothing

End Function

‘**************************** END ***************************

This script is functioning similar to manual reset script for individual


tag. The only difference it makes with this script is that it will work
as a master reset for all the tags. The trigger provided for this
script is 31st March at 12:00 Noon. With this script we can avoid the
manual intervention of operator in the resetting the tag values.

Page 22 of 22

You might also like