Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPC & VB6

Status
Not open for further replies.

norason

Programmer
Jan 28, 2009
139
US
I'm tasked with creating a customer interface to an existing OPC file created by Kepware. The customer wants to view selected alarm dates, types, and groups. While he is viewing his selections, the report should be real time - meaning it should up-date automatically while he is viewing the report. In addition, he should be able to export the report to Excel so he can archive the data. Is VB6 a good match for this?

Thanks,

Gary
 
having no idea what kepware is or the format of an OPC file, I searched on Kepware and found this page...


where on the left, the second one down is what seems to be an addin to have your device/app load its records into various differnt type of databases and I quote...

"With Kepware's DataLogger plug-in for KEPServerEX you can seamlessly log any OPC item/tag from KEPServerEX to your favorite ODBC compliant database like Access, SQL, and MySQL."

Of which, if you want to read records from a database then I would say that VB is ideal for such a task.

As for REAL TIME... Well lets say that VB is not the best for real time and on MS platforms there are very few apps that can say they are REAL Time. There are however many apps on MS systems including VB apps that are NEAR real time and for what you want, refreshing a recordset or using MSMQ should do the trick for you.

As for exporting to excel...VB makes it easy to automate office products. Search the web and you will find many sites with even more examples on how to accomplish such a task.


Good Luck
 
I have Kepware configured to export the data into an ACCESS.mdb file, and that appears to be working properly. But when I try to open the file in VB, it errors "Unrecognized Database Format".

Are there different .mdb formats and if so, how do I
differentiate?

I copied this from Visual Basic 6.0 Professional Step by Step book:

Private Sub datStudent_Validate(Action As Integer, Save As Integer)

End Sub

and it points to the correct .mdb file.




Thanks,

Gary
 

Ah... that looks more like vb.net code and if so you need to be in forum796.

Now to answer your question about .mdb formats. Yes, between office 97 and 2k the mdb file changed. 97's max size was 1Gb while 2k's is 2Gb (and if I remember correctly, there is even another format before 97 but not sure?? might be thinking about something to do with sql server). As for 2k7 they have introduced another file format with the extension of .accdb.

How to solve this problem...

you can either use an earlier driver for accessing the mdb or you can convert the mdb to a newer version through the access application interface. HOWEVER, if you do convert the database to a newer version you may break the link between the mdb and Kepware.

On the other hand if Kepware is using an odbc driver to access the mdb...you might,... might be able to switch to a newer ODBC driver to accomadate the newer file format... but I doubt it.

Best bet is to use and earlier driver for you vb program.


Good Luck

 

Uh...Ah... let me correct something...

>>On the other hand if Kepware is using an odbc driver to access the mdb...you might,... might be able to switch to a newer ODBC driver to accomadate the newer file format... but I doubt it.

>>"With Kepware's DataLogger plug-in for KEPServerEX you can seamlessly log any OPC item/tag from KEPServerEX to your favorite ODBC compliant database like Access, SQL, and MySQL."

So perhaps you can convert the db to a newer version and them you may need to use a newer ODBC driver...

(I really need to remember what I have written before...)

Good Luck

 
Thanks! I read further in the reference book and it told me of ADO, I tried it and viola! it worked. I now am able to input the .mdb data into VB6.

The 2Gb limit bothers me, though. I don't know what Kepware does when it gets to that limit...

Thanks,

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top