Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: DerWeisse on August 06, 2018, 06:46:47 AM

Title: Getting text input to show in control in screen (VB people will echo)
Post by: DerWeisse on August 06, 2018, 06:46:47 AM
As seasoned VB programmer I was HOPING I can find suitable controls on user screen, but found just few, or I can't find other.
I have text strings coming over RS-232 comm with MACH using VB macro, and I wish to see them on the screen, like in VB textbox, label, and other textual controls.
I can't find "user controls", such as LABEL with ref num, so I can direct text from the macro to that label (or text box).
LABEL seems to ask for explicit text and has no ref number, same for DRO (fixed ref to some functions), couldn't find other text-looking controls.
To make it clear:
If i get text string like "ABC" into string variable in VB like ST, I wish to direct it to my control. LIke in VB I can send it to my textbox like text1.text=ST

It doesn't exists or I just didn't find it?
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: TPS on August 06, 2018, 11:28:58 AM
you have to use in Screen a Label with description Userlabel10 (just an example).


in VBScript you have to set userlabel like:

myString="hello world"

SetUserLabel(10, myString)
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: DerWeisse on August 06, 2018, 01:32:54 PM
"with description Userlabel10"... Description WHERE???
The only options for label are:
- Global (Y/N)
- Label (expects explicit text)
- Locked for mouse (Y/N)

I don't see how to assign any variable to the label.
Your suggestion is exactly what I was looking for.

Thanks.
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: TPS on August 09, 2018, 12:43:38 PM
text = userlabelXX
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: DerWeisse on August 09, 2018, 02:14:41 PM
Where does the XX go? :-\
I don't see a place for ## on the label,
Thanks.
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: ger21 on August 09, 2018, 03:13:38 PM
The number is part of the name.
See page 20 (3-6) here:
http://www.machsupport.com/wp-content/uploads/2013/02/Mach2_6.11_Custom.pdf
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: DerWeisse on August 10, 2018, 10:48:15 AM
Many thanks. It works.
(Not immediate or intuitive to VB folks, who expect the "name" to be one thing and the text ("caption") another.)
This is my first attempt in modifying Mach. The manual you sent was was unknown to me, not mentioned in Mach site or I missed it.
All is now well, my ATC works great with MACH3. 
Title: Re: Getting text input to show in control in screen (VB people will echo)
Post by: ger21 on August 10, 2018, 11:04:49 AM
It's on the Machsupport site under Mach2 manuals.