LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dll

I have a DLL which has a Function called " Is Firmware Running ? " the prototype of the function specified by the DLL provider is "BOOL IsFirmwareRunning(void);" . When I call this DLL in labVIEW, I will have to specify the Return type as Boolean. But LabVIEW gives me only 3 options as Return type, it can be any of the following as
Numeric,
String,
 Void.
I dont have an idea of proceeding futher please help me.
 
Thanks in advance
Rajkumar
0 Kudos
Message 1 of 11
(4,632 Views)
Use Numeric..
 
If Numeric==0 then it is false //
 
Best regards
Siva
sivamgr@gmail.com
0 Kudos
Message 2 of 11
(4,619 Views)
hi Rajkumar,
 
take a numeric as return value. 0 = false; 1 = true
Mike
0 Kudos
Message 3 of 11
(4,618 Views)

Thanks Siva and Mike

Siva : hi siva anna how are you. Great to hear from you after a long time.

Second Question:

i had already done it. I have one more question how do i declare this is LabVIEW. Can anyone explain me what this means.

 LONG DownloadToDevice(HWND hWndDest=NULL);     

Thanks in Adavance

Rajkumar

0 Kudos
Message 4 of 11
(4,610 Views)
All HWND are unsigned int only..
NULL is defined as 0 (zero)
 
you can configure HWND as u32... pass 0 for NULL..
Best regards
Siva
sivamgr@gmail.com
0 Kudos
Message 5 of 11
(4,607 Views)
What does HWND mean can you give me a clear expalnation.  
0 Kudos
Message 6 of 11
(4,601 Views)

HWND : Handle to Window...

If a application passes its HWND to other process., then that process can access the DC of the applicaiton's window and can directly update its result over the application's GUI...


 

 

 

 

Best regards
Siva
sivamgr@gmail.com
0 Kudos
Message 7 of 11
(4,598 Views)
I unut derstood what is handle to window. But It is not still very clear to me in the present senerio. Can you explain me what will happen when i send this command.
 
LONG DownloadToDevice(HWND hWndDest=NULL);     
 
 
 
0 Kudos
Message 8 of 11
(4,593 Views)
What is the DLL you are refering to?. What is the API/SDK you are using?.
 
Best regards
Siva
sivamgr@gmail.com
0 Kudos
Message 9 of 11
(4,590 Views)
And the LONG is an I32.

To explain a bit more (to help you understand the dll a bit better)... The
return value is always a 32 bit value. This value that is returned is always
the processors eax register, and this cannot be anything else (as long as
"C" or "Std" calling convension are used). So basically, you can always set
it to U/I32, even if the return value is a string. This is because a string
pointer is also a U32!

So you never need to worry about the type of the return value. LabVIEW will
never crash if it is wrong, even if you make it void!

For the other parameters the stack is used. The other parameters of the
function can be 8, 16 or 32 bit, since these types can be used with the
stack. So a boolean in any other that the return value will probably be an
u8 (although that might depend on the language the dll is made in, and the
compiler).

The return address (the address from where the function is called) is also
on the stack, so if you configure the dll with the wrong number of
parameters, or the wrong types, LabVIEW will give an error when the code is
executed, or (worse case) it will crash!

Regards,

Wiebe.


Message 10 of 11
(4,587 Views)