From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

retrieving data from application with Labview?

i have a problem with retrieving data from another application using labview.

i have had a play with DDE and retrieved data from Excel using an example program and understand the method used, but the problem i have is a little more complicated, i have a 3rd party application running that is processing data and and controlling its own hardware and displaying the data i need into window. so all i want to do is get labview to grab this data value that this window is displaying.

the window only displays this number no other data, so is it possible to get labview to extract this value?


or if not then what is the best way of going about getting the data into labview?

thanks in advance.
0 Kudos
Message 1 of 5
(2,877 Views)
Are you able to configure the 3rd party sw to place a "snapshot" of the displayed data into some sort of file (text, spreadsheet, etc)?

Where does it get its data from? Does it manipulate it before the display?

Are you able to let us know what this 3rd party sw (or tool) is?

JLV
Message 2 of 5
(2,859 Views)
hi Joe

thanks for your swift reply,

that is the problem i have, if i could get the software to save to a file i could extract the data easily but as it is the software is "eDaq Chart" which comes with there own hardware to carry out analysis on the peaks from a Gas chromotography setup. the data is read into its own datapad file but this is in a window within the software so i was hoping there would be a way of extracting the data out of the window.

i can do it with DDE and excel, but not sure how to do it with this software as trying to get the datapad window to communicate with labview seems difficult!

hope this is the info you are after, and can help you understand the problem i am having!!

cheers

sean
0 Kudos
Message 3 of 5
(2,852 Views)
Take a look at a program called MacroExpress. If your dataacq program is windows based. I have used this to extract popup menu window text from a cad program and put it into a text file. Use the Variable Get Control Text command.



http://www.macros.com/

Here is a sample of the macro code.
Variable Set String %T10% "Empty"
Variable Set %T6% to ASCII Char of 13
Variable Set %T7% to ASCII Char of 10
Mouse Move Screen 290, 310
Capture Control to %C5%
Variable Get Control Text: %C5% to %T5%
Clipboard Empty
Repeat Until %T9% = %T10%
Mouse Move Screen 265, 543
Capture Control to %C1%
Variable Get Control Text: %C1% to %T1%
Variable Modify String: Copy %T9% to %T10%
Variable Modify String: Copy %T1% to %T9%
Mouse Move Screen 474, 356
Capture Control to %C1%
Variable Get Control Text: %C1% to %T2%
Mouse Move Screen 476, 372
Capture Control to %C1%
Variable Get Control Text: %C1% to %T3%
Mouse Move Screen 475, 388
Capture Control to %C1%
Variable Get Control Text: %C1% to %T4%
Mouse Move Screen 476, 400
Variable Modify String: Append "," to %T1%
Variable Modify String: Append %T2% to %T1%
Variable Modify String: Append "," to %T1%
Variable Modify String: Append %T3% to %T1%
Variable Modify String: Append "," to %T1%
Variable Modify String: Append %T4% to %T1%
Variable Modify String: Append %T6% to %T1%
Variable Modify String: Append %T7% to %T1%
Variable Modify String: Append %T1% to %T8%
Text Type:
Repeat End
Variable Modify String: Save %T8% to Clipboard
Text Box Display:
0 Kudos
Message 4 of 5
(2,837 Views)
I would solve, or at least attempt to solve, this problem by finding the window handle. Once you have that, you should be able to extract the text from the window, assuming that it is an ordinary text box, label, or other standard window type. To find the window handle, you can use the Windows SDK command FindWindow or FindWindowEx. To get the window text, use GetWindowText. I believe that these functions are already incorporated into the VIs of the Windows Utilties EPD located here, but if not, you can call them yourself with DLL nodes. You can read more about these functions at the MSDN Library: http://www.msdn.microsoft.com/library/

If you have access to Microsoft's Spy++ (which comes with Developer Studio) this can aid you in finding a reproducible way to find the window handle. This is usually somewhat tricky, as it may require you to code something like:

Find window named "Some Application"
Find a child of that window with the name "Document"
Find a child of that window with the class "DataWin"

or some such nonsense.

Of course, all of this assumes that you're using Windows :). I don't recall seeing that specified in the thread.
0 Kudos
Message 5 of 5
(2,810 Views)