Storing the result of a formula with Database Import Driver

Forum Home Forums Understanding the Software Storing the result of a formula with Database Import Driver

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7630
    David01
    Participant

    Hello,

    I am using a database to store data from Rapid Scada. I want to save the value of an input into a table.

    In order to do this, I have created an output with a formula that references the value I want to save. It has the same command number as that the one I defined in the driver. The problem is that, when I send a command, the value saved is whatever value is written in the command, instead of the result of the formula.

    The SQL code I am using for the command is:

    INSERT INTO data (Counter1) VALUES (@cmdVal);

    So, my question is: How can I write the result of a formula in a MySQL database?

    • This topic was modified 3 years, 4 months ago by Mikhail.
    #7634
    Mikhail
    Moderator

    Hello,

    Do you use Database Import Driver?

    #7635
    Mikhail
    Moderator

    Please provide screenshots that illustrate your settings and system behavior.

    #7642
    David01
    Participant

    Yes. I am using Database Import Driver.

    I managed to make it work on my own. I think I had done something wrong with the configuration. I am sorry for the trouble.

    Now I have another question: Is there a way to store data in a database automatically over time , without a prompt?

    If I understood this correctly, the only way to save data is by sending a command, isn’t it?

    #7652
    David01
    Participant

    Also, is there a way to store multiple data in a single sql table with a single command?

    The documentation references the cmdVal variable, but that only sends the value of the current command. So, what if I need to store several variables?

    For example, table1 has two columns: variable1 and variable2. I can use an SQL query like this:

    INSERT INTO table1(variable1, variable2) VALUES (@cmdVal, null)

    I can only pass the data for variable1, that’s why I am forced to pass a null value to variable2. Do I need to create an aditional command to write variable2 on the table?

    #7660
    Mikhail
    Moderator

    Is there a way to store data in a database automatically over time , without a prompt?

    You should use DB Export Module of SCADA-Server instead of DB Import driver.

    If I understood this correctly, the only way to save data is by sending a command, isn’t it?

    It’s true for DB Import Driver.

    • This reply was modified 3 years, 4 months ago by Mikhail.
    #7662
    David01
    Participant

    Thank you. I will look into it.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.