Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW to use Labview call Dll compiled by VC++

hello,I use VC++ compile a DLL,and i want to call DLL Function in LABVIEW program.But there is a dll function
when i call it in labview.There is error.The prototype of Dll Function that make error is "USHORT DLLFUN __stdcall IBWRT(unsigned short dev_address,const char *pstrWrite)",The second paramenter is a char pointer,
and the paramenter pass a command which content is
"MEASURE:CURRENT:DC? 1A,0.001MA".
When i use VC++ to call this function,i program followed:
CString m_wrt;
int ReturnW;
m_wrt="MEASURE:CURRENT:DC? 1A,0.001MA";
char buffer[40];
strcpy(buffer,m_wrt);
ReturnW=IBWRT(4,buffer);
and this call is correct.
But when i use labview to call this function.there is
error.So, who can
help me,to tell me how to call this
function.Thanks.
0 Kudos
Message 1 of 6
(4,148 Views)
This is not a general Visual C++ forum, it is for discussion of Measurement Studio in Visual C++. Also, this is a LabVIEW question. In the future, you should post questions like this to the LabVIEW section of Developer's Exchange.

In regards to your question, LabVIEW is setup to handle char* datatypes in DLL calls. You would configure the parameter as a C String Pointer in the Call Library Function VI.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 6
(4,148 Views)
HI,I modfiy my labview program according to what you said. But the error is still there.why?please help me.
Thanks.
0 Kudos
Message 3 of 6
(4,148 Views)
The method I listed works for me with char* data types. Again, this is a LabVIEW question, and probably the best thing for you do to would be to have one of our engineers help you with calling this DLL. There could be something I am missing. I would submit your question and the DLL you are trying to call to our engineers at http://www.ni.com/ask.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 4 of 6
(4,148 Views)
Thank you for helping me.Can i send my question to the
Engineer of NI? and how to send my question to Engineer
Please help me!Thanks!
0 Kudos
Message 5 of 6
(4,148 Views)
The website that I gave you, http://www.ni.com/ask, is where you go to submit the question to an NI engineer.

Chris
0 Kudos
Message 6 of 6
(4,148 Views)