Debug gives non-exect.,Call Library Function: no library specified error?

I have installed the VISA 2.6 as mentioned in order to be able to see the VIs for my TDS5104 scope. The VIs are still not exectuable because of this library function call. I have followed all instructions pertaining to the labview add on, etc. I have the tektronix drivers installed. How do I fix this error so that I can actually program my specific solution?

Hi,
I looked for the instruments driver at www.ni.com/idnet and found NI Instrument Drivers Network: TDS 5054 Multi-Environment Plug and Play Instrument Driver for the instrument. This driver is developed by Tektronix.
I don't have the driver available, but it is most likely that the Library node VIs can not find the dll. Go to the VIs that are not executable, right click on the library call node and select configure. Note the path and the name of the dll the node is configured to use. You can then look for the dll in your system. You have 2 options: change the path in the node to point at the location of the dll or copy the dll to the location the node is expecting to find it. Any of
those should make the node executable.
Hope this helps.
DiegoF
National InstrumentsMessage Edited by Molly K on 02-18-2005 11:02 PM

Similar Messages

  • Call Library node error [1]

    Hi,
    I've written a program to control the angular position by using PID control algorithm.
    The program works fine but after certain amount of time. The system hanged and need to shut down the LabVIEW and restart.
    The warning message pop up is showing in the attached file.
    One more question, is it the PCI-6221 M-series card can used for real-time application.
    Just for your information, I'm using:
    - LabVIEW 7.1
    - PCI-6035E
    The program is attached to the message "Call Library node error [2]"
    Thanks.
    Best regards,
    IANES
    Attachments:
    Error11.bmp ‏405 KB

    Hi,
    It would be very helpful if you could post the code you are using to generate this error. These call library errors can be caused by many things.
    Check out the following KnowledgeBases:
    http://digital.ni.com/public.nsf/websearch/0120D13​E4B4C94BB86256A3F007695EE?OpenDocument
    http://digital.ni.com/public.nsf/websearch/58596F5​D41CE8EFB862562AF0074E04C?OpenDocument
    -Sal

  • Unable to debug an exit in CALL CUSTOMER FUNCTION 003

    Hi Guys,
    I have an exit EXIT_SAPMV45A_003 that is called by CALL CUSTOMER FUNCTION 003. I had placed a break point at
    CALL CUSTOMER FUNCTION 003 and the debugger stops here but i am unable to debug inside this to reach into
    the code in EXIT_SAPMV45A_003 even after setting the system debugging on & Update debugging
    ON.
    Can someone help me with this?
    thanks
    Dan

    You have to include that Enhancement of that exit in the Project and Activate that project in the CMOD.
    The Enhancement for the exit EXIT_SAPMV45A_003 is V45A0003.
    Create a project in CMOD
    And inclue V45A0003 in the project.
    Activate the Project.
    Now, it will stop at break point.
    Regards,
    Naimesh Patel

  • HDF5 Call Library fails sometimes

    Dear Labview Forum,
    i am currently working on a Project which saves its data to HDF5 file format.
    (TDMs is no option for me).
    i am using the c-dll of HDF5 via Call Library Function node.
    Basically everthing works fine, but sometimes the library calls fail. i am not able to say when and why.
    the only thing i know is that when it doesen't work it never works until i restart the Labview IDE.
    if it works, it works until i restart my IDE, and sometimes after the restart i get only -1 as returns.
    i attached a little project to show the error.
    to reproduce the error someone has to restart the whole IDE and delete the created files until the error occurs.
    Create Group and Create File works always. The errors occur from Create plist and ongoing calls.
    if one of the failning sub vis front panel is openend and manually started by pressing the run button it all time works nice.
    i tried to relaod the called vis for each call  -- same errors
    i compiled the vis to an exe -- same errors
     thank you for your help.
    Attachments:
    HDF5_error.zip ‏999 KB

    The symptoms you describe would hint in the direction of uninitilized output buffers to those function calls. I haven't looked at the HDF5 API in a long time, so don't know the details anymore how this API works nor what data types it accepts. But it pretty surely will comply with standard C programming notions, which means when you call a function that writes information into some buffer, you have to make sure those buffers are properly preallocated before calling the function. One or more bytes to little can often work for quite some time, and suddenly crash, cause exceptions or cause computation errors.
    Why it suddenly misbehaves at some point can be very random. Your mentionening that opened front panels seem to make it always work are an additional hint in this direction. They increase the memory foot print of your LabVIEW program and make it more likely that a buffer overrun won't immediately fail, though given an application that runs long enough it will at some point fail in some way too. There is nothing LabVIEW can do to prevent these buffer overruns other than trying to detect them and throwing an exception (indicated by an error in the Call Library Node error cluster). Depending on your CLN debugging level, this is done rather stringent, casually or not at all.
    If your API only returns it's information in simple arrays then you can make it work with direct Call Library Node calls but need to be very wary about any output buffers those functions require. If however your API requires complex datatypes (structures with arrays and more liek this) then trying to get this done without a wrapper DLL is mostly an exercise in vain. The knowledge about how a C compiler lays out memory for such datatypes, which is required to be able to do that, is a lot more complicated than just writing a C DLL. So you make the problem in fact more complicated and sometimes basically impossible by trying to avoid the wrapper DLL.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can call a function a few times in reports

    Hi
    Please help me to solve this problem:
    I have a function taking parameters and return a number, I tried
    2 ways to call this function but get same error saying the
    function may not be used in SQL:
    1. the function is in a package, and I use the pl/sql query
    (build from data model) to call it a few times by passing
    different parameters, I get error when compile the query
    2. the function is outside the package, and is called from
    another function in the package a few times, get error when
    compile the package body.
    3. by the way is weekly typed ref cursor allowed in reports?
    Below is part of my code:
    case 1:
    create or replace package perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE curType IS REF CURSOR;
    function diemSum (
    party_id IN NUMBER,
    partytype IN NUMBER,
    fid IN NUMBER,
    freeday_type IN VARCHAR2,
    startdays IN NUMBER,
    enddays IN NUMBER)
    RETURN NUMBER;
    END;
    CREATE OR REPLACE PACKAGE BODY perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    function diemSum (
    party_id IN NUMBER,
    partytype IN NUMBER,
    fid IN NUMBER,
    freeday_type IN VARCHAR2,
    startdays IN NUMBER,
    enddays IN NUMBER)
    RETURN NUMBER IS
    pdSum NUMBER(10);
    BEGIN
    IF partytype = 1 THEN
    IF freeday_type = 'gateout' THEN
    SELECT COUNT(*) INTO pdsum
    FROM equipment e,
    equipmenttrip et,
    facilitysegment s
    WHERE s.facilityid =fid
    AND et.lastfreeday between startdays AND enddays
    AND et.carrierpartyid =party_id;
    ELSIF freeday_type = 'strip' THEN
    SELECT COUNT(*) INTO pdsum
    FROM equipment e,
    END IF;
    ELSIF partytype = 3 THEN
    IF freeday_type = 'gateout' THEN
    SELECT COUNT(*) INTO pdsum
    FROM ...
    ELSIF freeday_type = 'strip' THEN
    SELECT COUNT(*) INTO pdsum
    FROM facility f,
    END IF;
    END IF;
    RETURN pdsum;
    END diemSum;
    END;
    /////////// pl/sql query//////////////
    function diemDet return perDiem.curType is
    sum_cv perDiem.curType;
         party_code VARCHAR2(20);     
              freeday_type VARCHAR2(20);
    begin
    party_code := :partycode;
              freeday_type := :freeday;
              OPEN sum_cv FOR SELECT      f.facilitycode,
                   perDiem.diemSum(p.partyid,
    p.partytypeid, f.facilityid, freeday_type, 1, 4 ) as days1,
              perDiem.diemSum(p.partyid, p.partytypeid,
    f.facilityid, freeday_type, 5, 10 ) as days2,
              perDiem.diemSum(p.partyid, p.partytypeid,
    f.facilityid, freeday_type, 11, 10000 ) as days3
              FROM equipmenttrip et,
                   facility f,
                   facilitysegment s,
                   party p
         WHERE f.facilityid = s.facilityid
              AND p.partycode = party_code ;
         RETURN sum_cv ;
    end;
    case 2 *** diemSum is a seperate function from package
    create or replace package perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE curType IS REF CURSOR;
    function diemDet (
    party_code IN VARCHAR2,
    freeday_type IN VARCHAR2)
    RETURN curType;
    END;
    CREATE OR REPLACE PACKAGE BODY perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    function diemDet (
    party_code IN VARCHAR2,
    freeday_type IN VARCHAR2)
    RETURN curType IS
    sum_cv curType;
    BEGIN
    OPEN sum_cv FOR SELECT f.facilitycode,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type, 1,
    4 ) as days1,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type, 5,
    10 ) as days2,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type,
    11, 10000 ) as days3
    FROM equipmenttrip et,
    facility f,
    facilitysegment s,
    party p
    WHERE ...
    RETURN sum_cv ;
    END diemDet;
    END;

    My bet would be that the function doesn't promise not to update
    the database. Therefor it can't be called from a select statment.
    To overcome this you need to define a pragma. I don't remember
    its exact name but I think it is restricted_reference.

  • How can I debug the Call Library Function at run-time

    I've written a VI using the CLF to call a DLL which was compiled off-site by another engineer using MSVC. Even though the VI runs without flagging any errors, the VI is not doing what I expect. Is there any way of finding out if the DLL is been called correctly? The first function that is called doesn't return any value, but I think that it should. Does this mean that the DLL is not being called correctly? Note also that the DLL works fine with a JAVA GUI.

    Make sure that you are specifying the proper function prototype in the call library function. If you are slightly off the call will not work properly. Ask the offsite engineer to provide you with this data. Another tip is to build the dll with the option to show front panel when called. You can actually popup the dll like you would a subvi. If you design it with test indicators showing on the front panel that is a great way to determine if it is working. Hope this helps.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • PDA: Calling library functions - seems to link the stubbed .cpp file instead of the DLL

    I'm having trouble developing a Lab View PDA module that calls a DLL built using Visual C++. The DLL functions correctly when called in a non-PDA VI. My issues seem to be with porting to the PDA.
    My configuration:
    - Lab View 8.5 with the PDA 8.5 module
    - Visual Studio 8.0 with the Windows Mobile 6.0 SDK
    - ASUS 626 PDA with an Intel PXA70 procesor running Windows Mobile 6 Classic
    Following the PPCBatt example code provided with the PDA module, I have:
    - used extern "C" to prevent name mangling
    - placed the DLL built with the Windows Mobile SDK in the \Windows directory on the PDA
    - created a stub Win32 DLL and lib
    - created a stubbed cpp file whose functions only return zero
    - included the stubbed cpp and lib files in the build spec / source files / additional files
    - placed Call Library Function nodes on my PDA VI, selected the function names, set the parameter types
    - built and deployed the executable, both with and without debug
    When I set the library path property of the Call Library Node, the functions appeared in the function name pulldown, but the parameters did not populate. I had to manually add them and set their types. The help page says they would autopopulate when the function was selected.
    I've debugged the VI, and the Library Function Call nodes are being called. It seems the build is linking the code from the stub C file provided in the additional files portion of the source files property page, instead of adding hooks to call the DLL on the PDA. As a test, I changed an output parameter in one of the functions in the stubbed cpp file - the changed value showed in the front panel indicator.
    What am I doing wrong?
    Dan

    Hi Dan,
    I'm not sure if I understood you problem fully. When calling external code with LabVIEW PDA, the DLL acts as a stub DLL with the correct function prototypes for the C code that you want to call. Here's a Knowledge Base article that might help explain about calling External Code in LabVIEW PDA.
    Regards,
    Stanley Hu
    National Instruments
    Applications Engineering
    http://www.ni.com/support

  • Window doesn't close wheh Call Library Function Node set to Run in Any Thread

    This is a problem regarding Call Library Function Nodes running in the UI thread or any thread.
    I have a camera which has its own API supplied as a dll. I have created a set of VI wrappers which each call a function in the dll through a Call Library Function Node.
    Initially each CLFN was set to 'Run in the UI thread' (the default).
    To start the camera streaming images I call (through a CLFN)
    ICubeSDK_Start(int CamIndex, Hwnd, ImgHandle, bool Preview, bool callback);
    If Preview = True then the image is displayed in a preview window.
    If ImgHandle = NULL a default preview window
    is used.
    In the CLFN definition I define:
    ImgHandle as a U32
    Preview as a I32
    To stop the camera streaming images I call
        ICubeSDK_Stop(int CamIndex)
    In the actual implementation I set ImgHandle = 0 (NULL) and Preview = 1 (true).
    This all works fine, and a preview window is opened and images displayed. When I call ICubeSDK_Stop the preview window is closed.
    However, I would prefer to set the CLFN to 'Run in any thread' because
    a) when run in the UI thread the preview window randomly gets sent to the back when I switch focus between open VI windows (presumably because it is in the same thread as the VIs)
    b) I don't want to put unnecessary stuff in the UI thread
    c) my (naive?) understanding is that it is safer to run in any thread
    So I have set all CLFNs to 'Run in any thread'
    When I do this the preview window opens OK, and behaves like any other non LabVIEW controlled window in terms of focus. But when I call ICubeSDK_Stop() the preview window does not get closed properly, it just shows a blank image. I can't close it manually, there is no X in the corner and no option to close it from the taskbar. To get rid of it I have to close the LabVIEW project it is spawned from, which often results in a crash. It does appear as a separate item in task manager but if I 'end process' it, LabVIEW closes (and often crashes) as well.
    If I change only the CLFNs that call the Start and Stop functions back to 'Run in the UI thread' then it all works fine again, except that the preview window gets sent to the back randomly as before.
    So, what do I have to do to get the preview window to close properly if I set the CLFN to 'Run in any thread'.
    Alternatively, is there a way to close the window programmatically (ie force it to close) after I have called ICube_Stop.
    Thanks
    DAve

    Hi Dave,
    The "Run In UI Thread"  switches from the thread the VIs currently executing in to the user interface thread. If you select "Run in Any Thread", the Call Library Function Node continues in the currently executing thread. By default, all Call Library Function Nodes run in the User Interface thread.
    Before you configure the Call Library Function Node to run in any thread, you have to make sure that the code is thread safe. Code is thread safe when it does not store any global data (e.g. global variables, files on disks, etc.), does not access any hardware, does not make calls to any functions, libraries or drivers that are not thread safe.
    Unfortunately, since you said that your DLL accesses hardware, it is not recommended to use "Run in Any Thread." This is probably why you are seeing the crash.
    If your preview window gets sent to the back you can programmatically bring it forward. Here is an example of how this can be done: http://decibel.ni.com/content/docs/DOC-4551
    If you want to completely close the window down you can do so as described in this link: http://digital.ni.com/public.nsf/allkb/81E9C144190​0FFCE8625748F0055DBB0?OpenDocument
    I also thought you might find this useful: http://zone.ni.com/devzone/cda/tut/p/id/3009
    I hope this helps.
    Regards,
    Mahdieh G
    Applications Engineer
    National Instruments UK&Ireland

  • How to use Call library function node for a function in dll with VOID data type

    Hi All,
    I would like to ask for your kind help,
    I am facing an issue with the call library node.
    I have a C++ function(stdcall), which has void as data type
    error code XXXX(hwnd, lID, getValue, *void data1, *void data2)
    the data1 and data2 types are always changing depending upoin the value of "getValue".
    Primarily i can use call library node multiple times and adapt each node according to the data types of data1 and data2, and extract the values and use in the code. Here is no issue. Real question is:
    My question:
    How can i just use one time call library node and make a case depending upon the "getvalue", which will control the data type of data1 and data2. Here i really looking for solutions.
    My trials:
    i used varaints as input to the call libray node for data1 and data2, and selected Parameters in call libraby node as " Adapt to type". here labview just crashed.
    i really appreciate your feedbackand suggestions.
    Thanks
    Kutbuddin
    Solved!
    Go to Solution.
    Attachments:
    Clipboard02.jpg ‏103 KB

    A variant is a very specific LabVIEW datatype (really a C++ type object internally) and trying to pass that to a function, which excepts a flat memory pointer there, for sure will crash very quickly.
    As to endianess, yes Unflatten will be able to adjust for endianess, which in this case however is most likely exectly NOT what you want. So make sure that the you select native type for the endianess input on Unflatten from String. LabVIEW internally works with whatever is the native endianess, as will most likely your C++ DLL. The platform independent big endian format does only come into play when you receive data streams over some streaming interface like a network connection. Here it is desirable to use an endian format that is independent from the actual platform that generates and consumes the data stream. LabVIEWs default endianes is big endian here.
    But as long as you pass data directly to native components like DLLs there is no difference in endianess between what LabVIEW uses and what those components use.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Call library function node with array of clusters using array data pointer

    Hello all.
    I am writing a LabVIEW wrapper for an existing DLL function.
    The function has, as one of its parameters, an array of structs.  The struct is very simple, containing two integers.  I am using the call library function node to access it.
    In Labview I created an array of clusters, where the cluster has two 32-bit integers as its members.  So far, so good.
    Now I have to pass this in to the Call Library Function Node.  Here I am running into trouble.
    I have used The topic in LAVA and The topic in the knowledge base as my primary sources of information, though I have read a bunch of forum topics on the subject too.
    I do understand that I could write a new function which takes as a parameter a struct with the size as the first member and an array as the second, and I might just do this and have it call the regular function, but I was hoping to do it more simply.
    According to the C file which LabVIEW generates for me from the CLFN when I choose "Adapt to Type" and "Array Data Pointer", the prototype it is expecting is:
    int32_t myFunc(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    And the prototype of the function in my DLL is
    int borland_dll myFunc(DWORD handle, usint channel,
    int FIFOnumber, struct mStruct *data, int numWords, int *actualLoaded, int *actualStartIndex);
    This looks like a match to me, but it doesn't work (I get garbage in data).  From the topic in LAVA referenced above, I understood that it would work.  It does not.
    If I cast data to the pointer-to-pointer I get when I generate c code by wiring my struct to a CIN and generating, then I seem to get what I expect. But this seems to work when I choose "pointers to handles" too, and I would expect array data pointer to give a different result.
    Is there any way to get this to work directly, or will I have to create a wrapper?  (I am currently using LabVIEW 2011, but we have customers using 2009 and 2012, if not other versions as well).
    Thank you.
    Batya
    Solved!
    Go to Solution.

    OK, here is more detailed information.
    I have attached the VI.
    This is the code from the  "C" file created by right-clicking the CLN and creating a "C" file. 
    When the parameter in the CLN is set to "array data pointer":
    /* Call Library source file */
    #include "extcode.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is "pointers to handles":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is set to "handles by value":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
    As to the DLL function, it is a bit more complicated than I explained above, in the current case.  My VI calls the function by this name in one DLL, and that DLL loads a DLL and calls a function (with the same name) in the second DLL, which does the work. (Thanks Rolfk, for helping me with that one some time back!)
    Here is the code in the first ("dispatcher") DLL:
    int borland_dll Load_Transmit_FIFO_RTx(DWORD handle, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex)
    t_DispatchTable *pDispatchTable = (t_DispatchTable *) handle;
    int retStat = 0;
    retStat = mCheckDispatchTable(pDispatchTable);
    if (retStat < 0)
    return retStat;
    if (pDispatchTable->pLoad_Transmit_FIFO_RTx == NULL)
    return edispatchercantfindfunction;
    return pDispatchTable->pLoad_Transmit_FIFO_RTx(pDispatchT​able->handlertx, channel, FIFOnumber, data, numWords, actualLoaded, actualStartIndex);
    borland_dll is just "__declspec(dllexport)"
    The current code in the DLL that does the work is:
    // TEMP
    typedef struct {
    int control;
    int data;
    } TD2;
    typedef struct {
    int dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    // END TEMP
    int borland_dll Load_Transmit_FIFO_RTx(int handlertx, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex){
    struct TRANSMIT_FIFO *ptxFIFO; //pointer to transmit FIFO structure
    usint *pFIFOlist; //pointer to array of FIFO pointers to FIFO structures
    int FIFOentry, numLoaded;
    usint *lclData;
    usint nextEntryToTransmit;
    // TEMP
    FILE *pFile;
    int i;
    TD1** ppTD = (TD1**) data;
    TD1 *pTD = *ppTD;
    pFile = fopen("LoadFIFOLog.txt", "w");
    fprintf(pFile, "Starting Load FIFO with %d data words, data pointer 0x%x, with the following data&colon; \n", numWords, data);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, data[i].control, data[i].data);
    fflush(pFile);
    fprintf(pFile, "OK, using CIN generated structures: dimSize %d, with the following data&colon; \n", pTD->dimSize);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, pTD->data[i].control, pTD->data[i].data);
    fflush(pFile);
    // END TEMP
    if ((handlertx) <0 || (handlertx >= NUMCARDS)) return ebadhandle;
    if (cardrtx[handlertx].allocated != 1) return ebadhandle;
    pFIFOlist = (usint *) (cardrtx[handlertx].segaddr + cardrtx[handlertx].glob->dpchn[channel].tr_stk_ptr​);
    pFIFOlist += FIFOnumber;
    ptxFIFO = (struct TRANSMIT_FIFO *)(cardrtx[handlertx].segaddr + *pFIFOlist);
    //use local copy of ptxFIFO->nextEntryToTransmit to simplify algorithm
    nextEntryToTransmit = ptxFIFO->nextEntryToTransmit;
    //on entering this routine nextEntryToLoad is set to the entry following the last entry loaded
    //this is what we need to load now unless it's at the end of the FIFO in which case we need to wrap around
    if ( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries)
    *actualStartIndex = 0;
    else
    *actualStartIndex = ptxFIFO->nextEntryToLoad;
    //if nextEntryToLoad points to the last entry in the FIFO and nextEntryToTransmit points to the first, the FIFO is full
    //also if nextEntryToLoad == nextEntryToTransmit the FIFO is full and we exit without loading anything
    if (( (( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ( ptxFIFO->nextEntryToLoad == nextEntryToTransmit)) && (ptxFIFO->nextEntryToLoad != INITIAL_ENTRY)){
    *actualLoaded = 0; //FIFO is full already, we can't add anything
    return 0; //this is not a failure, we just have nothing to do, this is indicated in actualLoaded
    numLoaded = 0;
    lclData = (usint *)data; //must use 16 bit writes to the module
    //conditions are dealt with inside the for loop rather than in the for statement itself
    for (FIFOentry = *actualStartIndex; ; FIFOentry++) {
    //if we reached the end of the FIFO
    //if the module is about to transmit the first element of the FIFO, the FIFO is full and we're done
    //OR if the module is about to transmit the element we're about to fill in, we're done - the
    //exception is if this is the first element we're filling in which means the FIFO is empty
    if ((( FIFOentry >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ((FIFOentry == nextEntryToTransmit) && (FIFOentry != *actualStartIndex) )){
    *actualLoaded = numLoaded;
    //set nextEntryToLoad to the end of the FIFO, we'll set it to the beginning next time
    //this allows us to distinguish between full and empty: nextEntryToLoad == nextEntryToTransmit means empty
    ptxFIFO->nextEntryToLoad = FIFOentry;
    return 0;
    //we reached the end but can continue loading from the top of the FIFO
    if ( FIFOentry >= ptxFIFO->numEntries)
    FIFOentry = 0;
    //load the control word
    ptxFIFO->FifoData[FIFOentry * 3] = *lclData++;
    //skip the high of the control word, the module only has a 16 bit field for control
    lclData++;
    //now put in the data
    ptxFIFO->FifoData[(FIFOentry * 3) + 2] = *lclData++;
    ptxFIFO->FifoData[(FIFOentry * 3) + 1] = *lclData++;
    numLoaded++;
    //we're done because we loaded everything the user asked for
    if (numLoaded >= numWords) {
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry+1;
    return 0;
    //if we reached here, we're done because the FIFO is full
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry;
    fclose (pFile);
    return 0;
     As you can see, I added a temporary diagnostic with the structures that were created in the "Handles by value" case, and print out the data.  I see what is expected, whichever of the options I pick in the CLN!  
    I understood (from the information in the two links I mentioned in my original post, and from the name of the option itself) that "array data pointer" should pass the array of data itself, without the dimSize field.  But that does not seem to be what is happening.
    Batya
    Attachments:
    ExcM4k Load Transmit FIFO.vi ‏15 KB

  • How to implement a callback function using LabView's Call Library Function Node?

    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    The SDK.h deacribes the function as:
    //  Function:   SdkSetPropertyEventHandler
    SdkError SDKAPI SdkSetPropertyEventHandler(
                SdkCameraRef                    inCameraRef,
                SdkPropertyEvent                inEvnet,          
                SdkPropertyEventHandler         inPropertyEventHandler,
                SdkVoid*                        inContext );
    //  Description:
    //       Registers a callback function for receiving status
    //          change notification events for property states on a camera.
    //  Parameters:
    //       In:    inCameraRef - Designate the camera object.
    //              inEvent - Designate one or all events to be supplemented.
    //              inPropertyEventHandler - Designate the pointer to the callback
    //                      function for receiving property-related camera events.
    //              inContext - Designate application information to be passed by
    //                      means of the callback function. Any data needed for
    //                      your application can be passed.
    //      Out:    None
    //  Returns:    Any of the sdk errors.
    A separate header file called SDKTypes.h contains the following data:
    typedef  SdkUInt32  SdkPropertyEvent;
    typedef  SdkUInt32  SdkPropertyID;
    typedef  void       SdkVoid;
    typedef  struct __SdkObject*    SdkBaseRef;
    typedef  SdkBaseRef    SdkCameraRef;
     SdkPropertyEventHandler
    typedef SdkError ( SDKCALLBACK *SdkPropertyEventHandler )(
                        SdkPropertyEvent        inEvent,
                        SdkPropertyID           inPropertyID,
                        SdkUInt32               inParam,
                        SdkVoid *               inContext );
    Thanks for your help.
    Alejandro
    Solved!
    Go to Solution.

    alejandroandreatta wrote:
    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    Basically you do not do that. LabVIEW does not know pointers and certainly not function pointers. What you should do instead is writing a C DLL that implements the callback and also exports a function to be called by LabVIEW that translates between the callback and a LabVIEW user event. Look for PostLVUserEvent() here on the NI site to find examples how to do that.
    Rolf Kalbermatter
    Message Edited by rolfk on 02-11-2009 08:00 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Strange problem of calling library function node in labview 2010 and 2011

    one year ago,I develop a program to usb device data and it works well,in labview 8.6 or 2009(win xp).Recently, When I test
    the program in labview 2010 and labview 2011(win xp).,the program always crash immediately.I check the program and find main
    problem is in call library function node. In my program,I use labview 2009 library for the USBExpress driver for
    Silicon Labs USB MCU's from:https://decibel.ni.com/content/docs/DOC-9522,for example, 2 functions SI_OPEN and SI_READ
    can not work well.
    the header definition of SI_OPEN and SI_READ is:
    SI_STATUS WINAPI SI_Open(
    DWORD dwDevice,
    HANDLE* cyHandle
    SI_STATUS WINAPI SI_Read(
    HANDLE cyHandle,
    LPVOID lpBuffer,
    DWORD dwBytesToRead,
    LPDWORD lpdwBytesReturned,
    OVERLAPPED* o = NULL
    the SI_STATUS is equivalent to int type.
    orignally, for HANDLE * in SI_Open, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass pointer to value.
    for HANDLE in SI_Read, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass value.The program works well in labview 8.6&2009,however,crash in labview 2010 &2011.
    later,I debug the program, for HANDLE *, I choose parameter type in call library function node as adapt to type, data format is point to Handles.for HANDLE, I choose parameter type in call library function node as adapt to type, data format is Handles by Value.Crash not happend in labview 2010&2011,however,it cannot read any data from from USB device correctly as before.I can not find the reason.
    Dear friends,I need your help to answer the problem. Thank you.

    Based on the help page it looks like it should execute asynchronously.
    The thing in the description that leads me to believe they execute asynchronously is that you can configure the library to run as a multi-threaded operation.
    Please take a look here to see the difference between synchronous and asynchronous execution.
    Since the code even has the ability to be multi-threaded, you can consider it as running in parallel to your other code.
    Any data returned is passed to the thread that called that function.
    Cory K

  • Call multiple functions from same dll with call library function

    hi,
    i am working on a project in wich we need to make a UI to read out a sensor network.
    the UI should be usable in any project, but every node needs a different piece of code depending on the type of sensor with wich it is equipt.
    so i need to be able to call different pieces of code when i need them, and still be able to use the UI in future projects with possibly new types of node we now don't have.
    so someone told me to use DLL's, cause then i would be able to call the code i need the moment i need it.
    but i have never worked with DLL's (just learned about this option 3 day's ago) so i have a question.
    i know i can dynamicly change the DLL i call with the call library function, but can i dynamicly change the function i call from that DLL ?
    or do i have to put a new call library function for each function i want to call, even if its from the same DLL ?
    kind regards,
    stijn

    nazarim wrote:
    ok so there is no (easy and ubderstandable) way for me to dynamicly change wich function i want to call from a certain DLL.
    but now i started wondering, the path on the call library function is not ment to dynamicly change a DLL
    but it does work so, if i am carefull, can i use it for that purpose or will labview give me a series of problems once i start using it in larger programs ?
    Thepath on the Call Library Node can be used to load a different DLL. Obviously since you can't change the function name your other DLL would have to export exactly the same function name and of course with the same parameters. This is seldom the case so it is not the main use of the path input to the Call Library Node. It's main use is as indicated to load DLLs at runtime rather than at load time of a VI. So that an application can run even when the DLL is missing, until the moment the functionality from that DLL is needed.
    If you can make sure that all your DLLs export the same function name with the same parameter you can use the Call Library Node to call into different DLLs through the path input. If however you would need to call different function names you would have to resolve to some DLL which does do the dispatching and invocation using LoadLibrary() and GetProcAddress(). But unless you need to go with DLLs for some reason using the Call By Reference Node can give you an even more flexible approach. 
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • The call library function require us to define the type of parameter that w are using.The type of parameter in cludes numeric, array, string,wav​eform and adapt to type.I would like to know more about waveform and adapt to type.

    In the labview manual, there is very little mention about the use of waveform.How is this waveform being called and can i have an example to see how this work.
    Also in the adapt to type paramete, what does this parameter do and in what circumstances do we need to use it.The manual say something about the use of this parametr.It says that scalar elements in arrays or clusters are in line.For example a cluster containing anumeric is passed as pointer to a structure containing a numeric. What does this statement mean?
    Can i imply t
    hat if my input is a struct, can i use a adapt to type parameter to overcome this incompatibility?Can i also have an example to let me have a better idea.thank you

    I'm going to share my experience with the "Adapt to Type" parameter.
    Attached to this message is an example. The attachment is a zip file with three files: a dll, a c file and a vi written in LabVIEW 6. The dll contains a function that return a structure with 3 values (like the coordinates of a point in space, that is, (x, y, z)). You can see how the function was constructed by looking at the c file.
    In LabVIEW, I created a cluster with the same three parameters. Then, I configured the call library function following the function prototype as in the c file. For the point variable I use "Adapt to Type".
    I hope this can give you a head star.
    Best regards;
    E. Vargas
    www.vartortech.com
    Attachments:
    pointexample.zip ‏63 KB

  • Passing array to call library function running on VxWorks (cRIO)

    Hello,
    I am using a cRIO 9012 running VxWorks.
    I have a Call library function VI in my application and I want to pass arrays of doubles to this function.
    The problem is that I can not access the values in the array.
    Here is the source code of my function:
    #include "D:\\Programme\\National Instruments\\LabVIEW 8.5\\cintools\\extcode.h"
    double avg_num(double *in1, double *out1)
        double ret;
        ret = in1[0] + out1[0];
        return ret;
    The value of in1[0] and out1[0] is always.
    When passing no arrays but single values, all is fine. But since my application is more complex than this example, I need to pass arrays.
    The block diagram and parameter specification is as shown in the attached screenshots.
    I am compiling the source code with the Gcc 6.3 which is available here:
    http://zone.ni.com/devzone/cda/tut/p/id/5694
    What am I doing wrong?
    Or is passing arrays not supported on cRIO?
    Maybe the makefile needs to be modified?
    Thank you.
    Best regards,
    Christian
    Attachments:
    vi.JPG ‏88 KB
    parameter.JPG ‏41 KB

    I guess I have solved the problem.
    The key was to set the parameter "Minimum size" for all function parameters to <None>.
    Having this, I can read the passed arrays. I do not know why this works but at the moment, it is ok for me.
    Thank you all.

Maybe you are looking for

  • Error when determining a number from object BI_TSDTEL and number 01

    Hi BW Experts, After Transporting Infosources (Master & Transaction) to BW QA, the transfer rules were not getting activated in QA. The following error message was diaplyed. "Error when determining a number from object BI_TSDTEL and number 01 Object

  • Replaced hard drive, now can't boot from install disc to restore backup

    Yesterday, my hard drive died (disk warrior informed me, that HD had irrecoverable errors, and my iMac would shut down unless it was booted from the Disk Warriorr disc). Today, I have a new internal HD professionally installed. And when I brought it

  • SPA 525G[2]: monitor mjpeg video RTSP , remove PATH constraint

    Having read the forum's guide on the topic , https://supportforums.cisco.com/docs/DOC-9806 , and related errata it's clear the phone can render MJPEG via RTSP.  The defect is the expectation of a needlessly specific URI PATH rtsp://10.20.30.40/img/jp

  • Encoding issue in jsp

    Hi All, I have an application where in i have an add and edit option ,when i add/edit an euro symbol it appears as "â?¬267" instead of "€267". my jsp encoding is as follows: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding

  • Blocks in standalone applications which can be double clicked for changing parameters

    Can we have blocks in standalone applications which can be double clicked for changing parameters. something like an options/configure button which opens another window and helps us to change tha parameters  of that particular block.