Dear Expert
In my Project, I used SQL Server to store data from Factory studio. The machine installed Factory studio and machine installed SQL Server is different. The dataset in Factory studio " TagHistorian
I could connect Factory to SQL Server and store data well.
How can I monitoring the connection status between Factory studio and SQL server in order to show this status on HMI application ?.
How can I get the remain capacity of SQL server into Factory studio. because when SQL server is full nearly, I need Factory studio alarm to operator about this case.
Best.
You can use the following code to see tha last statusMessage your DB returned, if it is working fine it will show “OK”: @Tag.text = @Dataset.DB.Provider1.OpenStatusMessage;
It will be the same message which appears in Module Information:
Insert the following code in the Script to execute the query:
After that, you will be able to manipulate the Tag created in the first step, which contains a text with the value of remaining capacity in the SQL server.
Note: The line command from number 3 should not be called in CodeBehind, the reason for that is, if the Query fails in CodeBehind it can cause performance issues because CodeBehind is just one thread, so you should call a Task doing a trigger in CodeBehind and this Task execute the Query… The task is another thread.