DLL function called change of entry

Hello world

I know that it is very basic; but I am not by my own. I am very new to LabVIEW and was not able to find a solution in the forum.

I want to call a function in a DLL, every time when I press a button; but unfortunately, the function is called only when starting.

So, how can I call a DLL function on a change of some of the entries?

I have attached a screenshot. I tried the stuff. It did not work. Now, the function is called twice during startup.

Thanks in advance and best regards,

Chris

If you want to call anything with a button, use a structure of the event with a value change event.

I would recommend that you take one of the free LabVIEW tutorials available on the site and see examples of delivery - help > find examples.

Tags: NI Software

Similar Questions

  • Error number: 0 x 80040707 Description: DLL function call crashed: BRADDPRT. CheckLocalPort.

    ... The installation program will end now. For some reason, I lost my printers. None appear as installed. When I try an installation, I get this message.

    I can try this if it happens again. I ended up doing a reboot of the system and things are finally back to normal. Thank you.

  • Error no 0 x 80040707 Description: DLL Function Call crashed: tools; Save the file

    I try to install the new utilities on my PC and get this error message. When I click OK I get a new message

    Install Script Setup Launcher has stopped working, Windows is checking for a solution.
    After reviewing this error I find none of the solutions presented work for this application. Can someone give me a solution for this. I'm frustrated by the latter.

    If anyone is interested, I finally solved this oner myself. The outage was caused by the security systems of windows itself and determination of corrupting the file to install. I solved it by removing all traces security essentials and any other security service on the PC, including the previous version of Fix - It. Having done via control panel uninstall and the register looking to be sure, I was able to install the software.

    This problem occurred on my PC did the same on both, both works now properly so the utility works fine in the background where other systems use resources.

    I try to install the new utilities on my PC and get this error message. When I click OK I get a new message

    Install Script Setup Launcher has stopped working, Windows is checking for a solution.
    After reviewing this error I find none of the solutions presented work for this application. Can someone give me a solution for this. I'm frustrated by the latter.
  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • When to call DSDisposeHandle when you have a DLL function acting as a dynamic data DS source extensible?

    Hello

    I have a dynamic function DLL acting as a data source within a LabVIEW application (see attachment) - I use DSNewHandle to dynamically allocate an array 2D handle storage via the Manager memory LV for arrays of arbitrary in application size data. I had assumed that these blocks of memory would be willing (Magic) when appropriate by the LabVIEW built in blocks that are sitting downstream, however, is not the case for treatment and the system LabVIEW memory usage continues to increase until you quit LabVIEW environment (not just if the offending application is stopped or closed).

    So my question is how and where to mop up the table used for buffers in the treatment of the application of the chain and how do I know when the buffers are really exhausted and not be re-used downstream (for instance two 2D paintings are first grouped into a 2D complex table by the re + im at the operator complex labview - is data memory out of this totally different stage of entries or is - a) modified version of the entry tables - if they are totally different and 2D to entry tables are not wired in all other blocks why the operator not have input data banks?)

    Maybe Im going to this topic in the wrong direction have the DLL data source dynamically allocates space data tables? Any advice would be welcome

    Concerning

    Steve

    So instead of doing:

    DLLEXPORT int32_t DataGetFloatDll(... , Array2DFloat ***p_samples_2d_i, ...)
    {
        ...
    
        if ( p_samples_2d_i )
        {        // *p_samples_2d_i can be non NULL, because of performance optimization where LabVIEW will pass in the same handle        // that you returned in a previous call from this function, unless some other LabVIEW diagram took ownership of the handle.        // Your C code can't really take ownership of the handle, it owns the handle for the duration of the function call and either        // has to pass it back or deallocate it (and if you deallocate it you better NULL out the handle before returning from the        // function or return a different newly allocated handle. A NULL handle for an array is valid and treated as empty array.
            *p_samples_2d_i = (Array2DFloat **) DSNewHandle( ( sizeof(int32_t) * 2 ) + ( sizeof(float) * channel_count * sample_count ) );
    
            // Generally you should first try to insert the data into the array before adjusting the size        // the most safe would be to adjust the size after filling in the data if the array gets bigger in respect to the passed in array        // and do the opposite if the adjusted handle happened to get smaller. This is only really important though if your C code can        // bail out of the code path because of error conditions between adjusting the handle size and adjusting the array sizes.        // You should definitely avoid to return from this function with the array dimensions indicating a bigger size than what the        // handle really is allocated for, which can happen if the array was resized to a smaller size and you then return because of errors        // before adjusting the dimension sizes in the array.         ........        (**p_samples_2d_i)->Rows = channel_count;
            (**p_samples_2d_i)->Columns = sample_count;
        }
    
        ...}
    

    You should do:

    DLLEXPORT int32_t DataGetFloatDll(... , Array2DFloat ***p_samples_2d_i, ...)
    {
        ...
        MgErr err = NumericArrayResize(fS /* array of singles */, 2 /* number of dims */, (UHandle*)p_samples_2d_i, channel_count * sample_count);
        if (!err)
        {        // Fill in the data somehow
           .....       
    
            // Adjust the dimension sizes        (**p_samples_2d_i)->Rows = channel_count;
            (**p_samples_2d_i)->Columns = sample_count;
        }
    
        ...}
    
  • Two parallel executions, calling a DLL function

    Hello

    Since this test takes about 6 hours to test my USE, I plan to use the parallel model to test 2 UUT at the same time in parallel.

    I implement the test code as a DLL of CVI.

    However, to my surprise, it seems that the steps that call a DLL function actually traveled in one series, not in parallel:

    Test 2 power outlets if one enters and executes a DLL works, the other waits for the first to complete its operation and return. While the other runs on the same copy of the DLL, so that the DLL global variables are actually shared between executions.

    So if a DLL will take 5 minutes to complete, two executions in the running at the same time take 10 minutes. This isn't a running in parallel in every way.

    What I want and expect also TestStand, was to completely isolate the copies of these two executions DLL such as test two casings could run at the same time the same DLL function by arbitrary executiong their copy of the function, completely isolated from one another.

    So they separated globals, discussions, etc., and two parallel jacks take 5 minutes to run a step, instead of 10.

    Such a scenario is possible?

    If not, how can I use my test in parallel (in truly parallel) when the use of 2-socket test?

    (1) Yes, he'll call the multiple executions in TestStand calling into the same dll in memory the same copy of this DLL. Thus dll called in this way must be thread-safe (that is written in a way that is safe for multiple threads running the code at the same time). This means usually avoiding the use of global variables among other things. Instead, you can store the thread shows in local variables within your sequence and pass it in the dll as a parameter as needed. Keep in mind all the DLLs your dll calls must also be thread-safe or you need to synchronize calls in other DLLs with locks or other synchronization primitives.

    1 (b) even if your dll are not thread-safe, you might still be able to get some benefits from parallel execution using the type of automatic planning step and split your sequence in independent sections, which can be performed in an order any. What it will do is allow you to run Test a socket A and B Test to another socket in parallel, and then once they are then perhaps test B will take place on one and test one run on the other. In this way, as long as each test is independent of the other you can safely run them in parallel at the same time even if it is not possible to run the same test in parallel at the same time (that is, if you can not run test on two Sockets at the same time, you might still be able to get an advantage of parallelism by running the Test B in one take during the tests in the other. See the online help for the type of step in autoscheduling for more details).

    (2) taken executions (and all executions of TestStand really) are threads separated within the same process. Since they are in the same process, the global variables in the dll are essentially shared between them. TestStand Station globals are also shared between them. TestStand Globals file, however, are not shared between runs (each run gets its own copy) unless you enable the setting in the movie file properties dialog box.

    (3) course, using index as a way to distinguish data access are perfectly valid. Just be careful that what each thread does not affect data that other threads have access. For example, if you have a global network with 2 elements, one for each grip test, you can use safely the decision-making of index in the table and in this way are not sharing data between threads even if you use a global variable, but the table should be made from the outset before start running threads , or it must be synchronized in some way, otherwise it is possible to have a thread tries to access the data, while the other thread is created. Basically, you need to make sure that if you use global data which the creation/deletion, modification and access in a thread does not affect the global data that the other thread use anyway in or we must protect these creation/deletion, modification and access to global data with locks, mutex or critical sections.

    Hope this helps,

    -Doug

  • Why the DLL function performed by call library node fails when the Vi is reopened?

    Development system

    OS: Windows XP

    LabVIEW: version 10.0

    DLL: Custom

    Compiler: Visual C++ 6.0

    Function prototype: __declspec (dllexport) const char * test (void)

    We have developed a DLL to use.  Compile the DLL itself.  The DLL includes a function test.  The test function validates the functional capabilities of the DLL.  I followed the examples online, and I used the tool to import shared library in LabVIEW.  The screw created use the call library node.

    When I create a VI by calling the function in the DLL test customized by using the call library node the VI runs the test DLL function flawlessly.  I close the VI.  When I re - open the VI and run it, I get an error code of the DLL.  However, if I go on the schema and define the path of the DLL in the library call Configuration node once again the VI then runs the test DLL function perfectly again.

    I have set the path of the DLL in the library call Configuration node everytime I open the VI.  The examples that I downloaded from the community don't require this.  What could be the missing DLL?  What Miss me?

    I solved the problem.

    I had create the DLL by using the following steps for VC 6.0:

    1. new project

    2. Select the Appwizard (DLL) MFC

    3. Select the regular DLLS using the MFC shared DLLS

    4 Yes for source file comments

    5 finishing

    The DLL must be on the VI search path.  The easiest way was to have the DLL in the same directory as the VI.

  • Pass the parameter to the functions called from a dll

    Hi all

    I am interfacing a motor controller for PMC - 100 through the Protocol of Performax using labwindows.

    I need to explicitly link the PerformaxCom.dll and call functions with him. I'm calling this function

    BOOL fnPerformaxComOpen (DWORD IN dwDeviceNum, OUT HANDLE * pHandle);

    Faithful:

    If you want to link explicitly, you can consult this article: http://zone.ni.com/devzone/cda/tut/p/id/8503

    It has a code snippet that shows passing two parameters to a DLL function.

    But as for your statement that "I don't know how to pass parameter to him", in the example, you reference, you pass a parameter: it's just a constant string rather than a variable.

  • How to call a dll from another dll functions

    Hi, can someone please tell me some examples or instructions on how you go about calling functions from a dll from another dll including the IUR. The two DLLs were created with labwindows cvi.

    Thank you!

    Hi Sinnas,

    You mention that you use a UIR.  A DLL does not have a file UIR as part of it.

    DLL1

    Instead, when you build the DLL first, we'll call it DLL1, you create a header or the files that contain functions that you want to the client code to call.  When you build DLL1, you must export the file DLL1 function for his client to call code header.  Whatever the calling code is (a GUI or another DLL), you must include in the exported DLL1 project headers AND DLL1 .lib file generated when you generate it.

    DLL2

    DLL2 will contain in its project, the header file exported for DLL1, DLL1 .lib file - that gives it the feature in DLL1.  The code can then call any desired DLL1, but as DLL1, you should now have a header file that exports the functions of DLL2 desired HIS client code to call.  When you build DLL2, you create a .lib for THAT DLL file to include in the code of the final customer.

    GUI

    The final customer code will be a few GUI that you create to call DLL2 functions will have the UIR upper layer file.  It will include the exported DLL2 header file and the file .lib DLL2 in his project.  It can then call any function of DLL2.  It is the most clean way to have 2 dll working together.

    NOTE: You can create a GUI to test the lower level DLL1 functions before placing DLL2 in the system.  In fact, it's a good idea to do it - you want to make sure your lower level DLL1 code works properly before construction above it.

    Simple diagram

    Client code (calls to functions of the DLL2 header files) exported

    --------------------------------------------------------------------------

    DLL2 (DLL1 function calls exported in header files)

    --------------------------------------------------------------------------

    DLL1<--------------------  you="" can="" also="" create="" a="" gui="" that="" only="" calls="" dll1="" exported="" header="" files="" to="" test="" out="">

    A suggestion... I create my dll in debug mode and use them to test my code.  But I also build as static libraries.  When I do the final version of the system, I use static libraries.  They are built with the final executable and don't require additional files to install as do the dll.  When you install your system with DLLs, you must include all THE dll and they must be installed in the folder Windows/System32 of the target computer.

    I hope this helps...

    Judy

  • Make sure that wire you all the inputs and outputs of your node library function call?

    This document says "make sure that wire you all the inputs and outputs of your node library function call.

    http://digital.NI.com/public.nsf/WebSearch/7253D2F0D91F68058625752F005AB672?OpenDocument&submitted&&...

    But all the terminals on the right side of the call library node considered "outputs" referred to in the foregoing statement?

    This same document continues to show the right way to allocate memory with this illustration and in the illustration, the right "outputs" are left without junctions.

    Am I right in assuming that the only terminals that count as outputs, those who use the code of the DLL (modify) as output?  If it is true, then all other terminals output associated with the values entered alone so don't really account as outputs, correct?

    In the parameter call-library configuration screen there is a "Constant" check box and the help that he wrote "indicates whether the parameter is a constant."  What is this box? for me in the setup of the DLL call

    Finally, assuming that a call from the DLL that is supposed to write in these five outputs, is it legitimate to use constants like this to book a space of memory for the output values?

    How about if local variables associated with the output terminals are used instead?

    Despite the linked document, it is necessary to connect the corresponding entry for simple scalar output parameters (for example a digital). LabVIEW automatically allocate memory for them. If you do not want the entries for all the output wire anyway, there should not be no difference between a constant and a local variable; I would use a constant to avoid useless local variables.

    For settings that are only entries, there is not need to connect the outlet side. It's a bit simplistic since all parameters are entered only and get one result (other than the return value), you pass a memory address and modify the content to this address, but LabVIEW manages this dereferencing pointer for you. If you want to really get into the details, learn more about pointers in C.

    The "Constant" check box acts as the qualifier "const" on a c function parameter. It tells the compiler that the function you are calling will not change this setting. If you call a function prototype includes a const parameter, then you must mark this as a constant parameter when you configure the call library function node. Otherwise, I wouldn't worry on this subject.

  • allocation of an array of 2d in labVIEW and move to the DLL function to obtain data

    Hi all!

    I searched a lot about this, but one cannot find any solution. Please find attached the vi that I try to get a unit of 32 channels data,

    100000 samples per channel with 14-bit resolution. And please also find enclosed the header for my dll file. (in the header, it is the GetBuffers function).

    There is not a lot of data, it is a little more then 6 MB in the task of LAbVIEW Manager eats about 30 MB more memory, then it should. Are there explanations why?

    Because there is much more data in a single channel (million samples or more)

    Then I will try to allocate a 2D to data array, but when I try to run my LabVIEW vi crashes.

    Could you please help?

    Best regards

    Tomzi

    Dear Tomzi!

    To allocate the data in a table in LabVIEW, you must always initialize, as in a you must have a valid entry on cell (x-, y - 1) have a size of table of (x, y). It is usually best to use the function Array initialized for this purpose.

    There are ways to pass arrays 2D to DLLs, cand find you examples of both in examples > communicate with external Applications > external Code using the > integrating DLLs > DLL.vi call. Basically, LabVIEW can pass in the form of a big table 1 d 2D tables, so you'll need to spend too much table size index it. If you pass the array 2D handles it is preferable to use the typedef that LabVIEW generates for you, something along the lines of

    / * LabVIEW created typedef * /.
    typedef struct {}
    Int32 dimSizes [2];
    Double elt [1];
    } TD1;
    typedef TD1 * TD1Hdl;

    I hope this helps.

    Best regards:

    Andrew Valko

    NOR Hungary

  • How does the library function call Labview? Can I emulate using C++?

    Hi all. I recently finished writing a dll CUDA for LabView, and now I'm in the steps of optimization of code, memory management, etc. BUT since my code depends on the entries of Labview (lots of data under types of specific data as table manages and Clusters labview) I can't use the CUDA Profiler or the Profiler VC ++ on the DLL. What I intend to do runs labview and then out of all data entry for the DLL in a binary file and then add an additional function in my code that will read in the binary file, allocate and assign variables to their respective positions, and then call the specific DLL function in Labview. In the end, this miniature function will act as the library function call to my specific group of data entries.

    In any case, I started to make this purchase all my data entry of cluster and it comes out in a binary file. And then I started the initialization of the handles of labview, allocating memory and begins to write the binary data in the memory and it works for integers (ints), floats, etc., but I'm confused on how it works with table handles!

    Some examples of code:

    Sets the Handle for table 1 d for INT
    typedef struct {}
    int length;
    int val [1];
    to access the value in a row-online val [Online]
    } Array1dInt, * Array1dIntHandle;

    int main()
    {
    Array1dIntHandle x = new Array1dInt *;
    (* x) = new Array1dInt;

    ifstream file ('TESTDATAIN.dat', ios: in | ios::binary);

    If (file.is_open ())
    {
    file ((char *) &(*x)-> length, sizeof;)
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    LabviewSpecificFunction (x);
    leader. Close();
    } else
    {
    < "file="" did="" not="" open!"=""><>
    }
    return 0;
    }

    __declspec(dllexport) LabviewSpecificFunction (Array1dIntHandle x)
    {
    ...
    }

    However, my program crashes when the table is nominally big, and it is expected, because if we look at the Array1dHandle, it has allocated only enough memory to 1 item of value! YET, somehow, in its magical and mysterious labview is capable of making val [1] be val [HOWEVERMANYYOUWANT], even if C++ 101 says that val [1] is a constant pointer, and even if I dynamically allocated memory another somwhere, I would never be able to put these data in this round!

    Can you explain, or maybe even write example on how I can fool my program into thinking that the binary code comes from labview, so I can then run my program independent of allowing me to profile the functions inside labview?

    I hope that this question is clear and my sample code is also clear, but I'm happy to answer any questions that relate to this.

    Thank you all!

    I think that I thought about it.

    Array1dIntHandle x = new Array1dInt *;
    int tempsize;
    file ((char *) & tempsize, sizeof;)
    (* x) = (Array1dInt *) malloc (sizeof (int) + sizeof (int) * tempsize);
    (* x)-> length = tempsize;
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    Well enough, you will need to make the handle, and then make a new Array1dInt * for him, then read in the length of the array in a temporary variable. Then use this information to then malloc memoery quantity you need for the table and pass this place on the handle. Now the handle will point to the size of the memory and you will be able to access the memory in the format, you've done the handle. Badabing badaboom

  • Problem with the help of DLL functions

    Hello.

    I'm writing a DLL that calls the functions of a DLL camera and them ends and passes of LabView. I wrote some code of practice and the dll of passage of functions and events with Labview and LabWindows/CVI DLLs, so I like to think I have a reasonable understanding on what I'm trying to do. However I keep getting errors in calling the functions of DLL functions camera I want to use in my DLL.

    I have two functions in the camera DLL, XC_AddImageFilter, and XC_RemImageFilter, I would like to wrap and put at disposal in my DLL. When I compile I get the following errors:

    2 link project errors, Undefined symbol '_XC_AddImageFilter' referenced in "ImageFilter.c". Undefined symbol '_XC_RemImageFilter' referenced in "ImageFilter.c".

    I tried to tweak the prototypes in my header file and the change in functions but nothing I try seems to work. I connected the camera DLL in my project in a way that was previously successful with another practice DLLs and I browsed this forum for similar problems, but I can't seem to find a soloution.

    Thank you for taking the time to read this. I hope that you will be able to help me with my problem.

    PS I had problems to join my code so I put an extension .txt at the end and apparently has worked so please forgive the suspicious file extensions.

    Sorry!

    I do not understand the Labview.lib file which is why Labview functions weren't working! Duh!

    #begginer errors!

  • Function call error FNDLOAD

    Hello

    OUL5x64
    upgrade to Ebs r12 12.0.6 to 12.1.1 and running maintenance pack 7303030
    had this error of worker001

    Please give me a solution for this error.
    Thanks in advance.
    Tom


    Loading data using FNDLOAD.
    FNDLOAD APPS / * 0 DOWNLOAD @BIS:patch/115/import/bisdbdpd.lct @BIL:patch/115/import/US/bilobieersg.ldt -.

    Connecting to applications... Successfully connected.

    Call the function FNDLOAD.

    Returned by the function FNDLOAD.

    Log file: /u01/oracle/PH2/apps/apps_st/appl/admin/PH2_BALANCE/log/US_bilobieersg_ldt.log
    FNDLOAD of error function call.


    Error log:

    Download from data file /u01/oracle/PH2/apps/apps_st/appl/bil/12.0.0/patch/115/import/US/bilobieersg.ldt
    Changing environment NLS_LANGUAGE AMERICA database
    Dumping from the LCT/LDT files (/ u01/oracle/PH2/apps/apps_st/appl/bis/12.0.0/patch/115/import/bisdbdpd.lct(120.1), u01/oracle/PH2/apps/apps_st/appl/bil/12.0.0/patch/115/import/US/bilobieersg.ldt) to the staging tables
    Dumping file u01/oracle/PH2/apps/apps_st/appl/bis/12.0.0/patch/115/import/bisdbdpd.lct(120.1 LCT) in FND_SEED_STAGE_CONFIG
    Dumping LDT file /u01/oracle/PH2/apps/apps_st/appl/bil/12.0.0/patch/115/import/US/bilobieersg.ldt in FND_SEED_STAGE_ENTITY
    The lot (PROPERTIES, ENTRY VIEW JTF_RS_GROUPS_VL JTF) of dumping to the FND_SEED_STAGE_ENTITY
    Download of the staging tables
    Error loading of the seed for the PROPERTIES data: type_objet = MV, OBJECT_NAME = BIL_OBI_FST_PG_MV, proprietaire_objet = BIL, ORA-06508: PL/SQL: called program unit is not found
    Error loading of the seed for the PROPERTIES data: type_objet = MV, OBJECT_NAME = BIL_OBI_OPTY_PG_MV, proprietaire_objet = BIL, ORA-06508: PL/SQL: called program unit is not found
    ....
    ..

    Tom,

    Could you please check if you have invalid objects in the database, compile it and restart the worker failed?

    If it is an instance of test and that you have a backup, I suggest you run the old ldt Elf (or ignore the worker) and move forward with the patch. You can run the command FNDLOAD later, once the patch is done (assuming that no other patch file depends on it).

    If the above does not help or does not apply, then I guess it's time to log a SR (such that no similar error is reported on Metalink).

    Kind regards
    Hussein

  • XNET Config read to fill in when a certain arbid is received (i.e. return of function call when the msg is received)

    The API XNET-CAN allows to hardware configuration such that a call to read the framework/signal does not return until the message is received (no need to query the buffer, call to the function is as an event... function returns when a message is received) or if a time-out occurs).  I don't really want to query for data, unless I absolutely have to.  My plan is to have parallel code to wait for a specific message to receive and respond (should be very fast!) whil a different loop receives all other executives.

    A time-out of the reading function call would work pretty good, but it doesn't seem to work (see extracts attached).  The value of timeout only seems to work (no error property) is a value of 0 seconds.

    Thank you

    Todd

    Change of a single point of session for a queued session.

Maybe you are looking for