Author Topic: Setting the value property to the control through variable  (Read 1453 times)

syamsp12

  • Newbie
  • *
  • Posts: 4
    • View Profile
Setting the value property to the control through variable
« on: January 12, 2017, 03:03:35 AM »
Hi,

I need to set value of the controls (Eg Gauge, tank etc.,) through the program/variable ( Not from the PLC)
is there any options to do so?

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting the value property to the control through variable
« Reply #1 on: January 12, 2017, 07:30:10 AM »
Be sure not to put a value in PLCAddressValue property because the PLC value will then override what you put in Value. Then in your code

Gauge1.Value=99

or

Dim MyVariable as integer
MyVariable=123
Gauge1.Value=MyVariable

syamsp12

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting the value property to the control through variable
« Reply #2 on: January 12, 2017, 03:34:17 PM »
Thanks for the reply.

I am using c#, but i can not find method  .value for the guage.
While typing intelisense showing error. Pls help.
Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting the value property to the control through variable
« Reply #3 on: January 12, 2017, 03:49:59 PM »
See the attached screen shot

syamsp12

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting the value property to the control through variable
« Reply #4 on: January 12, 2017, 04:36:07 PM »
Thanks a lot  Archie,

i got my mistake.

i  browsed the control from right clicking  Toolbox 'choose  item..'  AdvancedHMIControls\bin\Debug\AdvancedHMIControls.dll and from there i added the control to the form.
Now i tried with adding new c#projects to the same solutions and it works.

 i don't know why doesn't work with that way(i can place the control to the form and can access the properties for the control through designer and most of the functions related to the control is available except the .value )... please let me know why is not supporting in that way (Just for the Know how)

many thanks for your support

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting the value property to the control through variable
« Reply #5 on: January 12, 2017, 04:49:00 PM »
There is already a C# project that is part of the solution that is fully configured. If you look in Solution Explorer, you will see a project named AdvancedHMIcs

syamsp12

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Setting the value property to the control through variable
« Reply #6 on: January 12, 2017, 04:59:49 PM »
Thank you very much