LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with the implementation of below DLL in LabVIEW Call Lib function

Solved!
Go to solution
Highlighted

Here is the list of C functions in the doc that I have but I'm not getting the exact output.

 

I need a help only to understand these functions and how to configure it in LabVIEW

 

Parameters


voltType
[in]Specifies a voltage sensor to get value from. It can be one of the flags
VCORE (1<<0)
V25 (1<<1)
V33 (1<<2)
V50 (1<<3)
V120 (1<<4)
VSB (1<<5)
VBAT (1<<6)
VN50 (1<<7)
VN120 (1<<8)
VTT (1<<9)
retval
[out]Point to a variable in which this function returns the voltage in Volt.
Typesupport
[out]
If the value is specified as a pointer (non-NULL) to a variable, it will return the types of available sensors in flags bitwise-ORed
Return Value
TRUE (1) indicates success; FALSE (0) indicates failure.
Remarks
Call the function first with a non-NULL typesupport to know the available fan sensors and a following call to get the voltage required.

GCentral
0 Kudos
Message 1 of 7
(1,300 Views)
Highlighted

If you have access to header file of the DLL, Import Shared Library can be very useful.

 

If not, there is a great example that ships with LabVIEW, 

<LabVIEW>\examples\Connectivity\Libraries and Executables\External Code (DLL) Execution.vi


CLA CTAChampion
Subscribe to our Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 7
(1,267 Views)
Highlighted

@ManLD wrote:

Here is the list of C functions in the doc that I have but I'm not getting the exact output.

 

I need a help only to understand these functions and how to configure it in LabVIEW

 

Parameters


voltType
[in]Specifies a voltage sensor to get value from. It can be one of the flags
VCORE (1<<0)
V25 (1<<1)
V33 (1<<2)
V50 (1<<3)
V120 (1<<4)
VSB (1<<5)
VBAT (1<<6)
VN50 (1<<7)
VN120 (1<<8)
VTT (1<<9)
retval
[out]Point to a variable in which this function returns the voltage in Volt.
Typesupport
[out]
If the value is specified as a pointer (non-NULL) to a variable, it will return the types of available sensors in flags bitwise-ORed
Return Value
TRUE (1) indicates success; FALSE (0) indicates failure.
Remarks
Call the function first with a non-NULL typesupport to know the available fan sensors and a following call to get the voltage required.


The parameter describtion you show is useless. It tells absolutely nothing about the actual data types used nor how those parameters are exactly supposed to be passed. Show us at least the function prototype too!

Rolf Kalbermatter
Averna BV
0 Kudos
Message 3 of 7
(1,236 Views)
Highlighted

..Ooopss..!!

 

Sorry I missed that.

 

Here is the proptotype

 

BOOL SusiHWMGetVoltage(DWORD voltType, float *retval, DWORD *typeSupport = NULL);

 

From here it is clear that the voltType and typeSupport are 32 bit integer but i'm not getting output in LabVIEW.It may be due to wrong implementation.

GCentral
0 Kudos
Message 4 of 7
(1,213 Views)
Highlighted

And how did you configure the Call Library Node? From the description with the first call with typeSupport being non-NULL anbd then NULL you will have to configure two different Call Library Nodes for this to implement.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 5 of 7
(1,194 Views)
Highlighted
Solution
Accepted by topic author MangeshD

Thanks everyone...!!

 

I have resolved this issue.

 

There was a problem in configuring the VoltType. It needs to have a cluster of bits.

 

Here is the screenshot.

 

🙂

GCentral
0 Kudos
Message 6 of 7
(1,166 Views)
Highlighted

That looks quite a bit like a Rube Goldberg solution. Most likely the code you show is equivalent to this:

 

No Rube Goldberg.png

Rolf Kalbermatter
Averna BV
0 Kudos
Message 7 of 7
(1,145 Views)