ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data from executable

Solved!
Go to solution

Hello everyone,

 

I'm a beginner of LabVIEW, and recently have some problem about "get data from .exe". Now I have an .exe of random number generator, and is it possible to get the number by .vi ? (The attachment is  rng.exe). Hope someone can help me, and don't be hesitated to ask more detail.

 

Thanks a lot

 

Albert

 

0 Kudos
Message 1 of 8
(4,851 Views)

Hi Albert,

 

I don't think I will start any EXE from a public forum without being able to see it's code…

 

have some problem about "get data from .exe".

You can use several options:

- save data to a file

- publish data over network communication (UDP, TCP, SharedVariables, NetworkStreams, many more…)

- use a screen scraper with image analysis to get the displayed numbers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(4,842 Views)

@GerdW wrote:

Hi Albert,

 

I don't think I will start any EXE from a public forum without being able to see it's code…

 

have some problem about "get data from .exe".

You can use several options:

- save data to a file

- publish data over network communication (UDP, TCP, SharedVariables, NetworkStreams, many more…)

- use a screen scraper with image analysis to get the displayed numbers…


Oh, I like the last one! Create a .jpg as output from the program and then read it with OCR! 😄

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 8
(4,835 Views)

Sorry for that, let me update the rng code.

0 Kudos
Message 4 of 8
(4,833 Views)

Hi Albert,

 

use any of the previously mentioned options…

 

Btw. not everybody here uses 7zip, so you should use plain ZIP when compressing files/folders. For simple (and small) VIs you don't even need to compress them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(4,830 Views)

Using invoke node allow me to easily read data from this vi (rng.vi). However, when I convert rng.vi to rng.exe, the invoke node seems to be disable...

0 Kudos
Message 6 of 8
(4,824 Views)
Solution
Accepted by topic author YuChuanHuang

Hi Albert,

 

when I convert rng.vi to rng.exe, the invoke node seems to be disable...

Yes.

 

That's a system protection in most modern OS: you don't want one executable being able to manipulate data in another executable! In a modern multitasking OS each executable uses it's own memory scheme! When you want to communicate between executable you should use network functions…

 

When you just need a RNG you should implement that function in a DLL. Then call that DLL function using the CLFN from your other executable!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(4,812 Views)

Thanks for your kind reply and providing me some way to study.

0 Kudos
Message 8 of 8
(4,803 Views)