Author Topic: Driver Question  (Read 3530 times)

Jesse

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Driver Question
« on: November 14, 2013, 04:53:01 PM »
So I was just writing a test program in VB to get some things working before I wrote the program with all of the advanced HMI extras in the project.

Well, I pretty much finish the program and everything is working but instead of remaking the whole thing in a form with all the Advanced HMI extras, is there a way that I could just Import the driver for a Controllogix Ethernet.

And if so what would those steps be?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Driver Question
« Reply #1 on: November 14, 2013, 05:00:40 PM »
By licensing of the software, you cannot remove parts to use in other software. If you have an application that you want to use with AdvancedHMI, you must import your forms and code into an AdvancedHMI project.

1) Open new AdvancedHMI solution
2) Right click the AdvancedHMI project in Solution Explorer
3) Select Add->Exsiting Items
4) Browse to and select the .vb files of your forms from your other project
5) You will now be able to add AdvancedHMI components to your forms

Jesse

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Driver Question
« Reply #2 on: November 14, 2013, 08:22:33 PM »
Ok so I did that and now...

This was my code for connecting to my access data base and it was working but now that its being used with the advanced hmi stuff i get an error that says
 
"The Microsoft.ACE.OLEDB.12.0 provider is not register on the local machine"

Code: [Select]
        '' Sets value for dbProver, dbSource, And con.connectionstring
        Try
            dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;"
            dbSource = "Data Source = C:\Users\jessedmcneely\Documents\Access Databases\FurnacePrograms.accdb"
            con.ConnectionString = dbProvider & dbSource

            ''Opens connection to database
            con.Open()

            ''Selects all data from database
            sql = " SELECT * FROM FurnacePrograms"

            ''Set Da as new DataAdapter uses variale sql to sends to con
            Da = New OleDb.OleDbDataAdapter(sql, con)

            '' Fills the Dataset with the data from the database via DataAdapter
            Da.Fill(ds, "FurnacePrograms")

            ''Closes DataBase Connection
            con.Close()

            ''Counts rows in the dataset and sets MaxRows equal to the number of rows
            MaxRows = ds.Tables("FurnacePrograms").Rows.Count

            ''Sets inc equal to zero to load first program on startup
            inc = 0

            ''Calls Sub NavigateRecords
            NavigateRecords()

            ''If any of the previous steps could not be accomplished it will throw an error message
        Catch ex As Exception
            MsgBox(ex.Message)

        End Try

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Driver Question
« Reply #3 on: November 14, 2013, 08:33:52 PM »
Check the References Tab under the properties of your original project. See if there is a reference that is not in the AdvancedHMI project.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Driver Question
« Reply #4 on: November 14, 2013, 08:38:23 PM »
It could also be a 32/64 bit thing. Are you on a 64 bit computer? If so, you can try changing the AdvancedHMI to a 64 bit app. It is set to 32 bit for compatibility with the OPC driver, so you will lose the ability to use the OPC driver.

You can check this by Right clicking the AdvancedHMI project and selecting properties. Then going to the compile tab and look for Target CPU. It VS2010 it will be under Advanced Compile Options.

Jesse

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Driver Question
« Reply #5 on: November 14, 2013, 08:51:43 PM »
Got it.

Steps to fix this problem..

Right click on project in solution explorer
click properties
Then compile tab
then advanced compile options
change target CPU from any cpu to x86

and problem solved..