CVI Api Window7

Hi,
Actally i develop my stuff under XP. Everything is working fine.
The were some maschines running under Windows7. The maschines are crashing in custom user interface created with .net
while executing  models GetReportBody_CImplementation of modelsupport2.dll (old deriavte shipped with TS2.0 rebuilt with CVI8.5)
I would like to setup a CVI 2010 Debug environment but this fails because no TS-CVI-AP fp are installed on the machine.
If you try to open the TS-shipped Cvi UI-Project. CVI says that "Program Files(x86)\National Instruments\Shared\CVI\instr\TestStand\API\xxx.fp"
are not present. I have a german Window7 that comes with "Programmme(x86)\National.... but there is no xxx.fp file left. 
I tried to find it somewhere on the hole drive without success.
  --> How i get the CVI TS api installed on a german maschine ?
Another couriousity i reallized, running a model's sequnce with shipped "Simple UI" in .net and cvi it is crashing, too.
if you try it in  "Full Featured" or with the Editor, it is running well.
Regards
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
Solved!
Go to Solution.

Hi
In RecursiveSubProperties there is a pointer char *display = NULL;
Normally this will point to memory ActiveX allocated with:
errChk(TS_PropertyGetFormattedValue (propObject, &errorInfo,"", TS_PropOption_DecimalPoint_UsePreference,"", VFALSE, "", &display));
But if the PropertyObject is a container or array it points to "internal" memory
display = "...";
At the end of the code there is release of ActiveX memory
CA_FreeMemory(display);
And here it was crashing if the pointer was not allocated by ActiveX 
At the moment just one Windows7 maschine was affected
All other maschines with XP and Windows7 (and over there years there were 98,NT,2000) doesnt care about it
And now after fixing it, it is running on all maschines
Regards
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

Similar Messages

  • TDMS functions much slower in CVI 2010

    Hello everyone.
    Today I noticed that at least some TDMS functions are much slower in CVI 2010 compared to CVI 2009 SP1 and prior. I have created and attached a simple sample project that creates a TDMS file with about 3000 file level properties and tries to read it back in afterwards. On all releases prior to 2010, this needs less than 10 seconds. On 2010 it's around an hour, if not more! Unfortunateky this is pretty much a show-stopper for me. Any comments?
    Thanks, Marcel 
    Attachments:
    tdmsTimingTest.zip ‏3 KB

    Hello Marcel -
    What you've reported is actually a known issue, and is unfortunately considered to be expected behavior.  Let me try to explain:
    There was a relatively large refactoring of the underlying TDMS code in LabWindows/CVI 2010.  This refactoring was intended to more closely align our internal implementation to that of LabVIEW.  As a result of this refactoring, we were able to address some internal issues we had previously been unable to address, as well as more correctly handle the data stored in the TDMS file.  Unfortunately, this refactoring unmasked a performance issue that had always been present when reading a large number of properties one at a time.
    This performance issue was not uncovered for LabWindows/CVI 2010 because we had previously focused our performance testing on reading and writing data to a file, not metadata.  We considered it unlikely that a customer would have more than dozens of properties for any one channel or group or file, and as a result, the performance issues you've reported were overlooked.
    However, we did recently find the performance issues you've reported.  As a result, there will be a handful of undocumented functions for returning all (or a subset of) properties on a channel, group, or file in LabWindows/CVI 2010 SP1.  This will allow for performance in line with what you'd seen in LabWindows/CVI 2009 SP1 and earlier, as long as you are OK with grabbing all the properties at once.  These functions are undocumented because, in general, we don't release new features with service packs.  Also, the functions are a little more difficult to use than normal CVI APIs, so we have not yet determined how or when they will be publicly documented.  When LabWindows/CVI 2010 SP1 releases (later this summer), feel free to reply back to this post or send me a private message, and I'll work with you on the details of calling these undocumented functions.
    Out of curiosity, we'd like to know your use case for creating that many properties.  You're the first customer we've encountered using such a large number of properties, and we'd like to ensure that we are able to satisfy your use case in future versions of the API.
    Thanks for the report, and I'm sorry for any inconvenience this has caused,
    NickB
    National Instruments

  • How to get GPIB address from VISA resource

    Hi All,
    Is there a way (CVI API) to get the GPIB address of a GPIB instrument from an alias or a VISA resource name defined in MAX?
    Thanks,
    Rick.

    Thanks mkossmann, I was actually looking for an api that would get the gpib address from the visa resource name defined in MAX which has already scanned in the gpib instruments.
    I guess it may not be good that way even if there's such an api because instrument gpib address might get changed and if MAX has not been asked to rescan then the address will be out of sync.

  • TDMS DAQmx decode

    I have some DAQmx measurement data in TDMS format, and would like to analyze this data in Matlab or custom python.  I have read and understand the TDMS File Format Internal Structure documentation, but the documentation claims that "This article does not describe how to decode DAQmx data.  If you need to read a TDMS file with software that implements native support for TDMS (without using any components provided by National Instruments), you will not be able to interpret this data."
    I have tried several online solutions: TDMS Reader and ConvertTDMS(v9) at Matlab File Exchange, both of which failed due to interleaved data formatting or presence of RawDAQmx data.  I have also tried (and might still try to debug) a python version (pyTDMS), which might be failing due to poor file format documentation.
    I am next going to try the NI solution: the DLL + Matlab.  I haven't gotten into attempting an implementation yet, but from the looks of it, it's going to be a hack.  Particularly because I now have to install multiple Windows SDKs.
    I have two questions:
    1) Am I missing something?  I realize NI needs to make a profit from their product, but for the documentation to be missing key information and to have to install Microsoft SDKs is inexcusable.  Here in the real world, NI, we have mixed shops and several vendors provide the tools that we need.  Your website claims TDMS works in Matlab, but this is obviously not the case, at least not easily.  And Excel compatibility is great, but not when you have the problems of large data sets that TDMS is supposedly designed for.  NI, I've tended to avoid your products in the past because I dislike graphical programming, but you seem to be specifically preventing interoperability which might give me a new reason.
    2) What references (if any) are available regarding this "decoding" of DAQmx data?  What specifically is different if NI code isn't used?

    I wanted to hopefully explain some of the background information to hopefully answer some of the specific questions that you have.
    Please understand that NI is in no way intending to keep a closed system here. TDMS strives to be an open file format with interoperability with several environments. In that mission, NI provides several APIs to read back TDMS files: .Net API, Excel importer, C API, CVI API, and even a Matlab plugin. These provides APIs provide the best user experience as they are designed around TDMS (eg. functions refer to "groups", "channels", "properties", etc).
    It sounds like you had an issue with the Excel add-in with large data sets; I knew that this was an issue in Excel 2003 and previous versions as Excel did not support large data sets. I thought with Excel 2007, we update the importer to work well with Excels new capabilities. If not, we should definitely look into that.
    The link that the first reply mentions should yield the Matlab API that works with DAQmx scaled data. If you have further problems with it, please make sure to let us know.
    I wasn't sure what your concerns surrounding Windows APIs are as I'm not aware of any of our products installing a Windows API. Could you please elaborate if its a particular concern so that we can look into that?
    The reason why I mention all of these supported APIs is not to push them because they are NI-provided solutions. I mention them because I believe that they will make your application the most successful.
    We document our raw binary layout, but this should only be used if there's not an easier way to get your job done.
    All that being said, to answer your second question, the raw data in a DAQmx TDMS file simply consists of data in the same exact format that you get if you were to call DAQmx Read Raw. The output is a binary blob of interleaved channel data from the ADC without calibration or scaling. The process of deinterleaving that data and applying all of the necessary information with the exact numerical precision is fairly complex and error-prone if left to every user. In many ways, thi is why we created the built-in TDMS logging feature into DAQmx - so that users could stream with the best performance possible without having to implement difficult algorithms. DAQmx does not provide documentation for its raw data format.
    I do not recommend trying to implement that code yourself if we have a solution that integrates well and does the heavy lifting for you. If you really want to look into some of the details, we can aid you some in this effort.
    Sorry for the long post, but I wanted to make sure you understand that there was no ill will from NI in our approach here. I hope your application is successful, and please let us know if you have any follow-up questions.
    Thanks,
    Andy McRorie
    NI R&D

  • I would like to know how to transform an API C++ application in MFC C++ application to use the measurement studio components or Labwindows CVI

    I don t know the way used to transform a C++ with API program in an MFC application using measurement studio or Labwindows CVI.
    Thank you for you help.

    You can use the Measurement Studio Add/Remove Components Wizard to add Measurement Studio components to your C++ application. For more information, see the "Adding and Removing Components from Measurement Studio Projects Using a Wizard" topic in the Measurement Studio reference. You can find it in the table of contents under:
    Visual C++ Help
    Tutorials
    Measurement Studio for Visual C++ 6.0
    If you're using the Measurement Studio update for Visual C++ .NET, this topic will be under:
    Visual C++ Help
    Tutorials
    Measurement Studio for Visual C++ .NET
    - Elton

  • Using Windows API in my LabWindows CVI code

    Hi all.
    I would like any and all help. I am developing on LabWINDOWS 2010 and am trying to use the Windows API, particularly the multimedia APIs, in my CVI code. What I am trying to do is audio development, only it has to be in .NET or Visual C++ platform. I have developed the code and UIR, but when I build the solution it tanks on me. Of course when I use MS Visual C++ 2008 or 2010 there are no errors and I could use MS Visual C++ to develop my application, but the development of the user interface and the controls is much more straight forward with CVI and there are more controls to work with than there are with MS Visual C++. Most of the errors that I get are related to the following header files: "MMSystem.h", "devicetopology.h",  and the "endpointvolume.h". When I try and build a skelton project with no controls or indicators on the .UIR I get the errors like:
    "devicetopology.h"(2301,20) Missing parameter type.
    "devicetopology.h"(2301,40) syntax error; found '*' expecting ')'.
     "MMSystem.h"(151,1) Unrecognized declaration.
    "MMSystem.h"(850,96) syntax error; found 'identifier' expecting ')'.
    That is just a few of them, but they typically say the same thing. I have included the header files and libraries in my project, and  have made sure that they are in the CVI "sdk" directory. I have tried example code that have these header files and the result is still the same. I know that I should not have these type of issue, at least I don't think I should. Like I said I could use as much help as possible of figuring out what is the matter. Did I install the CVI improperly? Are there patches that I need to actually use windows APIs? I am attaching to this post my code and the code I downloaded from a LabWINDOWS forum. When I ran the code from the forum I got the same errors.   
    Thanks in advance.
    Attachments:
    AudioVolume.c ‏2 KB
    VISTAS-OpenAL.c ‏44 KB

    Humphreyy,
    thanks for the tip. I tried it but it did not work, the same errors were present. Are there any other suggestions. I have racked my brain to figure out why this is happening and have come up with nothing. I am also getting a "Warning" message concerning the "KsMedia.h" file that says "Warning: Excess characters in multibyte character literal ignored." The warnings trace back to the "typedef enum" section of that file. Could that be causing a ripple effect that produces the error I am seeing in the other header files I mentioned??
    I could really use your help and any more help that is available. I really don't want to use Visual C++, because this software is going to get more sophisticated and is to be used in NASA Langley's VISTAS simulator, an environment taylor made for National Instruments software.

  • I downloaded a third party API from ICQ to consider to integrate ICQ with my CVI application.

    There are three main issues standing in my way: 1) the include files have some wierd definitions for example:
    BOOL WINAPI ICQAPICall_GetOnlineListPlacement(int &iIsShowOnlineList);
    BOOL WINAPI ICQAPICall_GetWindowHandle(HWND &hWindow);
    CVI is complaining about the &.
    2) the other issues deals with a link error "undefined symbol
    _ICQSet_LicKey@12". I suspect that I have an import library issue? They did
    claim that the api is in a icqapi.dll which they supplied me. They also
    supplied a icqapi.lib file, which I am assuming is the import lib? If not,
    can someone remind me of how to build an import lib from the include files?
    3) the email list for
    CVI doesn't seem to be working.

    Rich:
    I believe the source of your problem is that you are attempting to use a C++ DLL in LabWindows/CVI--which is an ANSI C compiler and does not support C++. The ampersand "&" used in this context signifies a variable passed by reference, which is not available in ANSI C. Furthermore, C++ DLLs usually use name mangling, which ANSI C does not support. Name mangling probably explains your link errors.
    You can use the phrase extern "C" around the prototypes in a header file to disable C++ name mangling so the DLL can be used in ANSI C. However, this change would require you to re-build the DLL from source that you probably don't have. You can ask LabWindows/CVI to build an import library from the DLL and the source code, but LabWindows/CVI will not mangle the names in
    the header file and thusly won't be able to find them in the DLL.
    This doesn't leave many alternative that I can think of, especially if the API in the DLL uses call by reference. The best people to talk to would be ICQ; ask them if there exists an ANSI C API, and explain why this DLL won't work in ANSI C. You may also want to contact National Instruments technical support at 1-800-IEEE-488 or http://www.ni.com/support for other possible alternatives.
    Best Regards,
    Chris Wood
    Applications Engineer
    National Instruments

  • Is it possible to make .dll file of .vi project then load it to CVI and use the APIs in the dll to CVI project

    Is it possible to make .dll file of .vi project then load it to CVI and use the APIs in the dll to CVI project?

    Hi Kumar,
    It is possible to make .dll from Labview and i think we can call the same from other programming application also.
    Pls refer the
    below link
    http://zone.ni.com/devzone/cda/tut/p/id/4038
    GAnesan KAni

  • Setting requiremen​ts on a TestStand step through the API using CVI

    I'm generating TestStand sequences using CVI.
    I have no problem to create new sequences, new steps, add parameters, set comments...
    But I haven't found how to add requirements on a step.
    Could someone give me the function(s) to call on the TestStand API to do this ?
    thank you
    Vincent

    Hey VCourousse,
    You need to get the Step.Requirements as a property object, Get the Links object from that and then SetValStringByOffset.  Links is an array of elements in the Requirements property.
    Here's what it'd look like:
    PropObjectReq = Step.Requirments
    PropObjectLinks = PropObjectReq.GetProperyObject("Links", 0)
    PropObjectLinks.SetValStringByOffset (elementinRequirements, 0, NewValue)
    Hope that gets you on the right path.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Using Excel with Visual C++ 6.0 (need a graph control that behaves as much like the one in CVI as possible)

    I hate to beat this to death but I was unable to find a
    clear answer to this question.  Does NI provide Excel control from within
    Visual C++ 6.0? 
    I read that NI supports the ANSI-C library only for Visual C++ 6.0 users:
    Thread : "Re: Benifits of using measurment
    studio for VC++ 6.0?"
    NI REP : drohacek
    Quote  : "we made the decision to support Visual
    C++ 6.0 users only through the ANSI-C interface and not through the Measurement
    Studio MFC-based class libraries."
    If there is a suggested way of controlling Excel from within Measurement Studio
    for Visual C++ 6.0 then I’d love to know it. 
    If not, can a plain statement be made basically stating that if you want
    to control Excel you can’t use a Visual C++ 6.0 environment even with Measurement
    Studio support?
    With .NET of course you can just decide to have Excel support added during
    project creation.  CVI can act as an ActiveX server and easily control
    Excel just by building off the examples shipped with CVI.  I see that
    there is support, using the Measurement Studio for Visual C++ 6.0 Project Wizard,
    for taking existing CVI projects and converting them to Visual C++ 6.0 projects
    or for calling CVI libraries from a .dll from within Visual C++ 6.0.  I suppose I could do the work
    in CVI and then convert the project but I'm so deeply tied into all my MFC calls that I don't see
    how I can cleanly include the CVI libraries into my existing VC++ 6.0 projects.
    What I'm really after here is a visual graph control like the one in CVI that I
    can use from Visual C++ 6.0.  I purchased a 3rd party graph control for use
    in VC++ 6.0 that works well but isn't really visual.  I mean you can't
    enter any values in it until you run the program and fill it out programmatically. 
    Then you can see which columns are two narrow, quit the program, adjust the
    column width of your now empty control, and repeat, until you get the thing
    looking the way you want.  If I could call into Excel from within Visual
    C++ 6.0  the way I do from within .NET
    then I could use Excel to hold the table and just read in the values into my table
    control at run time.  Basically I'd use Excel as a visual development tool
    for all my tables.
    I do all my coding from within CVI and Measurement Studio for Visual C++
    6.0.  I'd use CVI for everything if I didn't depend so heavily on certain
    outside controlled C++ .dll's.  Could you please suggest then what I can
    do to get Excel support for Visual C++ 6.0?
    Last question :
    Is there any plan to ever have a NI table control like the CVI table control for
    use in Visual Studio?  One that you can
    completely set up before you do any compiling? 
    I imagine that the way Microsoft sets up their environment makes this idea impossible.  Otherwise someone would
    have come up with a truly “visual” table control before now.
    Thanks,
    Grant
    Grant M. Johnson
    Project Engineer
    LECO Corporation

    Hello Grant
    You can most certainly use Excel with VC++ 6.0. Measurement Studio won't provided you with any classes to talk to Excel in VC++ 6.0. This is because Excel allows control via Automation and you can use its automation API to do anything you need with Excel. This is what CVI uses as well.
    You can see this MSDN article on how to set this up. This mentions VC.NET, but it should work the same way.
    Here is one that talks about VC 6.0 and Excel.
    Here is a code project article about this.
    Even with .NET, you have to do thru the Excel Automation support. Excel started shipping with Primary Interop Assemblies (PIA) which are .NET wrappers about the Excel Automation object model. C++ Automation is definetely not as nice as .NET, BTW
    See this document for more information about the Excel object model.
    I would not recommend using the CVI Excel libraries if all you want to use them for is Excel automation. You will end up creating un-necessary dependencies and go through extra layers that way. You can make calls straight to Excel from VC++ without requiring CVI.
    One quick observation about your excel approach. If you decide to use Excel as your table, you might be requiring everyone who uses your application to have Excel installed on their machines. Just wanted to make sure this was acceptable to you.
    Have you looked at the Datagrid Activex control, which is one of the common controls that ships with Visual Studio? You can add it to Visual Studio by right-clicking and picking it from the list of installed activex control. If you have not already, you should check it out.
    Microsoft has made significant improvements in the number of controls they provide with .NET. They have a Datagrid control that seems to be what you need.
    Measurement Studio did add some high level classes for Excel and Word Automation that simplify some common tasks, but these exists for VS 2003 C++ and VS 2005 C++, not for VC 6.0. Underneath, we end up using the same Excel automation classes, so you can easily setup something similar for VC 6.0. Plus you can find alot of references online on how to use the Excel Automation object model with C++.
    We currently have no plans in Measurement Studio to create a table control unfortunately. I am assuming when you said graph, you actually meant table, since Measurement Studio already  provides a ActiveX graph controls for VC++ 6.0 that is very similar to the CVI graph.
    On a side note, VC++ 6.0 is really really old. Have you considered upgrading?
    To summarize
    - Yes, you can use Excel with Vc++ 6.0 without mstudio.
    - Try using the Datagrid Activex control if you just need a table.
    - Measurement Studio provides high-level excel and word classes for VC++ 6.0
    - Measurement Studio provides a graph control for VC++ 6.0 which is very similar to the CVI graph.
    - Measuremnt Studio does not have a table control.
    - VC++ 6.0 is really really old. Have you considered upgrading?
    Bilal Durrani
    NI

  • Calling a Visual C++ dll from CVI

    I created a dll in visual C++, try to access it using .Net library APIs of CVI.
    I am able to create the object of the class “Class1” correctly, but when I try to invoke a function of the class, I got error  -6587(inaccessible error).
    I attached my code, dll code for your reference.
    Attachments:
    Maxnumeber.zip ‏3 KB
    test1.zip ‏820 KB

    Can you provide a screen shot of the error you are receiving? Have you marked the functions you are trying to call with extern C to specify that they are going to be used with the C compiler? Please see the followling link which discusses this topic.
    http://www.ni.com/white-paper/3341/en#toc9
    Regards,
    Anjelica W.
    National Instruments
    Applications Engineer

  • CVI localtime to get the Day of the Year

    I have a vendor supplied driver that needs the day of the year (0-365), minutes, hours, seconds for their board so that it updates itself to the correct time. I am looking at the LabWindows/CVI functions time and localtime to get this information. Those calls are documented in   ...\CVI2010\include\ansi\time.h   with the code contained within  C:\windows\system32\cvirte.dll
    when I set up the module within TestStand, I get a message that states:
    This function either does not have parameter information in the DLL or user types not recognized by TestStand.
    Not a problem. I used the information within time.h to setup the parameters for the function time. That function works fine. The function localtime returns a structure with the individual time elements. I created a Custom Data Type to define the structure. I cannot seem to determine how to define the module for this action so that it will work.
    I am including the sequence file, .h file, and the dll to help you understand what I am attempting to acomplish. Perhaps I am not using the correct dll or there is a better option. Any help would be appreciated.
    NOTE: I could not attach a DLL so I renamed the extension to LLB. You will need to rename it back to DLL.
    Attachments:
    Test.seq ‏5 KB
    time.h ‏4 KB
    cvirte.llb ‏5686 KB

    Hey Bill,
    I think what might be causing issues is that you are calling directly into the CVI Run-Time Engine, which we do not publish an API for and generally do not intend to be called directly from another application. I would recommend creating a simple DLL in CVI to call the functions you want, such as localtime(). This will allow you to use the CVI function panels and other Help resources to correctly configure your function call. You can simply create a wrapper function which calls localtime and returns the value you are interested in. If you build this wrapper code into a DLL, you should be able to call it from TestStand.
    I hope this helps, and let me know if you have any more questions about it!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • How to access the result list in teststand after execution using labwindows​/cvi

    I am developing a user interface in labwindows/cvi that runs multiple teststand sequence files and would like to combine their reports (generated in teststand) into a single file at the end of a UUT. What is the best way to do this? At the moment, I'm trying to access the result list local variable after the execution has ended using API calls from labwindows/cvi and an end-of-execution callback event but those run-time variables do not exist anymore. How do I get a hold of the result list array at the end of an execution? I would like to grab this variable and pass it along from sequence to sequence using labwindows/cvi and not teststand itself. Is this possible? Any help would be great.
    Thanks in advance,
    Luis

    Hey Luis,
    Check out the response to this thread at the NI TestStand board here!

  • Text-to-sp​eech in CVI ?

    Hi,
    I'm just working on a CVI project and I wish to implement some
    text-to-speech function.
    My purpose is to inform the operator that some problem occurs in the
    process, both with a standard message popup and a "vocal" one. I can't
    use waves
    as I want my messages to be "real time" adapted.
    Does someone tried somthing like this ?
    Regards,
    Fred.

    > I'm just working on a CVI project and I wish to implement some
    > text-to-speech function.
    I remember trying out some Microsoft Speech API some years ago. Didn't have
    the time to finish though...
    if you have the MSDN:
    mk:@MSITStore:V:\MSDN\period96.chm::/html/msj/S233​.htm
    mk:@MSITStore:V:\MSDN\backgrnd.chm::/html/overview​api.htm
    When there is a problem, I like it better if the computer catches fire. It
    gets the user's undivided attention much faster !!!
    Guillaume Dargaud
    CNR/IFA
    http://sung3.ifsi.rm.cnr.it/~dargaud/
    http://sung3.ifsi.rm.cnr.it/~domec/
    http://www.appennini.it/roma8000/
    http://sodarserver.ifa.rm.cnr.it/
    "So far as I can remember, there is not one word in the Gospels in praise of
    intelligence." Bertrand Russell.

  • Problème arrêt acquisitio​n sur graphique CVI

    Bonjour,
    voici mon problème :
       je fais l'acquisition de température en continue mais je souhaiterais l'arrêter aprés un certain temps
    Le problème c'est que plus je diminue mon sleep plus plus l'acquisition sur le graphique mets de tempsà s'arrêter
    voici mon programme
    #include "graphessai.h"
    #include <windows.h>
    #include <NIDAQmx.h>
    #include <formatio.h>
    #include <analysis.h>
    #include <ansi_c.h>
    #include <cvirte.h>    
    #include <userint.h>
    #define echelletc                30
    #define offsettc                -50
    #define nbpointtc                10
    #define NUM_PLOTS           20100
    #define ABS_DATE_TIME_FORMAT_STRING "%X  %B %#d, %Y"
    #define REL_DATE_TIME_FORMAT_STRING "%#M:%S.%3f"
    #define MSG_FORMAT_STRING "Current window: %s  -  %s"
    static int PanelHandle, PlotArray[NUM_PLOTS] = { 0 }, CurrentPlotIndex;
    static double StartTime;
    static void TakeSample (void);
    double tc1[10];
    double tc_mean;
    double curTime;
    TaskHandle tc1_task; 
    int main (int argc, char *argv[])
        if (InitCVIRTE (0, argv, 0) == 0)
            return -1;  /* out of memory */
        if ((PanelHandle = LoadPanel (0, "Graphessai.uir", PANEL)) < 0)
            return -1;
        DAQmxCreateTask("TC1",&tc1_task);
        DAQmxCreateAIVoltageChan (tc1_task, "PXI1Slot5/ai6", "", DAQmx_Val_RSE, 0, 10, DAQmx_Val_Volts, "");
        DisplayPanel (PanelHandle);
        RunUserInterface ();
        DiscardPanel (PanelHandle);
        return 0;
    int CVICALLBACK QuitCallback (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        switch (event)
        case EVENT_COMMIT:
            QuitUserInterface (0);
            break;
        return 0;
    static void TakeSample (void)
        double value;
        double i;
        for(i=0;i<20/0.001;i++){
                DAQmxReadAnalogF64 (tc1_task, 10, 10.0, DAQmx_Val_GroupByChannel, tc1, 10, NULL, 0);
        Mean (tc1, 10, &tc_mean);
         if (StartTime == 0.)
            StartTime = curTime;
        GetCurrentDateTime (&curTime);
        value = tc_mean * echelletc+offsettc; 
        // gPlotArray is a circular buffer; if we've looped around, discard the old plot
        if (PlotArray[CurrentPlotIndex])
            DeleteGraphPlot (PanelHandle, PANEL_GRAPH, PlotArray[CurrentPlotIndex], VAL_DELAYED_DRAW);
       PlotArray[CurrentPlotIndex] =PlotXY (PanelHandle, PANEL_GRAPH, &curTime, &value, 1, VAL_DOUBLE,
            VAL_DOUBLE, VAL_CONNECTED_POINTS, VAL_EMPTY_DIAMOND, VAL_SOLID, 1, VAL_RED);
                  Sleep (1);   
            if (++CurrentPlotIndex == NUM_PLOTS)
            CurrentPlotIndex = 0;
    int CVICALLBACK START (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        switch (event)
            case EVENT_COMMIT:
             TakeSample ();
                break;
        return 0;
    j'aimerais que l'acquisition s'arrête au bout de 20 SEcondes (juste pour l'exemple plus tard il faudra que je l'arrête au bout de 24 h)) mais mon programme s'arrête environ 25 minutes plus tard
    si quelqu'un à une idée elle serait la bienvenue
    Cordialement

    Bonjour,
    Je n'utilise pas DAQmx pour mes applications du coup je ne l'ai pas installé et je n'ai pas accés à l'aide. Cependant ces fonctionalités étaient déjà disponibles dans le driver précédent (NIDAQ). D'après les quelques documents présent sur le site de NI, la création de mémoire tampon se fait certainement à l'initialisation de la tache d'acquisition (fonction DAQmxCfgSampClkTiming je pense). Le lancement de la tache se fera avec DAQmxStartTask et l'arret avec DAQmxStopTask puis DAQmxClearTask. Pour la lecture des données et le rafraichissement du graphe, il est possible de créer un évenement qui sera déclenché tout les N échantillons acquis (fonction DAQmxRegisterEveryNSamplesEvent). C'est dans la fonction associée a cet évènement qu'il faudra utiliser la fonction "xxxRead" pour lire vos échantillons et les afficher. A vous de dimensionner la mémoire tampon et le nombre d'échantillons qui provoquent l'évènement afin d'obtenir un rafraichissement du graphe plusieurs fois par seconde. J'espère que cela va vous aider ... sans carte d'acquisition et sans aide sur l'API de DAQmx je ne peux pas vous en dire beaucoup plus !  Fouillez dans les exemples de code, il y a certainement un exemple d'acquisition avec mémoire tampon (Buffered acquisition) et un autre sur les évènements DAQmx.
    cordialement,
    Stéphane        
    Labwindows/CVI user since version 4.0

Maybe you are looking for