C program calling dll made in Labview7.1

Hi all
i made a program in labview and the made its DLL using application builder.Now when i want to use the DLL in C program,my program is compling but while building it the error comming is  Unresolved external '_SETINS' referenced from D:\dhiraj\labread.OBJ. SETINS is the function name i am calling.
Moreover i also want to know that is there someway to provide character string output from the DLL made in Labview.
Also if the parameter which i am passing as arguments to the DLL and then in DLL i am changing the argument value,then when i come back after the DLL call ,what will be the value of the arguments??.Will it change or remain the same.
Thanks in Advance for early reply.....
Dhiraj Kumar

dhiraj03416 wrote:
Hey Why is someone not attending to my problem,maybe i feel labview DLL's can't be used in any language.Its not being recognized by the C++.
Oky let me make it simple.
Let us make a DLL with  C=SUM(A,B) where (C=A+B)
now how to use the DLL in any orther language and use the function SUM.
Hoping This time someone replies
Thanks in Advance
Dhiraj Kumar
When you build your DLL in LabVIEW, LabVIEW also creates a .h file and a .lib file. The H file you obviously have figured out already needs to be #included in your source file where you want to call the function. This allows the compiler to create code to call that function correctly. However the linker has no idea where to get that function from and that is where the .lib file comes into the play. You need to add that lib file to your project too, so the linker can resolve the function call properly.
A little bit of C programming basics also includes some basic knowledge about linking the program together and that you need to have all functions available in either an object or library file, somewhere
And last but not least the lib file only contains the code to look for the function in the according DLL file, so in order to run your application afterwards you need to make sure to copy (and distribute) the DLL into your executable directory.
Message Edited by rolfk on 10-30-2009 01:32 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • C++ Call to DLL made in LabVIEW Fails the second time it is called

    I have an application where a C++ executive calls a LabVIEW DLL (a LabVIEW application built into a DLL).
    The executive calls and operates the DLL fine the first time (NT, the applications task manager shows LabVIEW runtime runs, then stops when the DLL is done. However, when the executive calls the DLL a second time, it hangs, and the runtime engine never shows up in the applications task manager as running.
    However, this only occurs when something like IMAQ, DAQ, or another custom DLL call is occurring. We tried it with a simple DLL that only uses a call to the sound VIs, and it seems to run fine, although as the program called is very short, and the task manager slow, we never see the runtime engin
    e in the task manager. We are going to put a popup dialog in to ensure that the DLL is being called reliably, but we believe it is.
    We are unable to answer why when we call something that uses IMAQ, that the DLL doesn't run right the second time. We are unsure of the reasons, but believe it to be related to thread creation and destruction in the executive.
    If anyone out there has any insight into this, we would be happy to see it.
    We will be putting in a formal request for support from NI, but wanted to poll the audience as well, as we know from first hand experience that LabVIEW users often times have more experience with this sort of thing than developers.
    Thanks a bunch

    > Thanks for the information Greg. There is no documentation on this
    > issue, except for the email that we got from NI Support. This is
    > quite a new realm for us and NI alike. We would like to know what
    > your experiences have been on this subject. If you have a bit of
    > information, perhaps we should suggest a topic. As I said, this is a
    > new frontier for LabVIEW, and there are a lot of things that NI
    > doesn't know, and I'm sure a few of the programmers out there have
    > figured out.
    >
    I often answer emails from home, but I work for NI on the LV development
    team. So anything I know about, NI knows about. The info I was
    describing about the DLL execution system is not well documented since
    we were hoping that it would work we
    ll with the way Windows Apps are
    typically written. I suspect that we will need to write a Tech Note
    to cover the nitty gritty. This sort of info gets lost in manuals,
    and it is subject to change as we learn how people are expecting to
    use it.
    Anyway, my post was to explain why your use of it didn't work.
    In general, we believe that LV DLLs are thread savvy, reentrant
    VIs can be called from multiple threads simultaneously, execution can
    continue in the background after the DLL call has returned, and the UI
    is live provided the calling app processes messages in that thread.
    If you have other issues or questions, just ask.
    Greg McKaskle

  • The problem about call dll from VB....

    Dear All.
    I have a device and  VB dll file.I want to use labview to call  dll.But Labview show "An Exception occurred within the external code ..."
    Below is  to call this dll details.
    1、FindHardware:
    Call it at beginning when load program first, it can let program auto detect printer port address and model of dso scope.
    parament
    winversion:
    winversion = 2  "Windows NT,XP"
    UIP: open UIP(2048) array
    UCP:open  UCP(1023, 1023 + 11, 6)  array
    return:
    board_model:
    dso2902_128 = 27
    Then is my program
    Could somebody tell me what's wrong?
    Attachment file is this dll.
    http://us.f1.yahoofs.com/bc/500cf3ac/bc/dll/dll.ra​r?bfd1QSDBkHPgKI9c
    Thanks.
    由 Samyang 在 10-09-2005 07:14 AM 上編輯的訊息

    I can't say I understand the documentation snippet you provides, and I also can't access the DLL, but here are a couple things...
    1. I doubt very highly that a VB DLL is built with the C calling convension. I believe you should try the stdcall instead.
    2. You have the winversion being passed by pointer, but the docs make it look like a regular integer. Is that correct?
    3. Your board model is being passed by value, but it is listed as a return value in the docs. That would indicate an actual return value or a parameter passed by reference.
    My guess is that one or more of the above is causing the stack to get corrupted or an invalid pointer to be accessed and that is generating the error. Is there anyway to see the document (pdf or webpage)?
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • "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:CURRENTC? 1A,0.001MA".
    When i use VC++ to call this function,i program followed:
    CString m_wrt;
    int ReturnW;
    m_wrt="MEASURE:CURRENTC? 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.ther
    e is
    error.So, who can help me,to tell me how to call this
    function.Thanks."

    Are you asking about porting code or calling C++ code in LabVIEW?  As far as porting code, there's no easy way to move code back and forth between LabVIEW and C++.  However, if you are trying to call C++ code in LabVIEW, you can compile it as a DLL and call it in LabVIEW using the Call Library Function node.
    Chad B. » National Instruments » ni.com

  • Can we call DLL method in jave code

    hi,
    can we call DLL file method in java Code or program.

    See
    http://forum.java.sun.com/thread.jsp?forum=52&thread=179765

  • 1097 error calling DLL

    Hi,
    I am a student currently doing an internship, and I may need some help. First of all, I am a beginner with LabVIEW, so maybe what I am asking is silly but I am completly lost.
    In my project, I have to command a CD/DVD reader manually (speed of rotation, data transmitted...), and for this I am using a free DLL file I find download on this website.
    http://www.frogaspi.org/
    So I do not have access to the source code, just to the header file and the DLL. When I am calling it, I get the error number 1097.
    As I understand in several posts on this forum, the reason is probably that the buffer used by the Call Library Node is not correctly sized. Indeed, the parameter is a pointer to a cluster that contains numbers and strings. But how exactly can I do a allocation of memory on Labview?
    Also, I understand that writting a C++ wrapper could be a solution, but can I do that whithout the source code? (I only know a little bit about C and not about C++, but I understand that both are similar so I hope I will manage to do it if you think it is possible. Still if it is, could anybody send me some documentation about it).
    If anybody could have any idea that would be useful or at least could advise me some documentations, I would me more than grateful.
    The header file and the DLL files are available on the link I post (it is not my work so I am a little uncomfortable posting it here)
    Thanks a millions,

    Hi,
    First of all, thanks for your answer. Sorry for answering just now, but I was trying to advance by my own too, and also I was asked to work on other things in my internship. I will try to explain you what I have done so far.
    Thanks for explaining me the difference between an API and an ASPI, I have to recognize that I did not get the difference between both before you told me, and that makes everythink clearer to me now. Still, the "dll" I find on this website seems to be a ASPI Manager, and they say
    "The ASPI Manager for the SCSI host adapter processes these function calls and generates the appropriate SCSI commands to the SCSI peripherals".
    So, maybe I misunderstand that again, but it seems to me that the first step you recommend to do is already done by the creater of this DLL.
    Also, I am now using Labview 2011 instead of 2010, but I don't think this change a lot in my problem. I send the labview code I made, it is currently very basic but if I cannot access the basic function of the DLL, there is just no point trying to make a code more complicated. I am for now just trying to call one of the function of the DLL and see what is happening.
    For this first function, the parameter to send to the node is a pointer on this structure:
    typedef struct
    BYTE SRB_Cmd;                 // ASPI command code = SC_HA_INQUIRY
    BYTE SRB_Status;              // ASPI command status byte
    BYTE SRB_HaId;                 // ASPI host adapter number
    BYTE SRB_Flags;               // Reserved, MUST = 0
    DWORD SRB_Hdr_Rsvd;     // Reserved, MUST = 0
    BYTE HA_Count;                // Number of host adapters present
    BYTE HA_SCSI_ID;            // SCSI ID of host adapter
    BYTE HA_ManagerId[16];    // String describing the manager
    BYTE HA_Identifier[16];      // String describing the host adapter
    BYTE HA_Unique[16];         // Host Adapter Unique parameters
    WORD HA_Rsvd1;             // Reserved, MUST = 0
    SRB_HAInquiry, *PSRB_HAInquiry;
    It is not really working so as I read on this NI webpage: http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33
    "Note that if your complex data type is a struct with more than primitive data types (int, double, char), it is easiest to create a wrapper DLL from a C-based language."
    So this is what I have been trying to do, and maybe it is very basic, but if anyone could send me a link on how to create a wrapper DLL, it would be very useful. I already download the one National Instrument made, but I did not really understand it.
    The DLL seems to work fine as I manage to call it from a C console programme. (I send the code too). But I tried to followed some tutorials but I just cannot create a DLL that I could use, so maybe there is something badly set in my IDE (I am using Code::Blocks). So if anybody has any idea of what is going on I would be very grateful. Again, the DLL I tried to make is very basic but if the basic are not ok, there is no point going further.
    This is what is happening right now : I create the dll file following the instruction but when I compile I get this warning:
    "warning: 'int addition(int, int)' redeclared without dllimport attribute: previous dllimport ignored"
    and then I just can't compile the test programm because I get the error: altough I did set the file.a as a linker.
    "undefined reference to `_imp__addition' "
    I send the compressed files that I made, I think there should be everything that is needed to answer me, except the DLL file that is available here http://www.frogaspi.org/download.htm
    Again sorry, but the owner of this library explicitly asked not to purpose a local download so I feel very unconfortable doing that, so please, just click on the link and download it from there.
    I do not know if anybody has ever done what I am trying to do, and I am not asking for someone to do it instead of me, I am sorry if I sound like it in my previous message, this was definitly not my intention.
    Still, the problem of having to write a wrapper seems to be a commun issue for people calling DLL in Labview, and I didn't find answer very clear on how to create a dll. I guess I could eventually find out by myself, but if anybody can help, that would make me save a lot of time.
    Maybe what I am asking is very easy, but again my knowledge about C language is basic, I am not  a computer science student so...
    Anyway, thank in advance,
    Adrien
    Attachments:
    Problem Wrapper.zip ‏31 KB

  • I'm trying to open a 'mv' file.  I found a program called Flip4mac WMV Player Pro.  Does anyone have any experience with this or have another suggestion?

    I am trying open 'mv' files.  I found a program called Flip4mac MWV Player Pro.  Does anyone have experience with this or is there a different way to open these type of files?

    It works quite well, but is only useful for playing .wmv files such as those made on older PCs. MPlayer 1.0 rc2 is a free utility that should also play .wmv files.

  • Call dll from my dll

    I Have a dll file for my attendance machine
    and every thing are ok when I call dll from my exe application
    I want to create my own dll which my dll connect to attendance dll and get data from it and then insert data to tables
    a second question
    is there a method for calling my dll through windows batch file or I must create an exe application calling from it

    Let me explain a bit what a VFP DLL is for:
    You can only build one type of DLL, an OLE COM Server DLL. It'll mainly contain OLEPUBLIC class definitions, which are then usable in other programming languages. In any programming language capable to make use of OLE COM Server classes.
    If your project is named mydll.pjx and a prg or vcx contains a class myclass, the final DLL will have the OLE class "mydll.myclass" in it.
    This is overhead, if you use this in VFP. If you want to modularize your application, then create several EXE or build as APP. You can DO some.prg IN some.APP or you can create an object o = NEWOBJECT("myclass","myclasslib.vcx","myapp.app")
    to refer to a class inside a vcx compiled and build together with other project files into an app file.
    But any separation you do complicates the code use. A DLL is only needed, if some other programming language needs to use your VFP code. And that other programming language has to be able to instanciate classes.
    You don't need this, even if other programming languages would be involved. You can compile an EXE and that can be run. If needed with parameters. That's typically much simpler and could even be used by DOS batch files either using the DOS start command
    or directly your.EXE as man DOS commands also are merely EXE files.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH http://www.tmn-systemberatung.de

  • Call dll's function

    In order to call dll's functions in a program, written in graphical
    programming langage (labview), I would like to understand the arguments
    of these functions.
    How can I know, or where can I find the values of the dll's functions
    arguments ?
    For exemple, play a midi file with mciSendString of winmm.dll.

    May be you can find docs for standart Windows API function in help for
    Borland C++, or Visual C++.
    Vincent Chollet wrote:
    > In order to call dll's functions in a program, written in graphical
    > programming langage (labview), I would like to understand the arguments
    > of these functions.
    >
    > How can I know, or where can I find the values of the dll's functions
    > arguments ?
    >
    > For exemple, play a midi file with mciSendString of winmm.dll.

  • Why do I get 'Bad Calling Dll Convention​' ?

    Hi,
    the attached fiel contains an experimen to read dll made in LV 8.6 and use it in VB6.
    The zip file contains the vi (adding 2 numbers), LV project, VB6 project.
    The function seems to work.  it adds the numbers but still, it gives the error 'Bad dll calling convention'.
    I think I made it right. i used the Standard Calling Conventioin.  I used Double in LV and Long in VB.
    how do I get rid from this error?
    Can sombody use this example on his machine.  May be it's something to do with my specific machine?
    Solved!
    Go to Solution.
    Attachments:
    LVDLL Experiment.zip ‏23 KB

    Rafi,
    I took a look at your code and I think that the problem may be in your expectation of what's going to happen.  At the point that you build into a DLL, your AddNumbers VI becomes a function call.  You are then passing a string into that function call but you don't have anything coming back out of it.
    As an experiment, I took your VI and wired the "concatenated string" output to one of the icon terminals and then added a function export for it in the DLL function.  It looked something like the following (both the C prototype and the VB equivalent):
    ' void AddNumbers(double x, double y, char string[], double *xY, char concatenatedString[], int32_t len)
    Declare Sub AddNumbers Lib "C:\Users\jasonw.AMER\Desktop\LVDLL Experiment\SharedLib.dll" _
           (ByVal x As Double, ByVal y As Double, ByVal myMsg As String, ByRef xy As Double, ByVal outString As String, ByVal stringLength As Long)
    I then tested calling that function and I think it's safe to say that it's properly passing strings because I was able to get the returned string of "the message recevied by the dll is.....My First Message".  Here's what my calling code looked like:
        Dim outStr As String * 100
        Call AddNumbers(x, y, "My First Message", xy, outStr, 100)
        Debug.Print outStr
    So I think it's working properly.  There's no need to append the null character apparently (although I did notice in your code that you had enclosed the Chr(0) in quotes...it should be without quotes to properly give a null character...but you can leave it out altogether).
    Long story short, your code probably was working right.  Hope that helps.
    Jason 

  • Calling DLL on LabVIEW for Linux

    I have a vi that calls a dll made with Visual C++ on windows enviroment. What are the steps for calling this same dll on Linux ? Do we need to generate another dll?

    In article <[email protected]>, Labviewguru wrote:
    > First, I don't know if LabVIEW for Linux can even call a DLL. I
    > suspect that since this technology (as obsolete as it is, at least for
    > an operating system - thank you Windows) has been adopted by Linux,
    > that you can. I don't have my linux workstation on at the moment, but
    > if you need to know, I can check.
    >
    > As for the DLL itself, I suspect you will have MAJOR problems getting
    > it to work right in Linux, and that you will almost definitely have to
    > rebuild it with a Linux native compiler. It sounds like you have the
    > source code, so it should be a matter of just porting it over, and
    > stripping out all of the platform dependent calls a
    nd substituting all
    > of the necessary function calls.
    >
    > Good luck, and please keep us up to date on your progress. Not many
    > of us use Linux, and any and all information on the matter is gold.
    In linuxland isn't a dll called a shared library? You'd basically have to
    get the source for the dll and beat on it until it turns into a shared lib
    (better still, see if you can get an already built linux library). Actually
    hooking into the library from within LV should work the same in either world.
    NI, by the way, has app notes on this subject. I haven't gotten around to
    reading any of them yet, though.
    That's my story and I'm sticking with it.

  • My local library uses a program called Overdrive Media Console to check out audiobooks.  MP3 type books go to music on my iPod Nano, but I am unable to delete them because I tunes doesn't display them as content. What should I do? I need the space.

    According to my library, I can download MP3 audio books to my Ipod Nano.  The material is "checked out" to a program called Over Drive Media Console. and from there, it is transferred to my IPod.  the audio doesnt go to Audi Books, it goes to Music.  I want to delete some of the books I have listened to, but when I plug in the Ipod and open ITunes, the titles are not there.  The manual says to connect to itunes, and delete a "song or other material" but since I  did not use ITunes to get the
    "song" to begin with, it isnt recognized.  How can I get these audioboks off my IPOD?  I am running out of space.  I tried connecting to Overdrive, but the software doesnt recognize the internal content.  It only sets it up for transfer.

    The audio books do not display under the music sub-menu
    And they shouldn't.  They should be under the Books submenu that is further down the list from the Music submenu you are referring to.
    B-rock

  • Application crashes when calling DLL built with LabVIEW 2011

    Hello everybody,
    Our application calls DLLs built with LabVIEW 2010 SP1. We installed LabVIEW 2011 and built some DLLs. So far so good. If we start our application and run 2010 DLLs it still works fine. If we run a 2011 DLL just once no error happens, but if we try to run the same 2011 DLL our application crashes reporting the error below. I saved the code for 2010 version and built a DLL and it works fine. Does anyone know why?
    Thank you in advance.
    #Date: Fr, 16. Sep 2011 16:25:25
    #OSName: Microsoft Windows XP Service Pack 3
    #OSVers: 5.1
    #OSBuild: 2600
    #AppName: PasTA
    #Version: 11.0f2 32-bit
    #AppKind: AppLib
    #LabVIEW Base Address: 0x30000000
    16.09.2011 16:25:26.181
    Crash 0x0: Crash caught by NIER
    File Unknown(0) : Crash: Crash caught by NIER
    minidump id: 8a779b3f-51d7-4864-8e4d-6ab0195cd158
    ExceptionCode: 0xC0000005
    N
    0x3072C804 - lvrt <unknown> + 0
    0x3072CBB8 - lvrt <unknown> + 0
    0x7C864191 - KERNEL32 <unknown> + 0
    0x7C83AB50 - KERNEL32 <unknown> + 0
    0x00000000 - PasTA <unknown> + 0
    Attachments:
    error.PNG ‏11 KB

    On that note, you should be able to create DLLs in 2010 and run them with 2011, correct??  In my case, I have a 2010 built DLL (talking to sbRIO), most of the functions work when run in 2011, but a couple of them lock up LabVIEW on the desktop (but not the sbRIO), no lock ups happen with 2010 on the desktop.

  • Call dll in labview

    "Hi All,
    I have to get data from USB camera, I have following functions in DLL.
    DLLINOUT HANDLE WINAPI CC_Open( LPCSTR CameraName , ULONG CameraNumber , CC_CAPTURE_MODE CaptureMode ) ;
    and
    DLLINOUT BOOL WINAPI CC_CaptureSingle( HANDLE Cam , PVOID Buffer , ULONG TransferSize , CC_TRIGGER_MODE TriggerMode , USHORT TimeOut , OVERLAPPED * pUserOverlapped );
    When I open hardware with function cc_open I am getting handle to an object. How can I store this object and pass it to CC_CaptureSingle function?
    Another question is when I call CC_CaptureSingle I am getting pointer on the 2 dimension array �PVOID buffer� how can I get this array in Labview?"

    hi,
    you can do this two thing.
    1. Create your new DLL with (your DLL will call camera's DLL) one big function my_capture_image() and insert you do CC_Open(), CC_CapruteSingle() and CC_Close(). And to LabView you pass only Array whit image data. And you don't have problems with HANDLE. But you must allocate memory for image array in LabVIEW before you call this DLL!!! [Or use LabVIEW C function for reallocating memory]
    2. You must identify type of HANDEL variable. And you can change type of this variabile. But when HANDLE variable is structure it is hard pass this structure to LabVIEW.
    If you use LabVIEW 7.1 look example 'Call DLL.vi' it is great!
    Have a nice day.
    JCC

  • Calling  dll method from oracle forms

    Hi,
    This is my first post in this forum. I don't know whether this is the right place to post this topic here.
    i wana call DLL method from the button click event of my form.
    I new to oracle development any help will be greatly appreciated.

    Calling DLL using form 6i
    Regards,

Maybe you are looking for