AdvancedHMI Software

General Category => Support Questions => Topic started by: oqapsking on April 22, 2017, 03:20:49 PM

Title: disable disable comms Subscriptions
Post by: oqapsking on April 22, 2017, 03:20:49 PM
hello

i disabled the  comms Subscriptions
but i want to show it as error  massages text on one label that i chose instead of showing up on every thing i use

and can i chose what is the text?

with thanks
Title: Re: disable disable comms Subscriptions
Post by: Archie on April 22, 2017, 03:24:20 PM
You will have to add it to the code where you disable subscriptions. For example:

ModbusTCPCom1.DisableSubscriptions=True
Label1.Text="Subscriptions Disabled"
Title: Re: disable disable comms Subscriptions
Post by: oqapsking on April 22, 2017, 03:46:08 PM
i had disabled it from the property !
Title: Re: disable disable comms Subscriptions
Post by: Archie on April 22, 2017, 03:50:59 PM
Then do it in your form load event:
Code: [Select]
    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If ModbusTCPCom1.DisableSubscriptions Then
            Label1.Text = "Subscriptions Disabled"
        End If
    End Sub
Title: Re: disable disable comms Subscriptions
Post by: oqapsking on April 22, 2017, 04:33:05 PM
oh i mean

the error massage

for example

can not connect to the address 192.168.0.5
Title: Re: disable disable comms Subscriptions
Post by: Archie on April 22, 2017, 04:52:19 PM
Is the property of each control SupressErrorDisplay what you are looking for?
Title: Re: disable disable comms Subscriptions
Post by: oqapsking on April 22, 2017, 06:05:29 PM
for example
i have basic label ,basic button and AnalogValueDisplay

if there is a connection error say there is no internet

the value in the label and AnalogValueDisplay shows an error massage

i need to stop that
and show the error on its own label

Title: Re: disable disable comms Subscriptions
Post by: Archie on April 22, 2017, 06:07:36 PM
Set SupressErrorDisplay to True on all the controls.

Add a BasicLabel and set PLCAddressValue to any random address. Make sure SuppressErrorDisplay is set to False.
Title: Re: disable disable comms Subscriptions
Post by: oqapsking on April 22, 2017, 06:41:10 PM
it says no value returned

and i want the connection error message
Title: Re: disable disable comms Subscriptions
Post by: Godra on April 22, 2017, 08:13:01 PM
Archie already suggested that you can use the form's Load event to display the error on a standard Label:

Then do it in your form load event:
Code: [Select]
    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If ModbusTCPCom1.DisableSubscriptions Then
            Label1.Text = "Subscriptions Disabled"
        End If
    End Sub

Instead of putting "Subscriptions Disabled" you can just put your text (and also Set SupressErrorDisplay to True on all AHMI controls).

If you add a timer to the form then you can continuously check the DisableSubscriptions property to see when it changes to False so you can remove the message and if necessary disable this timer (you could also use this timer to initially set the message instead of using the form's Load event).