Calling DLL problem

I have done some tests.  If I fill the array with some fixed value, the return array is always right.  I have the feeling that the problem is with the input data function.
>Hi,
>I have a LabVIEW applicaiton that calls a DLL library.  I wrote this DLL in Microsoft visual C++.  Basically, the my LabVIEW application sends data arrays into the DLL, the DLL does calculation, and later the application calls a function in DLL to get the calculation results.
>The application runs well in LabVIEW environment.  However, when I generate the binary file.  The binary doesn't work well.  What I get is always an double floating array that is filled with NAN.
>I checked my DLL source code.  In the code, all the calculations just use addition, subtraction, multiplicaiton, and division.
>I have done some tests.  If I fill the array with some fixed value, the return array is always right.  I have the feeling that the problem is with the input data function.
>Could anybody help me with this problem?
>Thanks,
>Yonggang
Message Edited by bnlgeese on 11-12-2009 11:46 PM

I'm sorry, are you responding to a thread? Or did you start a thread somewhere, and are you posting some additional information? If so, please do it in the original thread. I honestly have no idea what you're referring to.

Similar Messages

  • 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

  • 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

  • I want to call DLLs generated in LAbWindows CVI in Borland C++ (BCB 6)

    Hi,
    I want to call DLLs generated in LabWindows CVI in Borland C++, I am using BCB 6 and LabWindows CVI 8.
    I am able to call these functions in VC++, But getting following error in BCB
    ":[Linker Error] 'D:\GAJANAN\CVIDLL.LIB' contains invalid OMF record, type 0x21 (possibly COFF)"
    Please somebody suggest me how to solve this problem.
    Thanks and Regards
    Gajanan

    Duplicate post.

  • Do i have to use .h files to call .dll files?

    Dear,
    Now i want to use labview to control an instrument. And the instrument company give their dll files.
    When i use tools---> import---->share library,labview tells me import .h file,but their are many .h files,you know you can just choose only one head files in labview at the same time.So should i write a new .h file to concluding this head files and every thing will be ok?it is complicated.
    I use another method to call .dll and it is CIF.But i also encounter new problem.When i invoke the node .dll,and then choose the functions,i find that the functions are void.Does It meanthat i can not input my parameter,and get output?
    So what' the problems?
    Thanks.

    To call a dll in LV, you have to use the Call Library Fuction node in your BD. Then dbl-click it to open the Configuration dialog. In that, you have to browse to the appropriate folder in teh Function tab & select the dll you want to call. Then select the function from the list populated down to it. Then go to the Parameters tab & select/assign the parameters for that function. This will do the job.
    - Partha
    LabVIEW - Wires that catch bugs!

  • 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

  • Installed 7.1 on new Dell. Windows shuts down as result of "nixsrk.dll" problem.

    I installed LV 7.1 on new Dell with XP.While running the LV application, Windows shuts down to prevent damage to computer as result of "nixsrk.dll" problem. What is the fix?
    Thanks,

    How is your application architected? Are you making calls to DLLs using a Call Library Function Node? It might be that for some reason some of the components for your application were installed correctly on the Dell computers. I would suggest that you try some other application and make sure whether the issue is with your application or LabVIEW installation.
    Regards,
    Chetan K
    AE-NIC

  • NI's answers to .dll problems

    I emailed NI about the lvpng.dll problem I have in LV 5.1.1. If I call
    this .dll to save a png format of the front panel, over time, it
    consumes memory. I'd like you to see the response I got.
    [email protected] writes:
    I tried your VI, and was not able to reproduce the memory leak in
    LabVIEW 6i. This is good news for 6i users.
    Wow, thanks. Do I get a free version of 6i to fix my problem? What is
    the solution?
    Mark
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Out of respect for Darren, and to clear up the misunderstanding, Darren
    is checking in with R&D to get the problem resolved; thank you.
    The original response, however, did not state anything about checking
    with R&D, or about resolving the problem in 5.1.1. The answer I got
    was:
    Mark,
    I tried your VI, and was not able to reproduce the memory leak in
    LabVIEW 6i.
    It looks like my test goes along with the individual you spoke of from
    the
    usenet. This is good news for 6i users.
    Sincerely,
    I was not entirely happy with the response I was given. Rather than
    wait until I contacted Darren again, I posted this message with the
    response in it, which I am sad to say was careless of me.
    What has transpired since then is that Darren did not realize that I
    don't have the means to upgrade to 6i. It was then in his message back
    to me that he stated that R&D is looking into the problem.
    I apologize for the misunderstanding, and will not make such posts
    again until the situation is resolved.
    Mark
    In article <[email protected]>,
    "Darren Nattinger" wrote:
    >
    > Hello everyone,
    >
    > I am the engineer at National Instruments that responded to Mr.
    Wysong's
    > original question regarding the memory leak with the PNG VIs in
    LabVIEW.
    > The full context of my message actually stated that, although the
    problem
    > appears to be fixed in LabVIEW 6i, I have contacted R&D and am
    awaiting their
    > response regarding a possible resolution with LabVIEW 5.1.1. I have
    related
    > the relative importance of the problem to R&D, so we hope to get a
    speedy
    > reply and/or resolution to Mr. Wysong.
    >
    > Thank you all for your interest in LabVIEW. It is my job to support
    customers
    > who use this product, so I come across all sorts of LabVIEW
    applications
    > every day, and I love it. Please take full advantage of our on-line
    support
    > resources (www.ni.com/support), this newsgroup, and our e-mail support
    system
    > (www.ni.com/ask) whenever you have technical questions about National
    Instruments
    > products.
    >
    > Have a great day,
    > Darren Nattinger
    > LabVIEW Support
    > National Instruments
    >
    > [email protected] wrote:
    > >I emailed NI about the lvpng.dll problem I have in LV 5.1.1. If I
    call>this
    > dll to save a png format of the front panel, over time, it>consumes
    memory.
    > I'd like you to see the response I got.>>
    response>>>[email protected]
    > writes>I tried your VI, and was not able to reproduce the memory
    leak in>LabVIEW
    > 6i. This is good news for 6i users.>>>>Wow, thanks. Do
    I
    > get a free version of 6i to fix my problem? What is>the
    solution?>>Mark>>>>>>Sent
    > via Deja.com http://www.deja.com/>Before you buy.
    >
    Sent via Deja.com http://www.deja.com/
    Before you buy.

  • Labview fails to call dll after Migration from 2010 to 2014

    An error  'Failed to load dynamic library because of missing external symbols or dependencies or because of invalid file format' occures everytime the labview framework tries to call dll. Has anybody come across this problem before.???

    priyanka0101 wrote:
    [...] But this dll consists of APIs which [...]
    This sounds as if the DLL requires some other components, most likely other DLLs. Is it possible that these are not installed on the target machine?
    Do you run LV 2010 and 2014 in parallel on the same machine for checking?
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • 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.

  • "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

  • 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,

  • Calling Dlls from LabVIEW

    LabVIEW Gurus:
    I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.  
    Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
    The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
    So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
    Thank you,
    Santiago 

    That example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
    You have 2 things to consider:
    You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
    You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means.

  • I am facing call drop problem (incoming

    I am facing call drop problem in my I phone 5 since morning today, Outgoing & incoming both.
    However i switched off the handset & also pull out SIM from the Handset, again insert & reset the functions but it's stilll not working.
    Please help.

    Hi there Kuldeep Mishra,
    You may find the troubleshooting steps in the article below helpful.
    iPhone: Troubleshooting issues making or receiving calls
    https://support.apple.com/kb/TS3406
    -Griff W. 

  • 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

Maybe you are looking for

  • Dedicated client opening in read only mode

    Hi This is my dedicated client and yes this is the fresh installation .I have only applied 8.1..1.9 patches on my dedicated client for open ui. I did not apply any QF for this .I have already checked the logs but it is still showing in read only mode

  • COND_A01 IDOC

    Hello, I am trying to Load pricing conditions into VB23 using the IDOC COND_A01. It is working fine when I try to create a new record but when I tried to modify the dates on an existing record it is creating an additional entry in table Axxx, which i

  • Create delivery in subcontracting - Essential transfer parameters missing

    Hi Guys, This is my first thread - I hope I get everything right From ME2O, stock monitoring for Vendor (subcontracting), I want to create a delivery to the vendor. After checking a material with a requirement and pressing "Create delivery" I get a b

  • Questions to a moderator: How to enable true Dolby Digital So

    Hallo,I wish to ask you directly, because I find no answers in all forums. That?s clear how to enable CMMS, but is it necessary to activate CMMS for using Dolby Digital Sound with 5. speakers? Because my Soundblaster Audigy 2 ZS has no Dolby Digital

  • How to create User defined templates

    Hi all, I want to create user defined templates for pages and regions and how to create form templates and report templates. pls help me. thanks mani