Author Topic: disable disable comms Subscriptions  (Read 1866 times)

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
disable disable comms Subscriptions
« 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

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: disable disable comms Subscriptions
« Reply #1 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"

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: disable disable comms Subscriptions
« Reply #2 on: April 22, 2017, 03:46:08 PM »
i had disabled it from the property !

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: disable disable comms Subscriptions
« Reply #3 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

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: disable disable comms Subscriptions
« Reply #4 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

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: disable disable comms Subscriptions
« Reply #5 on: April 22, 2017, 04:52:19 PM »
Is the property of each control SupressErrorDisplay what you are looking for?

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: disable disable comms Subscriptions
« Reply #6 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


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: disable disable comms Subscriptions
« Reply #7 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.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: disable disable comms Subscriptions
« Reply #8 on: April 22, 2017, 06:41:10 PM »
it says no value returned

and i want the connection error message

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: disable disable comms Subscriptions
« Reply #9 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).
« Last Edit: April 22, 2017, 08:51:47 PM by Godra »