From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Need advice on setting Call Library Function Parameters

Hi All.

 

I am trying to configure a call library function with the following parameters from MSDN

 

BOOL WINAPI GetConsoleScreenBufferInfo(
  _In_  HANDLE                      hConsoleOutput,
  _Out_ PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
);

 

For the types HANDLE and PCONSOLE_SCREEN_BUFFER_INFO what should they be set to. These are C++ parameters and there is no documentation of how to use them in Labview. Does anyone know how to set them up??

 

Thanks.

0 Kudos
Message 1 of 17
(3,399 Views)

Hello

 

Usually for handle type you need to use i32 and for Screen_buffer_info I would guess string. Try it and let me know whether it works 🙂

 

Marcin

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 2 of 17
(3,380 Views)

No that hasn't worked. When I create both the input and the output it creates an in and an out for each. Should there be just one input and one output?

 

lib call.jpg

0 Kudos
Message 3 of 17
(3,375 Views)

I'm not sure but I think it's expected behaviour because the function just needs the refernece for the out parameter. Do you have some error right now or just the behaviour is different than expected?

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 4 of 17
(3,373 Views)

The error code is 1517. Call Library Function Node

0 Kudos
Message 5 of 17
(3,368 Views)

Can you send some code of your application?

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 6 of 17
(3,358 Views)

The vi is attached. i run a cmd window in the background and then run the vi hoping to get the data from the cmd window.

0 Kudos
Message 7 of 17
(3,354 Views)

Sorry I missed the VI.

 

You cannot pass 0 to the handle because it doesn't mean anything. You have to know the handle to the console and I am not sure how to get the handle to the already open cmd window.

 

Can you maybe call the cmd window directly from LabVIEW? Then I suppose getting handle to it would be easy.

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 8 of 17
(3,347 Views)

In this vi I have called the command window and implement a keypress. is it possible to get the handle from this?

0 Kudos
Message 9 of 17
(3,342 Views)

Try to use this function:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx

 

You want to get handle STD_OUTPUT_HANDLE.

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 10 of 17
(3,339 Views)