CVI crashes when calling function from external DLL

I'm calling a CVI library from Test Stand 4.1.  In that CVI library I load an external DLL (using LoadLibrary) and create a few function pointers (using GetProcAddress).  The DLL loads successfully, and I get addresses for all of the imported functions.  
However, when I one of the functions is called CVI crashes (Test Stand says it lost the ActiveX connection to CVI) when executing in an external CVI instance.  If executed in the Test Stand process I get a system level exception.
If I step through the code in CVI, it hangs after trying to step into or over the call to the function pointer from the external DLL.
I am able to call the functions in a small test project I created in CVI, however when integrating it into an existing test library and calling it through Test Stand it fails.
Any ideas on how to go about debugging this issue?

Have you tried calling into the dll that CVI calls directly from TestStand?  I am curious to know if this also crashes.
I am also curious to know if there are any path references in the dll that is called by the CVI program.  If so are they relative, or absolute paths?
I ask because one of the possibilities is that relative paths are being used to specify a path from the location of the code that is called, and they are not working because the current working directory is being specified by TestStand, and the paths are not relative to the working directory given by TestStand.
Jensen
National Instruments
Applications Engineer

Similar Messages

  • Getting session hang When calling Function from SQL query

    Hi All,
    I am using Oracle 8.1.7.4.0. I have a fucntion in a Package and I am calling it from the SQL query. When I am firing the query my oracle session is going to hang position and I am not able to any thing. I have to kill the session.
    But this same thing is working fine in Oracle 9.i.
    There are no out parameter and no DML, DDL and DCL statement in this fucntion.
    Could you please get back me what is the problem on it.
    Regards
    SUN

    Check why your session hangs.
    Just a few ideas:
    * Blocking locks?
    * Endless loop?
    * Performance (maybe it is just slow in orac8i and you have to wait a bit longer). Check the execution plans of the SQL statements in your function.
    * Don't use a function, but direct SQL, it is faster in both versions.

  • Calling functions from a DLL

    I am currently using Oracle to retrieve a BLOB data to process it. The only way I have of intepreting the BLOB is through a function of a DLL provided by my supplier. Is there anyway of doing so?
    Any Help is very greatly appreciated. Thanks

    Unless you have worked with the JNI before or are long accustomed to "just figuring it out due to lack of documentation and information", you really will not glean too much information just from looking at the JNI itself.
    In a nutshell, what you need to do is: create one or more Java classes which contain native methods appropriate for your use; compile these classes; use the 'javah' to process each class that contains native method declarations in each class; copy the generated C header files to C/++ source files; implement each C function (each function corresponds to precisely one native method declaration) in each C/C++ source file as appropriate for your needs (e.g., do Oracle ju-ju (this is where the real beef of the JNI comes in - functions to get data out of the VM and from the Java environment - threads, objects, and so on); compile and link the C/C++ source code into a DLL for Windoze and a shared object for Unix (note that when you compile you will actually need to include two directories from the JDK, not just one - the second directory provides the platform specific definitions of types and so forth). Having done all that, you essentially can now use that/those class/classes in the Java world to hit the Oracle ju-ju, or whatever it does, from a Java perspective.
    For more information, see the Java Native Interface tutorial trial at http://java.sun.com/docs/books/tutorial/native1.1/index.html

  • ORA-01804 when calling function from java client

    Hi All,
    we changed a PL/SQL-function that is called from a java client from using sysdate to localtimestamp. The function works fine in TOAD, but when called from the java client ist throws an ora-01804: failure to initialize timezone information.
    Any suggestions?
    Alexander

    The change was only made to a local variable in a function that was called from the original function that got the parameters from the java client.
    I changed it from localtimestamp to systimestamp and it works fine.
    Do i have to make any settings about the time zone in the jdbc thin client ?

  • Call function from "CP210xManufacturing.dll"- Silicon Labs

    I am developing a production line test system that includes retrieving and setting the VID, PID, product string, serial number maximum power consumption of a Silicon Labs CP2102 USB - UART bridge using Labview 8.2.
    Unfortunately I could only call one function { CP210x_GetNumbDevices() }. Wondering any one can help me to call others.
    The Document  : http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/Interface/en/an144.pdf
    CP210xManufacturing.dll :http://www.silabs.com/public/documents/software_doc/othersoftware/Microcontrollers/Interface/en/an14...
    Tuong

    G'day Tuong,
    I'm having issues finding the device i want (VID / PID) on my machine using the "CP210xManufacturing.dl"and calling function "CP210x_GetNumDevices()"...
    Just wondering if you have any details on this....
    Hahaha, I just saw the date you wrote this thread... Hmmm, I might just ask you at work tomoz...
    Cheers
    Tim

  • Call function from C++ (dll file) in Flex

    Hi,
    i using Adobe Flash Builder with Flex 4 , i write a C++ Code in dll File , i need to access to my Function in dll file in Flex ?? what should i do ??

    Lets make sure you are performing the correct actions:
    1.  Place a Call Library Function node on your block diagram.
    2.  Double click the node to open up the Call Library Function dialog box.
    3.  Click the Browse button and navigate to the DLL function.  Select the proper DLL and click Open, or just double click on DLL.
    4.  On the Function Name box, click on down arrow.  A list of functions found in the DLL should be displayed.  Choose the function.
    5.  On the Calling Conventions box, click on down arrow and select C or WINAPI.  In your case, it should probably be C.
    6.  The Parameter box should show return type.  In the Type box, select the data type of the return value.  Since you won't see HRESULT here, you need to find out what data type HRESULT is in the C code.  I would guess it is a numeric so select numeric from the drop down list.
    7.  Click the Add a Parameter After button.
    8.  In the Parameter box, change the name arg1 to the actual name of your first parameter, which is byPortNumber.
    9.  In the Type box, choose Numeric, since a BYTE is a numeric in Labview.
    10. In the Data Type box, choose Unsigned 8-bit Integer, since a BYTE is a U8 in Labview.
    11. In the Pass box, choose Value.  If the C parameter was a pointer (*BYTE), you would choose Pointer to Value.
    12. Verify that the contents of the Function Prototype box contains the correct syntax according to the C declaration.
             C:  HRESULT RSPInitComm (BYTE byPortNumber)   should be in Labview: long RSPInitComm(Unsigned char byPortNumber)
    13. Click OK button.
    Try it out.
    If you get a crash, change the Calling Convention to WINAPI.
    - tbob
    Inventor of the WORM Global

  • Calling a function from a dll written by using visual studio c++

    Hi, how can i call a function from a dll which is written by visual studio c++ in test stand?  Although the functions in dll are exported and i've chosen c/c++ adapter, i saw no function in test stand. Is there a different step while i'm calling a function from a dll written by c++ than calling a function from a dll written by cvi?

    Hey Sadik,
    Selecting the C/C++ DLL Adapter Module should be sufficient for this. When you drag an action step for this onto the Main Step and navigate to the location of the DLL, the function list should populate and you should be able to select the function you want to use. If this is not the case, would you be able to post this DLL so that we can test this on our end?
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • Calling a function from a DLL, exectution in background mode.

    Dear Experts,
    We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
    Do you know a way to solve the problem when executing in background mode?
    Best regards.
    Antonio

    Hi Gabriel,
    Let me explain in details about my DLL function.
    We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
    I am sending my code for your considerations.
    Instancia a DLL
      CREATE OBJECT dll 'MTCODE.CPFONET'.
      IF sy-subrc NE 0.
        RAISE without_dll.
      ENDIF.
    Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
      it_name[] = ti_name[].
    Para cada registro importado
      LOOP AT it_name.
        CLEAR v_string_ret.
        wa_matchcode-zregid     = it_name-zregid.
        wa_matchcode-name1_text = it_name-name1_text.
        v_string = it_name-name1_text.
        CONDENSE  v_string.
        TRANSLATE v_string TO UPPER CASE.
        CALL METHOD  OF dll 'SetNome' EXPORTING #1 = v_string.
        CALL METHOD  OF dll 'ExecMatch'.
        CALL METHOD  OF DLL 'GetMCData' = v_string_ret.
        FREE OBJECT dll.
      Preenche os campos do match-code de acordo com o retorno da DLL
        SPLIT v_string_ret
        AT '|'
        INTO wa_matchcode-zparmcln
             wa_matchcode-zparmcfn
             v_empty
             wa_matchcode-name_first
             wa_matchcode-name_last
             wa_matchcode-namemiddle.
      Adiciona o registro com o match-code correspondente na TE_MATCHCODE
        APPEND wa_matchcode TO te_matchcode.
      ENDLOOP.

  • 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

  • Can I call a function from a dll in LabVIEW that returns:double*string and int.?

    I have a function from a dll that return a double* string and an integer. How can I call this function from LabVIEW? There is a possibility to work in LabVIEW with a double* string?

    pcbv wrote:
    > Hello all,<br><br>The header of the function is:
    >
    > "HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems);"
    >
    > where WRAPI_NDIS_DEVICE have this form:
    >
    > typedef struct WRAPI_NDIS_DEVICE<br>{<br>
    > WCHAR *pDeviceName;<br>
    > WCHAR *pDeviceDescription;<br><br>}
    > WRAPI_NDIS_DEVICE;<br><br>
    >
    > The function is from WRAPI.dll, used for communication with wireless card.
    > For my application I need to call in LabVIEW this function.
    Two difficulties I can see with this.
    First the application seems to allocate the array of references
    internally and return a pointer to that array. In that case there must
    be another function which then deallocates that array again.
    Then you would need to setup the function call to have a pointer to an
    int32 number for the deviceList parameter and another pointer to int32
    one for the plItems parameter.
    Then create another function in your DLL similar to this:
    HRESULT WRAPIEnumExtractDevice(WRAPI_NDIS_DEVICE *lpDeviceList, long i,
    CHAR lpszDeviceName, LONG lenDeviceName,
    CHAR lpszDeviceDesc, LONG lenDeviceDesc)
    if (!lpDeviceList)
    return ERROR_INV_PARAMETER;
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceName, -1,
    lpszDeviceName, lenDeviceName,
    NULL, NULL);
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceDescription, -1,
    lpszDeviceDesc, lenDeviceDesc,
    NULL, NULL);
    return NO_ERROR;
    Pass the int32 you got from the first parameter of the previous call as
    a simple int32 passed by value to this function (and make sure you don't
    call this function with a higher index than (plItems - 1) returned from
    the first function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling a native function from a dll

    Hi all,
    I want to call an api function exported from a dll using java. For example l like to call a function from kernel.dll (Windows). How can i do this. Do i have to create another dll for this?

    hi,
    you need to use JNI
    you have to create de DLL , and call kernel32.dll in.
    like that:
    java_class.class ==> first_dll.dll ==> kernel32.dll

  • Using PostLVUserEvent function from Labview.dll

    I am trying to use the PostLVuserEvent function from the labview.dll and corresponding extcode.h file.  I have made my own dll using CVI that uses this function.  I then use Labview to call my dll.  My dll compiles fine.  No issues, no errors.  LabView can call my dll function containing the PostLVUserEvent function with no errors.  However, the event number LabView passes my dll is not the same event number I receive so no LabView event is triggered. 
    Has anyone had this issue? 
    We are trying to solve it from the LabView side and the CVI side but cannot seem to get it to work.  The examplesI have found here were compiled using C++ and those seem to work.  I do not know why when I compile my program in C, it creates the dll but does not work.   If I had to guess, i think it's an issue with pointers vs non-pointers.  When the LAbview program selects my function from the dll, it shows the argument PostLVUserEvent as a pointer when in my dll, it is not a pointer PostLVUserEvent....
    Any ideas?
    Thanks in advance. 

    Hello Blue
    Take a look to this one, it was created on C, I think the .c and the .h files will give a good idea, how the function should be implemented. It is important when calling the dll on LabVIEW, to use the std calling convention and run it on the UI thread.
    Regards
    Mart G
    Attachments:
    LabView EventTest.zip ‏1041 KB

  • Error BT616 when calling function module SXPG_COMMAND_EXECUTE in background

    Hi All,
    We use function module SXPG_COMMAND_EXECUTE with a custom command we defined in SM69 to move files in unix (mv command).
    The function module call has worked fine for almost a year and recently we have been seeing an error (BT616) in our job lob (SM37) when the program is run in background. We have not been able to reproduce the error in foreground mode and it seems to be occuring only periodically in the background. (The appropriate SAP authorization objects where assigned to the batch job ID and the steps on the batch job.) We are in the process of setting up the trace flag and performing analysis on the trace log via ST11 to help identify the issue.
    After perform analysis on SXPG_COMMAND_EXECUTE, the error is occurring when calling function module SAPXPG_END_XPG for exception 2, system failure, yet function module SAPXPG_END_XPG does not exist. I assume this is a program at the operating system level and is just a signature of the parameters to be passed to the operating system program.
    Below is part of the SAP function module SXPG_COMMAND_EXECUTE that is failing.
    * Now we have to wait for the termination of the external
    * command if the caller wants us to.
        IF TERMINATIONWAIT = 'X'.
          CALL FUNCTION 'SAPXPG_END_XPG'
            DESTINATION DESTINATION
            IMPORTING   EXITSTAT = STATUS
                        EXITCODE = EXITCODE
            TABLES      LOG      = LOG
            EXCEPTIONS  COMMUNICATION_FAILURE = 1 MESSAGE MSG
                        SYSTEM_FAILURE        = 2 MESSAGE MSG.
    I performed a where used on function module SXPG_COMMAND_EXECUTE, and most of SAP programs call the function module with the parameter TERMINATIONWAIT = 'X', so I assume we should pass ‘X’ as well.
    Any ideas on what could be causing this issue?
    Mike Vondran

    I also remember I have this kind of issue, as I have some UNIX script at OS( UNIX) level . The problem was with the ID , as it don’t have proper authorization at OS level ( UNIX ) . Please check this ID authorization. This could be the one of reasons if you’re sure from SAP standpoint.
    Hope this’ll give you some guide line..
    Thanks
    Bye

  • Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.boots

    When attempting to create a new Account in siebel integrated with OEDQ the following error occurs.
    ERROR
    Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.bootstrap.library.path)(SBL-APS-00118)
    STEPS
    The issue can be reproduced at will with the following steps:
    1) from EDQ director we have imported the EDQ_CDS,EDQ-REFERENCE DATA & EDQ_HISTORICAl DATA packages sucessfully.
    2) Created dnd.param file in SIebel server SDQCOnnector folder.
    3) Copied the libdnd.so file to siebsrvr lib directory(32 bit)
    3) In dnd.param file we have mentioned the javalib file and instllation directory path(<Siebsrvr roo>/dnd/install)
    4) Unzipped the EDQ-Siebel Connector files in dnd/install folder
    5) Copied the dnd.properties file in dnd/install directory and modified it accordingly to point to installed EDQ instance.
    6) Configured the Siebel components for EDQ integration.
    7) Realtime EDQ jobs are running.
    8) Create a new Account
    Env details are
    On : 8.2.2.14 [IP2014] version, Client Functionality
    EDQ 11.1.1.7.4
    IBM JDK 1.7 32 bit
    Using Open UI
    Any Champ have faced this issue and overcame it please let me know the resolution steps. your help is
    Regards
    Monoj Dey
    9007554589

    Hi Monoj,
    A few questions:
    - What OS is Siebel running on?
    - What version of the Siebel connector are you using?
    - Which libdnd.so file are you using?
    - What's the contents of your dnd.parms file?
    thanks,
    Nick

  • Application crashes when calling run_report_object , FRM-93652: The runtime process has terminated abnormally

    I got this error when calling report from my form:
    FRM-93652: The runtime process has terminated abnormally
    Forms Session ID is WLS FORMS.formsapp.101
    Here is the trace dump info :
    Last Trigger  FORM/BLOCK/FIELD: FRM_ACTIVITY_QUEUE.BLK_ACTIVITY_QUEUE.BTN_PRINT
    Last Trigger: WHEN-BUTTON-PRESSED - (In Progress)
    Last Builtin: RUN_REPORT_OBJECT - (In Progress)
    ----- Call Stack Trace -----
    calling              call     entry                argument values in hex
    location             type     point                (? means dubious value)
    siehDumpStackTrace(  call     kgdsdst()            000000000 ? 000000000 ?
    )+104                                              7FFFBF18D110 ? 7FFFBF18D1D8 ?
                                                       7FFFBF1AD130 ? 000000000 ?
    siehjmpterm()+650    call     siehDumpStackTrace(  000000000 ? 2B1668E4EB00 ?
                                  )                    7FFFBF18D110 ? 7FFFBF18D1D8 ?
                                                       7FFFBF1AD130 ? 000000000 ?
    __restore_rt()       call     siehjmpterm()        00000000B ? 2B1668E4EB00 ?
                                                       7FFFBF18D110 ? 7FFFBF18D1D8 ?
                                                       7FFFBF1AD130 ? 000000000 ?
    00002B1660459EB0     signal   __restore_rt()       2B16603F2929 ? 7FFFBF1ADBD8 ?
                                                       000000000 ? 000000002 ?
                                                       000000001 ? 0EBC57ED8 ?
    Anybody knows what might be the cause ?
    Thanks

    Refer to : Oracle Support :  Forms Runtime Crash (FRM-93652) When calling RUN_REPORT_OBJECT in 11g (Doc ID 1306368.1)

