Author Topic: Assigning control's property value to the same controls another property  (Read 2013 times)

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Hi,

I created a custom control. It has a property that is not controlled by the value got from PLC. It can be done within project but this causes to do this every usage of control. I want to do this within the code of control. Let me clear;

Control has a property named StartToGet. It has 5 values.
Control has a property named PLCAddressValue. It gets a number from PLC.

I want to assign value of PLCAddressValue got from PLC to value of StartToGet property within the code of control.

How can do this?

Thanks for any help.
One step at a time baby, One step at a time.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Assigning control's property value to the same controls another property
« Reply #1 on: November 26, 2020, 08:19:30 PM »
If you created your control following the model of the existing controls, you can change your property name to PLCAddressStartToGet and the rest happens automatically.

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Assigning control's property value to the same controls another property
« Reply #2 on: November 26, 2020, 10:06:23 PM »
Hi,

I did not create original control. I have a DLL file and original control is in it. I deployed it only. I can't change original
property name. I am trying to assign a value got from PLC to original property. I can get and set original property value within program code but not in control's code.

If i use property variable original property value gets address. I use Modbus. Let me clear;

PLCAddressValue (address 40018) and StartToGet property meant to get same value from PLC. If i assign PLCAddressValue to StartToGet variable StartToGet has a value of 40018 not the value got from address 40018 of PLC.
« Last Edit: November 26, 2020, 10:09:50 PM by Alpaslan »
One step at a time baby, One step at a time.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Assigning control's property value to the same controls another property
« Reply #3 on: November 26, 2020, 10:16:03 PM »
Where did the DLL come from? Can you get the source code? If not, use a de-compiler to convert it back to VB, then modify it.

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Assigning control's property value to the same controls another property
« Reply #4 on: November 26, 2020, 10:19:10 PM »
I found it from internet. I can't get source code. Decompiling doesn't worth to what i get.

Isn't there a way to use value got from PLC in control's code?
One step at a time baby, One step at a time.

MajorFault

  • Guest
Re: Assigning control's property value to the same controls another property
« Reply #5 on: November 26, 2020, 10:26:37 PM »
Maybe share the link on this DLL?

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Assigning control's property value to the same controls another property
« Reply #6 on: November 26, 2020, 11:33:52 PM »
Hi,

Solution is here:
https://www.advancedhmi.com/forum/index.php?topic=1338.msg7106#msg7106

And here:
If you created your control following the model of the existing controls, you can change your property name to PLCAddressStartToGet and the rest happens automatically.

I am not a good reader.

Thanks Archie.
One step at a time baby, One step at a time.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Assigning control's property value to the same controls another property
« Reply #7 on: November 27, 2020, 07:11:34 AM »
I found it from internet. I can't get source code. Decompiling doesn't worth to what i get.

Isn't there a way to use value got from PLC in control's code?
You found a control in a DLL from the internet that has a property PLCAddressValue?

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 214
    • View Profile
Re: Assigning control's property value to the same controls another property
« Reply #8 on: November 30, 2020, 05:49:35 PM »
I found it from internet. I can't get source code. Decompiling doesn't worth to what i get.

Isn't there a way to use value got from PLC in control's code?
You found a control in a DLL from the internet that has a property PLCAddressValue?

Uh-oh, this has the potential to get a little awkward...