Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 14

Thread: Sql Driver Problem

  1. #1
    Join Date
    09.10.2011
    Posts
    9

    Default Sql Driver Problem

    Hello,

    I have a problem with Sql Driver and redundant servers. when only main server is active, sql driver works normally but when standby server is turned up, the variables from sql driver turn into invalid values.

    in the driver settings, i tried both redundancy mode active or not. But problem is not solved.

    Can you help?

    Regards,
    Cavdar
    Attached Thumbnails Attached Thumbnails 1.png   2.png  

  2. #2

    Default Re: Sql Driver Problem

    Hi cavdar,

    When the variables are really INVALID on the server, when the standby server is also running, then in this scenario there must be some connection issue from the SQL driver on the server to the SQL database where the driver configuration is pointing to.

    Only when there is a connection issue to the database, the variables of the SQL driver are shown INVALID. When there are no variables available in the database table, the variables remain empty without status in the runtime.

    Could you check the logfiles of the diagnosis server using the zenon diagnosis viewer, to see what error message is logged by the SQL driver when the variables become invalid?

    Best regards,
    Mark

  3. #3
    Join Date
    09.10.2011
    Posts
    9

    Default Re: Sql Driver Problem

    Hi Mark,

    I checked the logfiles and saw that there are many variables in the table which are not defined in Zenon. and there isn't any other error message about connection..

    i think now that this is not an issue about servers, I will work on the database table to make it more suitable.

    Thank you,
    Best regards,

  4. #4

    Default Re: Sql Driver Problem

    Hi cavdar,

    I can confirm that the SQL driver reads all rows in the table configured for receive.
    Without redundancy, the table is cleared after a successfull read.

    Let us know, when you found out what was causing this

    Regards,
    Mark

  5. #5
    Join Date
    09.10.2011
    Posts
    9

    Default Re: Sql Driver Problem

    Hi Mark,

    I reorganized the database table, and now the "invalid value problem" is solved. but I have new problems. (i must say these problems maybe are not new but i realized them recently) First, sql driver can not read all rows successfully. although all rows are being deleted after a read, some variable's values don't update. This problem occurs on different variables each time, so i don't know where i am wrong.

    Secondly, I couldn't manage the redundancy. When redundancy active, the table is successfully read (all rows deleted) but none of the variable's values update. I wonder if for the standby server, a new configuration is required. because i saw in the driver configuration WSID parameter: Server1.

    I used the diagnosis viewer but there is no error on sqldriver.

    Thanks in advance.
    Regards,

  6. #6

    Default Re: Sql Driver Problem

    Hi Cavdar,

    Sometimes it is not easy to recognize in the runtime that value changes are in fact taken over correctly. Where in the runtime exactly do you think you see that sometimes a value is not updated correctly?

    One thing which you could check is if all table column values for each row actually make up a valid value entry. (variable name, value, date, status) When you look at the event list or alarm list with a time filter and expect to see an entry, it could be that the entry is not shown when the date / time value from the sql table is outside of the time filter specified for the list.

    The same is true for a spontaneous historian, where a value may not be entered into a running archive if the timestamp of the variable does not fit the time for this running archive. Also here the same applies in regard to the time filter. The value may be stored, but is not visible within the current time filter parameter.

    Another thing that may have happened is that there were multiple values in the sql table for the same variable, and you only see the last processed value in the runtime.

    When you use the diagnosis viewer, try activating all logging levels for the zenrt32.exe process, for all modules, and do the same for the SQL driver. This way you should get an entry for each value that is sent to the runtime, by the SQL driver.

    -> Settings, Client parameters, > select the appropriate logging client, list of parameters, All, message level for all modules, OK, close

    Regards,
    Mark

  7. #7
    Join Date
    09.10.2011
    Posts
    9

    Default Re: Sql Driver Problem

    Hi Mark,

    I created numerical value elements for sql variables and I inserted rows into the table by hand to test it. Here i saw although i insert the same things to the columns each time, sometimes the value in the numerical value element doesn't change. ( but rows in table are deleted).
    The variables aren't used in historian, but used in VBA and their "DDE active" option is active. I don't know its effect.

    and I use diag-viewer with advanced settings. there are 3 different "deepdebug" level messages with the variables which i use in VBA for testing.
    -Message1's function name: CKanalobj::SrvObjUnadvise
    -Message2's function name: CSrvObj::SrvObjAdvise
    -Message3's function name: CTreiberObj::SrvObjBaueDatenliste

    Other messages CKanalObj::SendDateninBuffer.

    I couldn't understand these messages.

    Regards,

  8. #8

    Default Re: Sql Driver Problem

    Hi mcavdar,

    The messages in deepdebug actually are, as the name implies, for advanced troubleshooting only. Basically for each value update sent to the runtime, you should see a SendDatenInBuffer entry, with the value, timestamp and status.

    It might be a good idea to contact your local COPA-DATA support for further assistance. I'm not aware of any issues with the SQL driver, that would cause this behaviour. I still think that this may be a misunderstanding.

    DDE active is a feature that allows readning the variable value in a DDE client application on the same PC, e.g. MS Excel. DDE active also causes the variable to be always requested from the hardware, in this case the SQL server, instead of on demand.

    DDE active is frequently set to avoid issues in VBA when accessing the .value property of a variable without properly making sure that the variable actually has a valid value.

    With the SQL driver, you need to take special care in VBA when you access the variable value or status. Generally you should only access the value or status, when "IsOnline" returns TRUE. With the SQL driver, even when setting DDE active, this is not guaranteed.

    When no value has been received yet, the value remains empty without value and status.

    If you're not 100% sure of what you are doing in VBA, try and disable VBA first to see if that solves your problem.


    Best regards,
    Mark

  9. #9

    Default Re: Sql Driver Problem

    Hi mcavdar,

    Another thought that crossed my mind, what may be causing what you are seeing.

    You mentioned that you tried with the redundancy option, but had some issues.

    If this option is not active, when either the server OR the standby server reads successfully, the table is cleared. The values that you see in the runtime in the screen, are coming from the active server (no matter if you look on the standby server, the server, or on a client)

    So if in your case, you don't have the option for redundancy active, but you do have a standby server running, the standby server could be reading, and clearing the table, but you would not see this value in the runtime.

    So if possible, for test purposes, check with only the server running to see if all values are shown in the runtime.

    Note, that when you activate the redundancy option, your SQL table for receiving values must be configured accordingly, with the additional column. -> please check the driver documentation to make sure this is configured OK.

    With the redundancy option active, the table entries are only removed, when both the server and the standby server have read the value.

    Best regards,
    Mark

  10. #10
    Join Date
    09.10.2011
    Posts
    9

    Default Re: Sql Driver Problem

    Hi Mark,

    You are right, I checked with only server running and there isn't a problem.

    Then I activated redundancy option, there were already ACK_SRV, ACK_SB and Insertzeit columns in the table. But when redundancy is activated, none of the values is updating. I tested it with only server running and standby running too.

    I read driver documentation but i couldn't find any mistake I've done.
    Have you any idea or any project backup Sqldriver with redundancy?

    Thank you,
    Best regards,

Similar Threads

  1. SQL problem with zenOn 6.21 - huge project-log file
    By herberto in forum zenon Supervisor
    Replies: 17
    Last Post: 12th November 2014, 13:22
  2. Problem with 61850 driver
    By shahrzad in forum zenon Energy Edition
    Replies: 1
    Last Post: 31st August 2009, 02:34
  3. Driver problem
    By flajoso in forum Editor and Runtime Setup
    Replies: 5
    Last Post: 14th July 2008, 07:08
  4. SQL variables allocation problem
    By rloureiro in forum Drivers
    Replies: 4
    Last Post: 13th March 2008, 13:32
  5. Replies: 0
    Last Post: 21st August 2007, 08:43

Posting Rules

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