Maybe you are looking for

  • Spliting a table in to two table based on the groups in SSRS

    Hi, I am trying to a split a rows accross two tables based on a group. So far I have added a list and added a row group and grouped it using lineof business Inside my list i have two identical tables so i can display the data for the first table i ha

  • Amp volume-adjust knobs triggers "jump" to different Patch...(?)

    Plugged in my Strat., and using Stagemaster 2: I'm trying to employ Distorted Stratocaster from Patch List...No sound, (although several other selected patches do have adjustable sound.) When I try to adjust Dist. Strat. Master volume knob, the Shred

  • Log specific http header

    Hi, We have a "RedLine Networks T | X 2600 Real Time Accelerator", between the Clients and our frontends. As expected the IP that gets logged in the frontends is the "T|X 2600" IP, and not the client ip. In the request from the "T|X 2600" we have an

  • IDoc Adapter error / oss note 856266

    Hi all, Has anyone else run into and successfully fixed the error described in oss note 856266? We ran into exactly this issue. Found the note by searching on the error message, downloaded and applied the correction instructions, all the while feelin

  • Time Machine Backup and storing certain files, switching to lion

    Hey Gang, I need to unload my harddrive. Whats the best way to do this?  I want to keep some files off my harddrive to free up space.  But i want to access them anytime.  Should i just do i time machine backup then delete the files and still have acc