Jump to content

How to get the displayed value shown in "Button" box?


Recommended Posts

Hi. Greetings to all.

I bump into some problem when using Autoit to retrieve a value displayed in the button box. I am using UVProbe, a measuring software for Shimadzu UV-2600 spectrophotometer. Referring to pic1 and pic2, the circled part is the value that I want to get. Pic1 is when the machine is not connected to the PC and, Pic2 is when it is connected and showing the wavelength and absorbance value.

Below is a sample code that I tried.

#include <GuiToolbar.au3>
Example()

Func Example()
   Local $hwin = WinGetHandle("UVProbe - [Spectrum]")
   Local $text1 = ControlGetText($hwin,"","[CLASS:Button; INSTANCE:21]")

   Local $handle1=ControlGetHandle($hwin,"","[ID:13126]")
   Local $button1=GUICtrlRead($hwin)
   Local $wintext = WinGetTitle($hwin)

   ConsoleWrite($hwin & @LF & $text1 & @LF & $handle1 & @LF & $button1 & @LF & $wintext & @LF)

EndFunc

Here is the window info for the button.

>>>> Window <<<<
Title:  UVProbe - [Spectrum]
Class:  Afx:00400000:8:00010003:00000000:000D048F
Position:   122, 75
Size:   925, 614
Style:  0x14CF8000
ExStyle:    0x00000110
Handle: 0x000303E2

>>>> Control <<<<
Class:  Button
Instance:   21
ClassnameNN:    Button21
Name:   
Advanced (Class):   [CLASS:Button; INSTANCE:21]
ID: 13126
Text:   350.0 nm     1.000 Abs
Position:   6, 429
Size:   115, 18
ControlClick Coords:    61, 9
Style:  0x5A00820B
ExStyle:    0x00000004
Handle: 0x000104F2

>>>> Mouse <<<<
Position:   197, 563
Cursor ID:  0
Color:  0x003A90

>>>> StatusBar <<<<
1:  For Help, press F1
2:  Active Spectrum: None
3:  
4:  

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Spectrum
Graph
Method
Method Parameters
For Help, press F1
Spectrum Toolbar
Main
Instrument Bar
Photometer Buttons
Photometer Status
<<
<
>>
<
>
350.0 nm     1.000 Abs
Output Window
Legend
Legend


>>>> Hidden Text <<<<
Peak Area
Index Tabs
Data Print
Peak Pick
Index Tabs
Point Pick
Index Tabs
Manipulation
Type:
Arithmetic
Calculate...
Data Set:
Operation:
Addition
Constant:
1
Sewing Box
Type:
Shear
Calculate...
Data Set:
Start:
0
End:
0
Region:
Inside
Outside
Interpolate:
Shift Time to Zero
Legend
Graph
Legend
Photometric
Standard Table
Method
Standard Curve
Legend
Sample Table
Standard Error Prediction Table
Sample Graph
Legend
Kinetics
Peak Area
Index Tabs
Data Print
Peak Pick
Index Tabs
Point Pick
Index Tabs
Manipulation
Type:
Arithmetic
Calculate...
Data Set:
Operation:
Addition
Constant:
1
Sewing Box
Type:
Shear
Calculate...
Data Set:
Start:
0
End:
0
Region:
Inside
Outside
Interpolate:
Shift Time to Zero
Kinetics Main Table
Activity Table
Graph
Legend
Graph
Legend
Enzyme Table
Method :
Lineweaver-Burk
Index Tabs
Method :
Lineweaver-Burk
[S] :
1
Apply
Index Tabs
Method :
Lineweaver-Burk
Index Tabs
Event List
Index Tabs
Method
Graph
Legend
Graph
Legend
Graph
Legend
Graph
Legend
Graph
Legend
Graph
Legend
Graph
Legend
Report
RepGenView
CRulerBarWnd
Photometric Toolbar
Kinetics Tool Bar
Report
Full Detail
Whole Page
Instrument Bar
Auto Scan Window
Spectrum
Legend
Photometer Buttons
Report Objects
Legend

The purpose of this is to dump the read data into a text file and have another program, Labview, to read from it. Cannot proceed to this step yet if above problem can not be solved.

Feel free to give any ideas on how to retrieve the displayed value in the button box.

 

Thanks and Regards,

Mike2018

pic1.jpg

pic2.jpg

Link to comment
Share on other sites

No.

When the button box is showing "No Instrument", what I get by using ControlGetText is this value " 350.0 nm     1.000 Abs ".

Same things too, when the machine is running. The button box showing "800.00nm     0.261 Abs", what I get is also " 350.0 nm     1.000 Abs ".

It looks like it gets the button box "text", not the value displayed on the button box. Maybe the control is hidden from AuInfo checker.

Link to comment
Share on other sites

when the machine is running, use the info tool to capture. post all the data from that. not snippets. if it can't see the values then you have a problem and maybe you can't use standard AutoIt methods

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Hi @Earthshine,

Thanks for the suggestions. I have tried the info tool on the button when the machine is running. I cannot see the displayed button values on the summary tab.

Any others Autoit methods that I can try to access the button values?

 

Regards.

Link to comment
Share on other sites

IUIAutomation i guess, but im still learning more about it, it's a bit complex for me. Check my sig.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...