Author Topic: change error message on loss of comms  (Read 1381 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
change error message on loss of comms
« on: November 18, 2015, 07:39:28 PM »
Archie, I would like to change the error message returned when there are no comms established with the Modbus TCP driver.  I would like to see ??? instead of "Could not connect to IP x.x.x.x".  The reason for this is because I am using textboxes that are only 4 characters long and would rather see the question marks than "Coul".  I would also like to do this when comms are lost.  That way I can make the Highlight character ? and show red text... I think.  I'm not able to see the errors in the code, is this possible and where can I find them?  Creating a property in the driver for Error Message Text would be great!  Thanks.   

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: change error message on loss of comms
« Reply #1 on: November 18, 2015, 07:49:40 PM »
Your easiest option is probably to edit BasicLabel.vb and go to line 570 :

                    MyBase.Text = ErrorMessage


Then change ErrorMessage to whatever you want to display, such as

                    MyBase.Text = "???"


Keep in mind that no matter what the error is, you will override it to always be the same.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: change error message on loss of comms
« Reply #2 on: November 18, 2015, 10:47:22 PM »
That's great, works for now.  Is it possible to create a property that allows you to set this for each Basiclabel?  Thanks