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: 

Retrieve data form exe

Solved!
Go to solution

Hi,

 

I'm trying to create exe file that would accept data, make some calculations and then return results. The input is not a problem but I do have some troubles with getting the output working. I am currently exploring two options:

 

1. echo command + system exec 

In this case the echo works but it goes completely new window. Is it possible to configure it to return the data to the same window from which the program was called?

 

2. printf + CIN

 Here I'm trying to use printf from msvcrt.dll, but in this case I get no result at all. The function prototype looks like int32_t printf(const CStr str, int32_t arg);, and I'm calling it with "F temp val:%d" as str and int value. The return value from printf is 15 so it seems that they have been written somewhere. But where? The stdo should be the terminal from which I run the program, but there is nothing there. Shoud I redirect the output somehow?

 

Any ideas? Maybe there are other ways to solve the problem of retrieving data?

 

Best regards

Mikolaj

 

0 Kudos
Message 1 of 4
(2,569 Views)

Any reason you can't use a dll?

Where you return your data to? 

 

George Zou

 

 

George Zou
0 Kudos
Message 2 of 4
(2,547 Views)

Hi Mikolaj,

 

are you trying to a create LabVIEW Application using stdin and stdout?

Why are you calling printf from the msvcrt.dll. In LabVIEW this is done with the Format into String function from the string palette.

Are you in the right board or schould this go to LabWindows/CVI?

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 4
(2,545 Views)
Solution
Accepted by topic author souske

Hi,

 

Thank you for your answers. The reason for this is that I have LV code that I would like to run online. The project is quite big so I thought that I will create exe and call it from ASP. I have not tried to call dll from script code, I'm not sure if that's possible. And as far as the LV/CVI is concerned, moving the whole project would be extremely time consuming and, in this case, unnecessary since I am able to use exe created in LV. 

 

I solved getting data back by using temporary file. I write to it in LV and read it with VBScript

 

Regards

Mikolaj

0 Kudos
Message 4 of 4
(2,518 Views)