Hello Guest it is March 28, 2024, 11:18:21 AM

Author Topic: Getting the value of a text box  (Read 2366 times)

0 Members and 1 Guest are viewing this topic.

Getting the value of a text box
« on: May 19, 2016, 04:19:15 PM »
I have a text box named 'Test1' with a description of 'Test Box 1'.  This is what I'm doing, but I get nothing even though I can see a value in the text box.

val = scr.GetProperty('Test1','Value')
wx.wxMessageBox(val)

It doesn't error, just returns a blank in the message box. What could be going wrong?   Thanks

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Getting the value of a text box
« Reply #1 on: May 19, 2016, 05:05:42 PM »
Ive just recreated what you have and all works fine my end??

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Getting the value of a text box
« Reply #2 on: May 19, 2016, 06:44:28 PM »
Could it be a scope issue?  I have a value of 50 in the text box, yet nothing shows in message box.  I'm just firing this code with a button on the screen.  Spelling is correct.  I even copied and pasted the text box name into the script to be sure.
Re: Getting the value of a text box
« Reply #3 on: May 19, 2016, 11:01:53 PM »
Still can't get a value out of a text box, but I can read the value from the register.  This exercise was to read the text box value and write it to a file on close, then read it back from the file and populate the DRO text boxes.  Works just as well reading the values from the registers.
Re: Getting the value of a text box
« Reply #4 on: May 24, 2016, 02:31:19 PM »
Turns out I was trying to get the value of a text box, which doesn't have a value property.  Switched to a DRO which does have a value property and added them to the Persistent DRO section of the PLC script.  It's all working great now.