Showing results 1 to 10 of 12

Thread: Database Access

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    whitetaru Gast

    Default Database Access

    Hi,

    I know that Zenon is able to provide Database access through SQL driver.

    1) Do we need VBA programming to manipulate the database?

    2) I have a mysql database and would like to integrate with Zenon. Can i still access the database through Zenon SQL driver?

  2. #2

    Default Re: Database Access

    What manipulations to the database exactly do you mean?

    The SQL driver uses the SQL database like a PLC. It can write values to the database, which another application can process. Also it can read values from the database, placed here by another application, to process in the zenon runtime (e.g. write lab-values to the PLC)

    The SQL driver has been successfully tested with Microsoft SQL Server and Oracle.

    There have been issues in the past with MySQL, as the SQL driver uses Dynasets, which were not supported with the MySQL ODBC driver versions 3.5 and 5.1. I'm currently not sure if there is a solution for this issue.

  3. #3
    whitetaru Gast

    Default Re: Database Access

    Quote Originally Posted by markclemens View Post
    What manipulations to the database exactly do you mean?

    The SQL driver uses the SQL database like a PLC. It can write values to the database, which another application can process. Also it can read values from the database, placed here by another application, to process in the zenon runtime (e.g. write lab-values to the PLC)

    The SQL driver has been successfully tested with Microsoft SQL Server and Oracle.

    There have been issues in the past with MySQL, as the SQL driver uses Dynasets, which were not supported with the MySQL ODBC driver versions 3.5 and 5.1. I'm currently not sure if there is a solution for this issue.
    I see. Thanks for the great information.

  4. #4
    whitetaru Gast

    Default Re: Database Access

    Quote Originally Posted by markclemens View Post
    What manipulations to the database exactly do you mean?

    The SQL driver uses the SQL database like a PLC. It can write values to the database, which another application can process. Also it can read values from the database, placed here by another application, to process in the zenon runtime (e.g. write lab-values to the PLC)

    The SQL driver has been successfully tested with Microsoft SQL Server and Oracle.

    There have been issues in the past with MySQL, as the SQL driver uses Dynasets, which were not supported with the MySQL ODBC driver versions 3.5 and 5.1. I'm currently not sure if there is a solution for this issue.
    Hi,

    For this Database thing, I 've managed to code them using VBA and am successfully read and write values to the database. But this whole thing was done through using VBA.

    You mentioned that we can actually create variable(s) in Zenon and write/read to/from SQL server database. There are
    (i) Driver Variable
    (ii) PLC maker

    which one should we choose?


    I am currently exploring using the SQL driver but when i reach (see attached print screen). I can't understand the language used in the box ( column names )

    Click image for larger version

Name:	p1.JPG
Views:	157
Size:	25.0 KB
ID:	580

    I looked at the SQLDrv.pdf and even gone to the help in the Zenon software, the print screens were non-English language too. I need some help in understanding them.

    Basically, eg, what i need is how am i going to

    1) display my database value in Numerical Value Box

    Lets say, I have a Database Table with a column "myAge",
    I created a SQLDrv Variable as in the Print Screen attached - "myAge"
    I imported the SQLDrv Variable to Variable as shown in another print screen.

    Click image for larger version

Name:	p2.JPG
Views:	117
Size:	134.4 KB
ID:	581

  5. #5

    Default Re: Database Access

    Hi,

    "PLC marker" is what you need. "Driver variable" are special variables that provide information about the driver itself and the communication of the driver.

    The SQL driver uses columns with names that are predefined. The only thing that can be configured in the driver, are the tables in the database.

    The SQL driver documentation provides two SQL scripts to create the tables with the correct columns.

    To see how this works, try and setting up the tables as required, and then in zenon write a value to a SQL driver value.

    The database should be updated with the value. You can now copy this row, and insert this in the other table where zenon is reading the values.

  6. #6
    whitetaru Gast

    Default Re: Database Access

    Quote Originally Posted by markclemens View Post
    Hi,

    "PLC marker" is what you need. "Driver variable" are special variables that provide information about the driver itself and the communication of the driver.

    The SQL driver uses columns with names that are predefined. The only thing that can be configured in the driver, are the tables in the database.

    The SQL driver documentation provides two SQL scripts to create the tables with the correct columns.

    To see how this works, try and setting up the tables as required, and then in zenon write a value to a SQL driver value.

    The database should be updated with the value. You can now copy this row, and insert this in the other table where zenon is reading the values.
    Hi markclemens,

    Is it possible to create a very simple example in .wsb based on the SQL driver documentation ? I cant seem to write values to the DB.

  7. #7

    Default Re: Database Access

    take a look at the attached project backup.

    Simply restore this backup into your workspace in a zenon 6.51 SP0 editor, and before you start the runtime, check the table "ZENON_RECEIVE". This contains two entries for the two variables in the start screen.

    When the runtime is started, the driver reads from the database (table ZENON_RECEIVE), and deletes these entries after a successfull read.

    When writing variables in the zenon runtime, the values are stored in the "ZENON_SEND" table, and remain here until they are manually deleted (e.g. by the third party application after reading successfully)

    2011-05-12_11-19-07 sql_drv.zip

Similar Threads

  1. Database cannot be opened! Error
    By jhines in forum zenon Supervisor
    Replies: 5
    Last Post: 22nd February 2018, 01:14
  2. Open database error
    By jan1024 in forum zenon Supervisor
    Replies: 13
    Last Post: 30th November 2009, 16:11
  3. SQL Database and Zenon Editor
    By bmcbrita in forum zenon Supervisor
    Replies: 4
    Last Post: 2nd August 2009, 22:24
  4. SQL Database files
    By bmcbrita in forum zenon Supervisor
    Replies: 7
    Last Post: 17th June 2009, 14:26
  5. Backup database
    By matholton in forum zenon Supervisor
    Replies: 1
    Last Post: 17th October 2008, 13:49

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •