CVI Execution Profiler - DLL overhead

Hello,
I'm using CVI execution profiler toolkit to analyze performance in system where a implicity linked DLL is called from an application exe.
It appears that in many of the statistics the component time % for the exported DLL function is roughly half the overall time for the component.
For example (with 'dll_function' selected in profiler):
+exe_function
-dll_function                         50%
DebugPrintf                48%
OtherFunction              2%
Would this time coorelate with overhead of calling the DLL?
Thank you for any help in regards to this.
Solved!
Go to Solution.

Hey jharris,
I ran one of our simple examples and saw somewhat similar behavior--my GetUserEvent function takes about 66% of the time and the DLL function takes 33%. In my case, this simply means that the code is spending more of its time running the GetUserEvent function than in the DLL function. I'd expect this, since the GetUserEvent function is checking for UI updates. 
Is your exe function doing something other than just calling the DLL function, and do you see the other 50% of time anywhere else in the execution profile? If so, I suspect that it's just indicating that only half of your execution time is spent in the DLL function.
Daniel E.
TestStand Product Support Engineer
National Instruments

Similar Messages

  • CVI Execution Profiler not showing (need registry cleanup method)

    I have installed CVI 2010SP1 / CVI 2012SP1 and Execution Profiler Toolkit and even though I call the function CVIProfSetCurrentThreadProfiling(1)/set profiling in build options, at the end of the program run, the Profiler does not show up. I tried to uninstall and reinstall all CVI+Runtime (except device drivers which are mandatory to be kept the same), but this did not solve it. Please tell me which registry setting or registry cleanup tool I have to use. Thank you.
    Solved!
    Go to Solution.

    Hello razvan.ioachim,
    I think I might have more suggestions for you. Did you try to open the profiler from Start > Programs > ... etc? Did you try to redirect the profiler output to a file?
    If none of these suggestions work, your machine may be corrupted. The issue might not lie in the registry, but in a system dll or other component. We might be able to suggest a few registry keys that might hold invalid data, but that is going to take some investigation and might not yield the expected results.
    In the end, you might have to format your drive and reinstall Windows...
    Best regards,
    =Nelu F. || National Instruments.

  • Execution profiler, etc.

    Hi,
    I have a performance problem with an application, deployed on 9iAS. ( servlets, JSP , no EJB - all in home made Model 2 framework )
    I've managed to start execution profiler session from JDeveloper, but didn't get any valuable outcome out of it, because I'm confused in interpretation of the results.
    ( lack of knowledge )
    I need either an advice or reference to some documentation on the matter ( the one in JDeveloper is pretty scarce ).
    Thanks!

    I recommend viewing the profiler demos at
    http://otn.oracle.com/products/jdev/viewlets/viewlet-archive0903.html
    As well as following the hands on tutorial for IDE at:
    http://otn.oracle.com/products/jdev/htdocs/handson/FrontSheet/FrontSheet.html
    Regards,
    Stuart

  • Can't close CVI panels in DLL-Detach when called from Teststand

    Hello,
    i've got a problem with Teststand calling a DLL produced with CVI.
    1. I use to DLL Attach and Detach calls to load or discard the panels. The attach part works fine, but when the TS sequence ends and i try to unload the module, the "DiscardPanel" function returns a error -129 "operation can only be performed in the thread it was created".
    If i call the same dll from a CVI executable, this doesn't happen.
    2. Additionally, the first time i run the sequence file the panel doesn't correctly quit and return to Teststand, so the whole thing hangs.
    Does anybody have an idea, what is going wrong?
    See attached files:
    ErrorOnDllDetach.seq --> Call DLL from TS
    \bin\usePanelsDll_dbg.exe --> Call DLL
    from CVI
    Attachments:
    NoUnloadOfDll.zip ‏326 KB

    Maik -
    After some more investigation, because of limitations in Microsoft's operating system, developers and CVI are limited in what they can do in DLLMain. Basically load and unload CVI panels in DLLMain just does not work well if the DLL is loaded and unloaded arbitrarily like it is in TestStand.
    One option is to never unload the panels and let CVI and the OS clean up the panels when the process terminates. You can do this by adding an extra reference to your DLL using LoadModule. You would basically prevent TestStand from unloading the DLL, so any dialog would stay around for as long as you like.
    The best way to have the dialog go away when TestStand is no longer using it is to associate your dial
    og lifetime with the execution that is displaying it. You load the panel either when the first call is made into the DLL or by an explicit call to a "Display" function exported from the DLL. Then have the dialog monitor for when the execution is terminated or stopped. This works because TestStand does not attempt to unload the DLL until the execution that is using it completes.
    I have attached an example DLL and sequence that does just this. It uses a default pool thread to display a panel and that thread waits for either an explicit call to a "Discard" function exported from the DLL or or if the execution stops.
    Hope this helps...
    Scott Richardson (NI)
    Scott Richardson
    National Instruments
    Attachments:
    DLLProject.zip ‏344 KB

  • Terminate execution from DLL file?

    How do I terminate the execution of a sequence, from a DLL file? I'm using pure C++ and the DLL adapter in TestStand.
    I tried 'execution->Terminate;', but no effect.
    What would be the approach to make the sequence execution goto cleanup (still using C code from a DLL file)?

    Hey Steve,
    I wrote a small dll in CVI that will wait indefinitely in the DLL step until the Terminate Button is pressed in TestStand.  The code is below.  I hope this helps.
    void __declspec(dllexport) __stdcall WaitUntilTerminateIsPressed(CAObjHandle SeqContext)
        TSObj_Property TermMonitor;
        TSObj_Execution ExcObj;
        VBOOL TerminateBool;       
        TS_SeqContextGetExecution (SeqContext, NULL, &ExcObj);
        TS_ExecutionInitTerminationMonitor (ExcObj, NULL, &TermMonitor);
        TerminateBool = VFALSE;     
        while(TerminateBool == VFALSE)
            TS_ExecutionGetTerminationMonitorStatus (ExcObj, NULL, TermMonitor, CA_DEFAULT_VAL, &TerminateBool);
            Delay(.1);
    Best Regards,
    Software Engineer
    Jett R

  • CVI device driver DLL

    Hello,
    I tried to use CVI device drivers under LabVIEW 6i. The problem ist
    that the device driver DLLs are missing. Is it possible to create
    these DLLs without LabWindows, or create them with LabVIEW? I tried to
    create them with a gnu compiler, there some c-source- and
    c-header-files are missing. I need the DLLs for the device drivers
    bp14xx, hp3325a an 3457a. Can anyone tell me how to get these DLLs?
    Best regards
    Jens

    The CVI drivers for the HP3325 and HP3457 are very old it appears and were propabley created before plug and play and the need for DLL distribution. The only way to create the DLL required is with LabWindows and even then might take some effort to work. However, LabVIEW drivers do exist for the HP3325 and HP3457. Go here, select Agilent as the manufacturer and download them. I don't know about your BP14xx. Who is the manufacturer and what is the exact model number.

  • Delphi 4.0 using CVI 5.5 DLLs

    Hello !
    We can't make Delhi 4.0 use dll compiled with CVI 5.5.
    The problem is the paramaters don't get into the dll OK,
    BUT the return value from dll Delphi reads OK.
    We use _stdcall, no structures, the compatibility mode is Borland, ...
    Can anyone help us?
    Thanks in advance
    And with best regards,
    Vojko Èendak, dipl.ing.
    =======================
    Contact: Vojko Èendak,dipl.ing
    Company: Kompozit EMRA d.o.o.
    Address1: Tkalska ul. 13, 3000 Celje
    Country: SLOVENIA
    Telephone.: +386(3)4906460
    Fax1.:+386(63) 417402
    Fax2.:+386(3) 5417402
    email: [email protected]
    =======================

    Thanks Amit for the confirmation. I am following SAP Note 0001399319 which mentions about how to develop for custom WD ABAP applications in PPM 5.0.
    The example WDA component mentioned in the note is /RPM/CUSTOM_COMPONENT. I am developed a custom WD ABAP application in lines with the SAP note and still not able to get the GUID in the context.
    The code written in WDDOINIT of these applications is as below,
      instantiate session state class
        wd_this->mr_session_state = cl_inm_session_state=>get_instance( ).
    Obtain current context from session state.
        CALL METHOD wd_this->mr_session_state->get_current_context
          IMPORTING
            es_context = wd_this->ms_context.
    I am getting null in ms_context.
    Please let me know if you have tried to implement an custom WDA application in PPM 5.0. Not sure what am I missing in the above scenario.
    Thanks,
    Yomesh

  • Memory and execution Profiling

    Hi,
    The significance of the various fields in the profiling window is not clear, for example the count field in the window of the memory profile, and how to interpret the entire data..
    Please help
    anup

    kc64 wrote:
    Shane--
    Thanks for the replies.
    I added an AE logging function that I use to help debug the code.  When I added this, the timing came in line.  I don't know what the root cause is but I think I will move on until it breaks again.
    Thanks,
    Kevin
    Does that mean you no longer have a problem?  Did the problem go away?  Or upon closer inspection you realize you really didn't have a problem?  Or the AE logging function helped solve the problem for you?
    "but I think I will move on until it breaks again".  That is a troublesome thought.  It you really have a problem but haven't solved it, that means it will eventually break, and when it does, you will have that much more code on top of it and make it that much harder to troubleshoot.
    If you really have a problem, it's better to find it and fix it now while the code is still relatively simple.  Building on a bad foundation is just going to cause the whole house to come crashing down later.

  • Does the USRP SDR require LabVIEW Communications?

    I've recently installed LabVIEW 2013 on my machine, along with a whole bunch of toolkits:
    LabVIEW 2013 English
    VI Package Manager
    LabVIEW 2013 Control Design and Simulation Module
    LabVIEW 2013 Datalogging and Supervisory Control Module
    LabVIEW 2013 MathScript RT Module
    NI LabVIEW 2013 LEGO(R) MINDSTORMS(R) NXT Module (English)
    NI Vision Development Module 2013
    LabVIEW 2013 FPGA Module (English)
    Xilinx Compilation Tools 14.4
    LabVIEW 2013 Real-Time Module (English)
    LabVIEW 2013 Touch Panel Module
    LabVIEW 2013 Robotics Module
    NI SignalExpress 2013
    LabVIEW 2013 Sound and Vibration Measurement Suite
    LabVIEW 2013 Statechart Module
    LabVIEW 2013 for myRIO Module
    NI Real-Time Execution Trace Toolkit 2013
    LabVIEW 2013 System Identification Toolkit
    LabVIEW 2013 Digital Filter Design Toolkit
    LabVIEW Modulation Toolkit 4.3.4
    LabVIEW 2013 VI Analyzer Toolkit
    LabVIEW 2013 Database Connectivity Toolkit
    LabVIEW 2013 Report Generation Toolkit for Microsoft Office
    LabVIEW Spectral Measurements Toolkit 2.6.4
    LabVIEW 2013 Advanced Signal Processing Toolkit
    LabVIEW 2013 PID and Fuzzy Logic Toolkit
    LabVIEW 2013 Adaptive Filter Toolkit
    LabVIEW 2013 DataFinder Toolkit
    LabVIEW 2013 Desktop Execution Trace Toolkit
    LabVIEW 2013 Multicore Analysis and Sparse Matrix Toolkit
    LabVIEW 2013 Electrical Power Suite
    LabVIEW 2013 GPU Analysis Toolkit
    LabVIEW 2013 Biomedical Toolkit
    LabVIEW 2013 NI SoftMotion Module
    NI Motion Assistant 2013
    NI Vision Builder for Automated Inspection 2012 SP1
    NI DIAdem Professional 2012 SP1 (English)
    LabWindows/CVI 2013 Development System
    LabWindows/CVI 2013 Real-Time Module
    LabWindows/CVI Spectral Measurements Toolkit 2.6.4
    LabWindows/CVI Spectral Measurements Runtime 2.6.4
    LabWindows/CVI SQL Toolkit 2.2
    LabWindows/CVI Signal Processing Toolkit 7.0.2
    LabWindows/CVI PID Control Toolkit 2.1
    LabWindows/CVI Execution Profiler 1.0
    Measurement Studio 2013 Enterprise Edition for Visual Studio 2012
    NI General Security Patch Q2 2013
    NI TestStand 2013
    NI ELVISmx 4.5
    NI DAQmx 9.7.5
    Xilinx Compilation Tools 10.1 (Requires Additional Xilinx Compilation Tools DVD)
    NI Device Drivers - February 2013
    I wanted to follow this tutorial with the USRP 2932, which will arrive soon, but I later found out that I don't seem to have any of the LabVIEW Communications. Will not having those prevent me from using the USRP radio? If not, then are there any restrictions on what I can do with the radio without Communications?

    Hi BreadLB,
    The link to the tutorial that you posted is based on LabVIEW Communications System Design Suite, a new software environment designed to accelerate algorithm prototyping and over the air testing.  It is a completely separate and independent environment from LabVIEW.  See my post here for more details.  You can also download a free 30 day evaluation copy here.  Your hardware is supported with both LabVIEW and LabVIEW Communications.
    The NI 2932 is a network based USRP, and it has a small onboard FPGA.  Because of that, the FPGA on that specific product is not a LabVIEW FPGA target.  The NI 294x/5x family has a large Kintex 7 FPGA and can be programmed using LabVIEW FPGA or LabVIEW Communications, like in the tutorial that you posted.  The NI 2932 can be used with your host PC and LabVIEW for a wide variety of applications.  Unfortunately the tutorial that you linked in your post requires the NI 294x/5x hardware and LabVIEW Communications.  If you have questions about a specific application for your 2932, please post more details and we would be happy to help.

  • LabVIEW2013,LabVIEW2013SP1(Real-Time付)インストールができない

    LabVIEW2013,LabVIEW2013SP1(いずれもReal-Time付)インストールの件で困っています。
    NIの技術サポートにも数度問い合わせていますが、解決していないので、 皆様のお知恵を貸して頂ければと思い、投稿します。
    経緯
    2月末にLabVIEW2013(Real-Time付)を購入し、下記パソコンにインストールを行いました。
    しかし、インストール中、度々エラーメッセージが表示されておりました。
    パソコン: HP Compaq Elite 8300 US/CT
    OS: Windows7 32bit PRO
    パソコンも最近買ったものです
    その後、LabVIEW2013SP1(Real-Time付)のDVDが届いたので、これをインストールしたところ、
    やはりエラーメッセージが表示され、インストールが完全に成功していないようでした。
    ただ、確認のため、同時に購入したPXIをMAXで認識させて、 Real-Timeのプロジェクトを作る準備ができるかなと思い、付属の手順のとおり作業しましたが、 Real-Timeのプロジェクトが作れませんでした。
    (手順書のとおりできない・・・RealTimeに関する項目が出てこない)
    また、サンプルファインダでReal-Timeのプログラムを探して開きましたが、絵のとおり!マークが表示されます。
    インストールがうまくいっていないと思い、 アンインストールとインストールを数度繰り返しています。
    最初のLabVIEW本体のインストールは成功しますが、そのあとのReal-Time以降インストールが失敗し、 あとはエラーメッセージが表示され、ほとんどインストールできません。 何度か再インストールを行っていますが、いまだ解決に至っていません。
    再インストールの際、行ったことは、
    1.HP Protect Tools一式の削除(hp制のセキュリティソフト)
    2.Intel Management and Security Statusの終了
    3.ファイアウォールの無効化
    です。
    なお、3のファイアウォールの無効化の際、ドメインプロファイルのファイアウォールも無効にしたところ、 再インストールの際の動作が改善し、その前よりもインストールできたソフトが多くなりました。
    また、インストール作業の最後のほうで、「ファイアウォールが有効になっています」と毎回表示されます。
    (ファイアウォールは無効にしているにも関わらず)
    質問:
    1.インストールに失敗する原因と解決策のヒントがありましたら、教えてください。
    2.上記パソコンでのインストール成功例がありましたらお知らせください。
    参考までに絵を添付します。 エラーメッセージはいくつも出ていますが、抜粋して添付します。
    インストールの概要
    インストールされていない
    NI SignalExpress 2013
    NI Real-Time Execution Traceツールキット2013
    LabVIEW 2013 VI Analyzerツールキット
    LabVIEW 2013 Report Generation for Microsoft Officeツールキット
    LabVIEW 2013 PID and Fuzzy Logicツールキット
    LabVIEW 2013 Unit Test Frameworkツールキット
    LabWindows/CVI 2013 SP1 開発システム
    NI デバイスドライバ - 2014年2月版
    インストール済み
    LabVIEW 2013 SP1 (日本語版) (アクティブ化)
    LabVIEW 2013 SP1 Real‐Timeモジュール - 日本語版       ←インストール済になっていますが、実際は使用できません LabVIEW 2013 Digital Filter Designツールキット (アクティブ化)
    LabVIEW 2013 Database Connectivityツールキット (アクティブ化)
    LabVIEW 2011 Advanced Signal Processingツールキット (アクティブ化)
    LabVIEW 2013 DataFinderツールキット (アクティブ化)
    LabVIEW 2013 Desktop Execution Traceツールキット (アクティブ化)
    LabVIEW 2013 System Identificationツールキット (アクティブ化)
    LabWindows/CVI SQLツールキット2.2 (アクティブ化)
    LabWindows/CVI Signal Processingツールキット7.0.2 (アクティブ化)
    LabWindows/CVI PID Controlツールキット2.1 (アクティブ化)
    LabWindows/CVI Execution Profiler 1.0 (アクティブ化)
    NI Real-Time Execution Traceツールキット2013 (アクティブ化)
    NI一般セキュリティパッチQ2 2013
    解決済!
    解決策の投稿を見る。
    添付:
    サンプル.PNG ‏73 KB
    13411.PNG ‏115 KB
    ドメインプロファイル2.png ‏229 KB

    まずReal Timeについて確認させてください。
    インストール済み
    LabVIEW 2013 SP1 (日本語版) (アクティブ化)
    LabVIEW 2013 SP1 Real‐Timeモジュール - 日本語版
    LabVIEW 2013 Digital Filter Designツールキット (アクティブ化)
    の中で、Real-Timeモジュールだけがアクティブ化となっていないことが気になります。
    一応の確認ですが、License ManagerでReal Time Moduleはどのような状態になっていますか?
    アクティブ化されていれば添付のように緑色のアイコンになっているはずなのですが
    Tepig
    Certified LabVIEW Associate Developer
    添付:
    rt.PNG ‏2 KB

  • Is it possible to step into a CVI dll when called by TestStand?

    As the question says: "Is it possible to step into a CVI dll when called by TestStand?"
    I am sure Ray F. may have a few tricks up his sleeves...  Hope you see this post, Ray!
    I compiled a dll using CVI.  The dll is called as a test by TestStand.
    I do have an "exe" version of the code that I use for debug with a testbed, but the behaviour is not the same as testing the actual target while running TestStand.  My goal is to get as close as possible to the real events.
    Thanks,
    JLV

    Sorry about that,
    There are two ways as I was saying:
    1. You can configure the CVI adapter to Execute Steps in a External Instance of CVI (requires CVI 6.0 or greater).
    Only go to Configure->Adapters and select the LabWindows CVI adapter and click on configure and select the corresponding option.
    After that set a break point in the step that you want to debug.
    An external instance of CVI will be launched where you can set break points and step into the code.
    2. From CVI Specifying an external process:
    In CVI go to Run Specify External Process and enter the seqEdit.exe as the program name (you have to browse to the location <TestStand>\Bin\SeqEdit.exe).
    As the argument you enter the name of the sequence file you want to debug.
    Now just select Run->Debug SeqEdit.Exe
    The Sequence Edtior will be launched and you can set break point in your CVI code and step into it when the step is executed.
    Check the Using LabWindows/CVI with TestStand reference manual for more information.
    I hope it helps you to get started.
    Regards.

  • Can't step into CVI step that calls LabVIEW DLL?

    Windows 2000 SP1
    TestStand 2.01f
    LabWindows CVI 6.0
    LabVIEW 6.1 Runtime
    We have a framework based on TestStand and CVI. A customer has supplied us
    with a DLL written in LabVIEW 6.1 and packaged with the Application Builder
    that we need to call from a CVI test library DLL. They say they can't
    supply us with a non-LabVIEW implementation. We installed the LabVIEW 6.1
    run-time. We added code to the CVI test library to dynamically load and
    unload the LabVIEW DLL using LoadLibrary and FreeLibrary. LoadLibrary is
    called in a function in the MainSequence Startup step group, FreeLibrary is
    called in a function in the MainSequence Cleanup step group.
    Things run as expected when the CVI DLL is built as Release or Debug and the
    CVI
    adapter is configured to run in-process.
    However, if we try to debug CVI DLL by building it as Debug and configuring
    the CVI adapter to run in an external instance of CVI, things hang the first
    time we try to step into, or run, a CVI test library step that calls one of
    the functions in the LabVIEW DLL. On the Applications tab in Task Manager,
    the item named LabVIEW is marked as 'Not Responding'. The only way to
    recover is to kill the LabVIEW process, which takes down CVI and TestStand
    with it. If none of the LabVIEW DLL functions are called, no problems are
    seen (no hang).
    I assume the problem has something to do with the library getting mapped to
    the wrong process space (TestStand v. the external CVI instance). Is there
    any way to solve this problem? Any ideas or suggestions would be
    appreciated.
    Joe

    > Out of curiousity, what happens if you attempt to debug your DLL from
    > CVI? For example, configure TestStand to run its steps 'inProcess'...
    > but then close the TestStand application and in CVI, configure it so
    > that the Specified External Process dialog points to TestStand's
    > SeqEdit.exe (CVI launches TestStand when debugging the project). Once
    > TestStand is running, run your test and set your break points as
    > usual, you should be able to step into the CVI code if nothing else.
    > If not, I would be interested in hearing what problems you encounter.
    When 'debugging' SeqEdit from CVI, we experienced no lock up.
    Thanks for this suggestion. Debugging from CVI is a workaround for now,
    though not highly desirable as it is reverse from normal debug proc
    edure
    (user can't step into CVI from TestStand). Still would like to know if
    'normal' debugging of this problem is possible.
    > The nice thing about debugging directly from Labwindows/CVI while
    > TestStand runs 'inprocess' is that you can avoid some library linking
    > errors, which may be the source of the troubles you are seeing.
    The problem appears to be general to LabVIEW DLLs called from an external
    instance of CVI under TestStand. We were able to reproduce the problem with
    a simple LabVIEW VI compiled to a DLL, then called from a simple CVI DLL
    under TestStand. We will package up some sample code and submit it to NI
    tonight or tomorrow.
    Thanks for you help.
    Joe

  • Debugging Labwindows dll in teststand with CVI 9.1.1

    Is there a known problem when debugging Labwindows DLL used as Teststand Code module ( using the Labwindows CVI Adapter)?
    My setup includes to powersupplies with IVI instrument drivers ( Agilent 6032A and and E3634 A) a a few other instruments with non-IVI instruments drivers. When start CVI, load the dll project and then start the Teststand Sequence editor as program to be debugged an then step into the C-Code it looks like there is process that watches both powersupplies and tries to reset them again if I access them from my C code through the instrument driver. There is no such effect with the non-IVI instruments and also if I run the code outside the debugger there is no such effect.
    Any Ideas whats going wrong here ?
    Solved!
    Go to Solution.

    some more information. I#ve updated now to CVI 2010 and the effect still exists. To demonstrate it I've attached a NI SPY log. The 6032A lives at GPIB ID 3 the E3634 at GPIB ID 5. I'am running the following code:
    Fmt(resource_id,"GPIB::%d::INSTR",addr_PS_P24V);
    tsErrChk(status = hp6xxxa_init (resource_id, VI_ON, VI_ON, 2, &Instr_Handle_PS_P24V));
    // Export Instrument handle for PS_P24V
    tsErrChk (TS_PropertySetValNumber (testData->seqContextCVI, &errorInfo,
    "FileGlobals.Instr_Handle_PS_P24V", 0x1,
    Instr_Handle_PS_P24V));
    //set limit voltage and current
    // status = hp6xxxa_603xA_soft_limits (Instr_Handle_PS_P24V, 30, 0.5);
    tsErrChk (status = hp6xxxa_603xA_fold (Instr_Handle_PS_P24V, 0));
    //set voltage and current depending on device A/AP 10A B/C 11.5 A
    if ( is_ALA_B_device( testData->seqContextCVI) || is_ALA_C_device( testData->seqContextCVI) )
    tsErrChk (status = hp6xxxa_volt_curr (Instr_Handle_PS_P24V, 26.0, 11.5, 1));
    else
    tsErrChk (status = hp6xxxa_volt_curr (Instr_Handle_PS_P24V, 26.0, 10.0, 1));
    tsErrChk (status = hp6xxxa_delay (Instr_Handle_PS_P24V, 0.500, 1));
    Delay(.2);
    //output off
    tsErrChk (status = hp6xxxa_output_onoff (Instr_Handle_PS_P24V, 0, 1));
    Delay(.2);
    [... later for the E3634]
    // Get GPIB-Adress of PS_P3V3
    tsErrChk(TS_PropertyExists(testData->seqContextCVI, &errorInfo, "FileGlobals.GPIB_ADDR_PS_P3V3", 0, &propertyExists));
    if (propertyExists)
    tsErrChk (TS_PropertyGetValNumber(testData->seqContextCVI, &errorInfo,
    "FileGlobals.GPIB_ADDR_PS_P3V3",
    0, &GPIB_ADDR_PS_P3V3));
    addr_PS_P3V3 = GPIB_ADDR_PS_P3V3;
    #ifndef NO3V3 // NO 3.3V programmable source on TK2
    // Initialize PS_P3V3
    Fmt(resource_id,"GPIB::%d::INSTR",addr_PS_P3V3);
    tsErrChk(hpe363xa_init (resource_id, VI_TRUE, VI_TRUE, &Instr_Handle_PS_P3V3));
    // Export Instrument handle for PS_P3V3
    tsErrChk (TS_PropertySetValNumber (testData->seqContextCVI, &errorInfo,
    "FileGlobals.Instr_Handle_PS_P3V3", 0x1,
    Instr_Handle_PS_P3V3));
    hpe363xa_ConfigureOutputRange (Instr_Handle_PS_P3V3, "",
    HPE363XA_VAL_RANGE_VOLTAGE, 5);
    hpe363xa_ConfigureVoltageLevel (Instr_Handle_PS_P3V3, "", 3.3);
    // Output off
    hpe363xa_ConfigureOutputEnabled (Instr_Handle_PS_P3V3, "", VI_FALSE);
    hpe363xa_ConfigureCurrentLimit (Instr_Handle_PS_P3V3, "",
    HPE363XA_VAL_CURRENT_REGULATE, 0.5);
    hpe363xa_ConfigureOVP (Instr_Handle_PS_P3V3, "", VI_TRUE, 4);
    #endif
    #ifdef TK3 // use E3640 powersupply for TK3
    Fmt(resource_id,"GPIB::%d::INSTR",addr_PS_P3V3);
    tsErrChk(hpe364xa_init (resource_id, VI_TRUE, VI_TRUE, &Instr_Handle_PS_P3V3));
    // Export Instrument handle for PS_P3V3
    tsErrChk (TS_PropertySetValNumber (testData->seqContextCVI, &errorInfo,
    "FileGlobals.Instr_Handle_PS_P3V3", 0x1,
    Instr_Handle_PS_P3V3));
    hpe364xa_ConfigureOutputRange (Instr_Handle_PS_P3V3, "1",
    HPE364XA_VAL_RANGE_VOLTAGE, 5);
    hpe364xa_ConfigureVoltageLevel (Instr_Handle_PS_P3V3, "1", 3.3);
    hpe364xa_ConfigureCurrentLimit (Instr_Handle_PS_P3V3, "1",
    HPE364XA_VAL_CURRENT_REGULATE, 0.5);
    hpe364xa_ConfigureOVP (Instr_Handle_PS_P3V3, "1", VI_TRUE, 4);
    // Output on
    hpe364xa_ConfigureOutputEnabled (Instr_Handle_PS_P3V3, "1", VI_TRUE);
    #endif
    If you look into the Spy Log you will see at #241 the first hit of that strange process, which beginns with a viOpenDefaultRM
    and ends with a viClose at #252
    after issuing an *IDN?, which fails because the 6032A doesn't support *IDN?. Then the first driver call ( init function) can be identified.
    later on , when the code goes to the E3642 using ID5 at #1142 in SPY log you will see that the strange process will finally send a *RST if the *IDN? succeeds.

  • Dll created in visual studion with /CLR option won't load by cvi

    i have created a small dll, which holds 1 exported function.
    The dll is created in VisualStudio2008, sp1
    With option /CLR, targetting .NET framework 2.0
    The export is like below:
    extern "C"  int __declspec(dllexport) __stdcall testHelloWorld(void)
      System::Console::WriteLine("Hello world") ;
      System::Console::WriteLine("Hit the any key") ;
      System::Console::ReadKey() ;
      return 0 ;
    The following code should run this dll, from cvi 9.0.1 (375)
    extern int __stdcall testHelloWorld(void) ;
    typedef int (__stdcall * HelloWorldPtr) (void) ;
    void main(void)
    { HMODULE hLib = 0 ;
      HelloWorldPtr doit ;
      SetStdioPort (HOST_SYSTEM_STDIO);
      SetStdioWindowVisibility (1);
      hLib = LoadLibrary("CppTestClr.DLL")  ;
      (FARPROC)doit = GetProcAddress(hLib,"_testHelloWorld@0");
      doit() ;
    //  testHelloWorld();
    When i run the dll with run time linkage (as show above) there is no error, all ok.
    When i try to run the dll with load time linkage (line 'testHelloWordld' linked-in ),
    cvi shows an error 'A non-debuggable thread caused a general protection fault at address...'.
    This message is shown before the main function is reached.
    Visual studio has no problem in running the code from a win32 console application.
    Labview runs the code without problems.
    Why won't cvi load the dll ??
    tnx.

    nickb wrote:
    A solution will be available, but due to the complexity of this issue LabWindows/CVI 2010 will not work for you out of the box - a configuration will have to be made.  I've made a note to come back and update this post when LabWindows/CVI 2010 releases with instructions concerning this configuration.
    NickB
    National Instruments
    I'm an SSP member, so i'll receive the new version automatically.
    Maybe it's a good idea to also create an entry in the release notes of version 2010.
    These are my first attempts in using c++ dll's as a .NET wrapper for cvi.
    But it looks very promising. Comparing to the .NET wrappers in cvi it's much more convenient (native way of working).
    I would like to be able to use this as a generic way of working.

  • Missing export kernel32.dll when using cvi 9.0 on win 64

    Hi,
    I just have a new computer (windows 7 64 bits) : PC 1 for short.
    My old computer was a windows xp 32 bits : PC 2.
    I compile my programs with CVI 9.0.
    When I compile a program with PC 1 :
    - the install works on PC 1 & PC 2
    - the prog installed works on PC 1
    - the prog installed doesn't work on PC 2 : Missing export ...... from 'KERNEL32.DLL'
    Somebody has an idea?
    Solved!
    Go to Solution.

    Hi,
    if your program uses some functions from Windows SDK included in kernel32.dll, the program really depends on this library.
    The problem is that for this reason CVI includes kernel32.dll when you build a distribution kit (on the target PCs you should find a copy of kernel32.dll in a subfolder of the one where you installed your application).
    The problem is that CVI takes this dll from your development PC (Win 7) and your target PC (XP) can't work with this dll. Win XP has its own copy of kernel32.dll, but MS Windows Operating Systems load dlls from application folder before than from system folder.
    And so, simply remove the kernel32.dll dependency and rebuild the distribution kit.
    This is a general behavior of CVI and can bring to several problems. I've already reported this to NI, because Operating System dlls must not be included in a distribution kit. If the target OS lacks of some core dll, this is a severe problem, and it's not a situation that CVI can fix simply using some local copies of these dlls.
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

Maybe you are looking for