AdvancedHMI Software
General Category => Open Discussion => Topic started by: Lixoudis on September 23, 2017, 03:41:36 AM
-
Hello guys am fairly new on advanced HMI. First i will like to thank Archie for a well made program.
The issue am facing is that i built an hmi for remote viewing of a machine.Now i have a situation that i want to have a basic indicator with on(text shown indicator),green color status and off(text shown indicator),red color status. I have tried and use a DataSubscriber1 that is connected with the appropriate tag and then used the below code to have the affect i want but it didn't work.Any thoughts on this problem.
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
If e.PlcAddress = True Then
BasicIndicatorRefrigCompressor.Color1 = Color.Green
BasicIndicatorRefrigCompressor.Text = "ON"
Else
BasicIndicatorRefrigCompressor.Color1 = Color.Red
BasicIndicatorRefrigCompressor.Text = "OFF"
End If
End Sub
-
Try it this way:
If e.Values(0) = "True" Then
-
Thanks you very much Archie
-
Another question,I want for this project a DataSubscriber2 to run continuously even if the form is closed or hide.This subscriber will pull data and then a private sub will save these data to an sql database every minute?
Thanks
-
If you right click the MainForm and select View Code, you will see a block of code with a comment saying that it is used to pause the updates when the form is hidden. If you comment out that code, it will continue to update even when the form is hidden. If the form is closed, then you have no way for a Datasubscriber to continue to work because you have shut it down completely by closing the form.