Forum Home › Forums › Communicating with Devices › connect to microsoft SQL
Tagged: ModDBExport
- This topic has 14 replies, 4 voices, and was last updated 8 months, 3 weeks ago by Mikhail.
-
AuthorPosts
-
March 25, 2019 at 8:10 am #5191camtutrinhhaParticipant
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,March 25, 2019 at 2:47 pm #5196MikhailModeratorHi,
Please provide the screenshots.March 26, 2019 at 6:36 am #5209camtutrinhhaParticipantThanks,
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.
March 26, 2019 at 2:31 pm #5212MikhailModeratorI’m not sure that I understand what you need.
March 28, 2019 at 7:52 am #5239camtutrinhhaParticipantI’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.
March 28, 2019 at 2:50 pm #5246MikhailModeratorKpDbImport.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.
April 17, 2019 at 2:52 am #5293aluy069ParticipantI’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?
April 17, 2019 at 5:27 am #5295aluy069ParticipantIs 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
April 17, 2019 at 3:07 pm #5299MikhailModeratorcould 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.
April 17, 2019 at 3:57 pm #5305aluy069Participanti 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
April 18, 2019 at 2:02 pm #5312MikhailModeratorYou 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.
April 19, 2019 at 3:06 am #5324aluy069ParticipantI 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
April 19, 2019 at 11:14 am #5327MikhailModeratorI 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.
August 4, 2023 at 6:22 pm #13188PieterParticipantHow did you get to show multiple rows in communicator. Mine is also just showing one row and my sql has multiple.
August 7, 2023 at 9:11 am #13194MikhailModeratorPlease provide screenshots.
-
AuthorPosts
- You must be logged in to reply to this topic.