connect to microsoft SQL

Forum Home Forums Communicating with Devices connect to microsoft SQL

Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #5191
    camtutrinhha
    Participant

    Hi,
    I try to connect to Microsoft SQL, then I success.
    But database in ScadaCommunicator only display one row while database in Sql has multiple row.
    I desire read multiple row.
    Could you tell me how to resolve it?
    Thanks,

    #5196
    Mikhail
    Moderator

    Hi,
    Please provide the screenshots.

    #5209
    camtutrinhha
    Participant

    Thanks,
    I resolved it.
    Now, i’m having a problem.
    I have data like below image
    https://drive.google.com/open?id=1bYp5CqtpbDAZR9oOSzCkWxpwlC8eMmxf
    curently I read only data in multiple days serial but it run follow real time of my computer ,
    https://drive.google.com/open?id=1jyXuNpgXJNqgb5HbJZHRfJ77BsEEkw7u
    I desire that i can read data in multiple days and create multiple file extensive .dat in a day. To have data quickly.
    Could you tell me how to resolve it?
    Thank you!

    • This reply was modified 5 years, 1 month ago by Mikhail.
    #5212
    Mikhail
    Moderator

    I’m not sure that I understand what you need.

    #5239
    camtutrinhha
    Participant

    I’m sorry.
    I have a file data in Microsoft SQL Server
    https://drive.google.com/open?id=1bYp5CqtpbDAZR9oOSzCkWxpwlC8eMmxf
    in Scada Server, I have a file .dat
    https://drive.google.com/open?id=1U3kXKCm8x28is1WjILFYkwhNMHKnQlF8
    But, Date_Time in Microsoft SQL unlike Date_Time in Scada Server.
    Therefore, I want to read Date_Time in Microsoft SQL and write it in ScadaServer.
    Example,
    https://drive.google.com/open?id=15GCw51hQStNQ-WkGFt0iEe5QM53i9kyD
    Notice Time, please.
    Could you tell me how to resolve it?
    Thanks

    • This reply was modified 5 years, 1 month ago by Mikhail.
    #5246
    Mikhail
    Moderator

    KpDbImport.dll reads and inserts to Rapid SCADA current data.

    If you have the source data in SQL Server on time, you will get correct data in Rapid SCADA. In this case you should select the latest row in your SQL statement.

    If the source data are loaded with a delay, you need to develop another driver that takes a timestamp into account.

    #5293
    aluy069
    Participant

    I’m using ModDBExport.dll to export data to SQL2017

    I would like to insert the KpNum value who generate the val to the CnlData table

    I’m using the regular script:
    INSERT INTO CnlData (DateTime, CnlNum, Val, Stat)
    VALUES (@dateTime, @cnlNum, @val, @stat)

    could you tell me how to modification it?

    #5295
    aluy069
    Participant

    Is there possible to set the time the ModDBExport.dll insert the data to SQL2017?,

    for example i would like to set the insert to a 5 seconds

    #5299
    Mikhail
    Moderator

    could you tell me how to modification it?

    You need to create and fill the input channel and the device tables in your SQL database. Then you can find a device by channel number.

    Is there possible to set the time the ModDBExport.dll insert the data to SQL2017?

    If you set the period of polling in Communicator, it affects the period of transferring data in SQL2017.

    #5305
    aluy069
    Participant

    i got the idea and is ok, but i need to insert KpNum value in CnlData from ModDBExport. I don’t like to create another table in the SQL2017

    #5312
    Mikhail
    Moderator

    You should do it by a trigger. Anyway, you need the Device table in SQL2017 to fill the KpNum column.
    Otherwise, we need to update ModDBExport.dll

    • This reply was modified 5 years ago by Mikhail.
    #5324
    aluy069
    Participant

    I include in Exporter.cs file in the private void ExportSrez the line:
    “DataSource.SetCmdParam(cmd, “kpNum”, cnlData.KPNum);”

    but i suppose i need to define KPNum in SrezTableLight.CnlData at: public struct CnlData, something like: Public KPNum(double val);

    but the i don’t know why i can’t modify SrezTableLight.

    Can you guide me if i’m right

    #5327
    Mikhail
    Moderator

    I can answer particular questions about the code. If you ask more specific, I’ll try to explain.

    but i suppose i need to define KPNum in SrezTableLight.CnlData at: public struct CnlData, something like: Public KPNum(double val);

    I don’t recommend changing the essential classes.

    #13188
    Pieter
    Participant

    How did you get to show multiple rows in communicator. Mine is also just showing one row and my sql has multiple.

    #13194
    Mikhail
    Moderator

    Please provide screenshots.

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