The preparation of reports

ypf_108

Member
Join Date
Jul 2009
Location
china
Posts
160
Hello. I am going to use the RSVivw32 to prepare Report. Require a inquiry and export Excel table functionality. The Controllogix v17.00 data is collected using RSLinx2.43 of the OPC. I am a novice, its not too familiar with. Please give guidance in detail, of course, able to provide more learning materials are the bestRSVivw32 7.00 version thanks
 
If you log data to an odbc DB then in excel ceate a macro to record your keystrokes then get external data format it then get data save macro convert to VB you can then edit the code (sql statement) to create a query in the vb code in excel.
This is one of the best ways as you do not need to do anything in RSV the speadsheet can be used on any networked pc connected to your network.
as below (note: this was done a DB connected to an IFIX Scada
Converted macro
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=BScada;UID=BRMS;Trusted_Connection=Yes;APP=Microsoft® Query;WSID=LEN_HOME;DATABASE=BScada;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT FIXALARMS.ALM_TAGNAME, FIXALARMS.ALM_TAGDESC, FIXALARMS.ALM_VALUE, FIXALARMS.ALM_DESCR, FIXALARMS.ALM_ALMAREA, FIXALARMS.ALM_OPNAME, FIXALARMS.ALM_OPFULLNAME, FIXALARMS.ALM_DATELAST, FIXALARMS." _
, _
"ALM_TIMELAST, FIXALARMS.ALM_DTLAST" & Chr(13) & "" & Chr(10) & "FROM BCHScada.dbo.FIXALARMS FIXALARMS" & Chr(13) & "" & Chr(10) & "ORDER BY FIXALARMS.ALM_DATELAST" _
)
.Name = "Query from BScada"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub
 
parky, thank you. This way I just listen to my engineer said, but I still will not be. Can you made a case, I even thanked.
 
I forgot to add just edit the SQL statement to include the filter you need. If your not upto speed on SQL at least this will get you started
 
parky, thank you. This way I just listen to my engineer said, but I still will not be. Can you made a case, I even thanked
 
thank you. In this way, I just listen to my engineer said, but I still do not. You can do so by sending your case procedure? I am very grateful
 
I only use filter for dates i.e. get alarms (or Data) from date to date as below

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=BScada;UID=BRMS;Trusted_Connection=Yes;APP=Microsoft® Query;WSID=LEN_HOME;DATABASE=BScada;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT FIXALARMS.ALM_TAGNAME, FIXALARMS.ALM_TAGDESC, FIXALARMS.ALM_VALUE, FIXALARMS.ALM_DESCR, FIXALARMS.ALM_ALMAREA, FIXALARMS.ALM_OPNAME, FIXALARMS.ALM_OPFULLNAME, FIXALARMS.ALM_DATELAST, FIXALARMS." _
, _
"ALM_TIMELAST, FIXALARMS.ALM_DTLAST" & Chr(13) & "" & Chr(10) & "FROM BScada.dbo.FIXALARMS FIXALARMS" & Chr(13) & "" & Chr(10) & "WHERE (FIXALARMS.ALM_DATELAST>='27/04/06' And FIXALARMS.ALM_DATELAST<='28/09/06')" & Chr(13) & "" & Chr(10) & "ORDER BY FIXALARMS.ALM_DATELAST, FIXALARMS" _
, ".ALM_TIMELAST")
.Name = "Query from BScada"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub
as you can see the where statement gets data from a date to a date, you can substitute the fixed date (and time) with a variable dates selected from a date picker (maybe a calendar control).
Most of the data collected on my sheets is done by shift patterns when you create the macro & get external data select the fields you wish to get, the dates to start from & end with etc. the code in the macro can be copied into your routine & modified to suit, if you return data to say Sheet 3 then manipulate the data in VB i.e. copy data required to sheet 2 & use the data in sheet 1 as graphs etc.
You have to be careful with hard returns in sql the above code may have been formated differently when pasted into this editor.
I'm not at work at the moment so only have resources on my home pc but If I can I will post an excel project with a real system however you will not be able to run it as there will be no DB.
 

Similar Topics

I have experience in multiple studios writing mostly ladder logic for smaller applications. I am about to write by far the largest program I have...
Replies
8
Views
2,375
Hello Everyone, I am working on reports in Vijeo Citect V7.40. I want to generate a report whenever I press the button. I am able to generate it...
Replies
0
Views
894
Any advice on below issue? ➢ IFix 5.0 with USB Hardware Dongle License Standalone application connected to RX3i PLC units via Ethernet (bridged...
Replies
1
Views
1,649
Hello Guys, I spent some time searching the web to learn how to generate the report (to be printed out or to be saved as pdf file) which would...
Replies
0
Views
1,220
Hi all, I have created a report using a report writer in Indusoft scada, but i just wanna know can i import the Bargraph symbol which is...
Replies
0
Views
1,214
Back
Top Bottom