LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL cout to console window

Hello all,

 

I have a DLL which when run through eclipse returns what is expected. When it is run through labview the DLL does not return what is expected.

The DLL has cout commands that print to a console window, and I need to be able to see these through labview so I can see where the DLL is falling over.

I know the DLL is working because it does return a path (it is looking for a file) if the DLL fails to finish, it would return the files contents if successful.

 

I have tried to follow the forum explanations here with no success (+ another couple of other forum ideas on the same subject):

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Access-to-console-output/idi-p/1765904

(if i select stderror i get nothing returned, if i select stdoutput nothing is returned and when I try to abort the program it won't abort).

 

Can anyone suggest a way to get access to cout/ know why the example above is hanging?

I am not running labview as a built .exe, I am just clicking the run arrow from the front panel, which calls the DLL

 

(I am on windows 7 if it makes a difference)

 

Thanks

 

0 Kudos
Message 1 of 5
(5,426 Views)
Could you write your debug output to a file instead of to the console?

What you really need, though, is to hook up your debugger properly so you can watch the DLL run while you're calling it from LabVIEW. This is easy to do from Visual Studio, no idea in another environment.
0 Kudos
Message 2 of 5
(5,389 Views)

It would be possible to write to a file instead but I am part of the test team, the development team are creating the DLLs

 

There are a LOT of DLLs that have been made (so it would be a fairly major change) and it would break how they use them.

We COULD just edit the 1 DLL so it prints to a file, but it would be much better if we can get the console window working so any future issues are easier/ quicker to resolve

0 Kudos
Message 3 of 5
(5,380 Views)
It would be simpler to pass data as parameters as the vast majority of dlls do instead of a console.
0 Kudos
Message 4 of 5
(5,371 Views)

Hi All,

 

I am trying to tackle a similar problem.

 

I have attached a simplified version of what I want to call from LV.

 

The function "triple", takes an integer and multiplies it by 3.  In addtion, it writes some 'debug' text using cout (see source code within zip folder)

 

I can call the function from LabVIEW without any issues, and see that it performs its tripling function.  However, I can't see any of the cout text.

 

For info, the DLL was compiled in MinGW.

 

Any help would be most welcome.

 

Thanks,

 

Dan

Dan
CLD
Download All
0 Kudos
Message 5 of 5
(5,262 Views)