LabWindows/CVI accessing C# program

I suppose this is a common problem.
What I want to achieve is this:
I want to do my User Interface design in C# WPF, instead of the LabWindows/CVI (*.uir), which is cumbersome and not user-friendly.
say a simple slider in C# WPF, how can a LabWindows/CVI program able to access and set those variables in C# WPF slider?
do we need to create some sort of wrapper for it? Is the .NET Library useful for this purpose?
can we have some demo to test it out?
thanks.

Hi,
    I am not too familiar with C# and CVI cooperation but maybe it is better idea to to separate C#UI and CVI code to different project.
    What i mean is.Compile one of them to library(DLL or something in C#) and then use one from other by some well defined API.
    I think this is better idea than mix lot of functions call from two different runtimes(C# and CVI)
    There is sample already shipped/instaled with CVI, some of this is about call .net function from CVI.
    You can also create your own wraper library from CVI menu Tools>Create .Net controler.Check the help file.
P.S. personaly, i like the CVI UI, and UI editor too.

Similar Messages

  • 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!

  • Book: LabWindows/CVI Programming for Beginners

    Has anyone read the followong book LabWindows/CVI Programming for Beginners LabWby Shahid F. Khalid ?
    This book in not in print anymore and  inpossible to find.
    Does anyone know of any similar source material?
    I have both LabWindows/CVI Basics I&II but the content is extremely limited and not enogh details.
    Does NI offer anything better than the embedded Help?
    A Programmers Reference would be nice.
    Thanks.

    Hello NI Nubie,
    I have that book, and also its "advanced" sequel by the same author.  They both went out of print a long time ago.  The books are OK, but they are only available on the secondary market for ridiculous prices now, and that is assuming that you can even find them.
    If I could pass on some advice that might be more helpful to you in learning CVI: pretend those books do not exist for now.  Instead, I think that for learning CVI, there is nothing better than looking at other people's CVI project-level code and really understanding it, inside and out, and then making your own modifications to it to enforce what you just learned from it.  There are several places to start looking for project-level CVI code, which I will list in (what I think) are the highest-to-lowest priority of your training.
    The first place I recommend is the examples that ship with CVI (located in the "samples" directory under the CVI installation directory).  I say this because these are supported by the NI developers and support crew.  In fact, back in 1995 when I was learning CVI 3.1, I dove into the "Icon Editor" application, for several reasons: it was a *complete* application (as opposed to the other, mostly point-solution "academic" examples under the samples directory), it showed how to segment your code into multiple source and header files, and it showed many advanced user interface features (menus, cut-and-paste).  There is now an "example finder" to help locate examples that "fit" to what you are currently trying to accomplish.  I also use the freeware "grep-like" tool called "Agent Ransack" (URL is below) to hunt down specific CVI functions and identifiers (such as certain EVENTS and how these examples use them).
    Agent Ransack on MythicSoft.com
    The second place I recommend is the other "support" locations on the NI web site.  There are knowledgebase articles, tutorials, submitted examples, community examples, and also extra "academic" examples from NI engineers that aren't the same as the ones that ship with CVI.  There are also whitepapers scattered in there as well, and a few that have hidden sample code that is embedded at the bottom of the article.  You really have to hunt for this stuff, and it would be great if the NI folks could try to index this a bit better somehow.  I sometimes even resort to using Google's search engine to find them on the NI web site, because the NI search engine may not find them.
    The third place I recommend are user-based web sites created by power-users of CVI who like to share their code.  Two that I found long ago that remain at the top of the list (in my opinion).  One is Guillaume Dargaud's site, where he has lots of CVI examples and freeware.  The other is Philippe Baucour's "Rebel" CVI site (but you will need to use an online translator if you don't speak French, though).
    Guillaume Dargaud's web site (drill down for CVI examples and freeware)
    Philippe Baucour's "Rebel" CVI web site
    Finally, you might find it interesting to know that there is a tremendous repository of C source code scattered all around the Internet, mostly as part of free and open-source software projects, many of which are supported on sites such as SourceForge.net, and many other locations.  Many of these places are filled with people (in forums or mailing list servers) who live in the C programming world on a full-time basis, and can help you through some of the advanced techniques.  Some of these projects might be targeted to Windows, some use cross-platform techniques, so they have a chance of being applied to your CVI efforts.  There is also an entire universe of programming "libraries" and capabilities that you can use to augment your CVI projects as well.  All of this because of the open-source revolution, riding on the back of GNU/Linux and the community and corporate entities that are backing it all.  Examples that come to mind are Cygwin and MinGW.  If you only have the time to just look up these two items on Wikipedia, you will see that this is just the tip of the iceberg of the possibilities that are available to you as a C and CVI programmer on Windows.
    I hope this was helpful to you.
    JB
    To whom it may concern: My alias is also my nickname, I've had it since I was a (very) skinny basketball-playing teen. OK, so I've got a 38 inch waist now, but my hometown friends haven't shaken that appellation for me. I trust that you will someday be OK with that alias, as I have been with that nickname.

  • Labwindows/CVI 7.1 Remote user Interface using Enterprise Connectivity Toolkit

    I have an application programmed in Labwindows/CVI 7.1 controlling an Electromagnetic Instrument.
    Now am interested in extending its usability by adding remote user interface.The goal is to have the application available to be accessed 
    to remote users through website,with multiple users viewing it but one user controlling the instrument remotely at any given point.
    Since the possible methods would be 1.ActiveX 2.TCP/IP 3.DLL
    Which is the best technique to implement this with out having to manipulate much of my code also do we have any documentation available ?
    Thank you
    Solved!
    Go to Solution.

    Hi Mutha,
    This functionality was a part of the orignal Internet Toolkit for CVI.  However, the web server part of this was removed and isn't included in the Enterprise Connectivity Toolkit.  You might consider using LabVIEW with the Remote Front Panel feature.
    Cheers, 

  • Permission Denied Error when calling Matlab script from LabWindows​/CVI

    Hello,
    I am reading in data from a DAQ and am writing it to a .csv file in LabWindows/CVI.  I am then sending this data to Matlab to be filtered.  I would like the filtered data to be accessed by LabWindows/CVI so that I can display it as a strip chart.  I have gotten everything to work except the writing to a file in a Matlab script that is called from LabWindows/CVI.  I am basically using the shipped example in found in the activex demo. (http://zone.ni.com/devzone/cda/epd/p/id/2994). I select the script that I want to run and each time it tries to open a file with write permissions I get a "Permission Denied" error.  This occurs when using fopen() in Matlab.  I have also tried using csvwrite() as well as dlmwrite().  Each one gives me a similar error.  The script currently does not try to do any data processing.  It just opens the file, if it is successful it then prints "hello" and then closes it.  The script works well when it is run in Matlab, just not when it is called in LabWindows/CVI.  Below is the script.  Any thoughts, comments or suggestions are greatly appreciated.  I am also open to using other approaches for sending data between Matlab and LabWindows/CVI.  Thanks in advance!!
    fclose('all');
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'hello');
        fclose('all');
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)    
    disp(errmsg)
    else  
     fprintf(file, 'hello');    
    fclose('all');
    end;

    I am using Windows 7.  I am running CVI as an administrator and was able to get rid of the "Permission Denied" error by going into the User Account Controls in windows and changing it to "Never Notify".  However, this did not fix the problem of Matlab not being able to write to a file when the script is run from CVI.  In the Matlab code below, It now gets in to the "else", suggesting that fopen() returns a good file handle.  After getting in to the else statement, it will not actually write to the file, nor does it create it.  However, I can make changes to the plot settings and those appear.  Everything is functional when run from Matlab but when run from CVI, things get screwy with opening the file for writing.  It handles the read well.  It seems like there would have to be some file permission errors but, in the CVI program, I open and write to the file "in.csv".  Any help is greatly appreciated.
    clear;
    fclose('all');
    t = zeros(1000);
    t = csvread('in.csv');
    for i=1:1000
        t(i) = t(i)*4;
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'goodbye');
        for i=1:1000
            %t(i) = t(i)*3;
            fprintf(file, '%f,', t(i));
        end;
        fclose(file);
        plot(t/3, t);
        ylabel('t');
        xlabel('Time (s)');
        title('Is this really working?!?');
    end;
    Thanks,
    Chris

  • Visual Studio or LabWindows/CVI?

    I have a bit of a dilemma.
    I currently own Visual Studio 2010, IMAQ Vision Development Module 2013, and Measurement Studio (not sure of version). I currently do all of my programming in VB.net. Because IMAQ VDM is stuck in .Net framework 3.5 and there will be no further .net development by NI, I need to plan for the future. My applications need run on Win 8, 9, 43, or whatever my company decides to migrate to from Win 7.
    My understanding is that the NI modules I currently own will work with LabWindows/CVI. Correct? I also believe I can use them with C++ using the VS IDE. Is this also correct?
    Within my applications I do a lot of interfacing with Excel, writing text files, and interfacing to non-NI devices (cameras, DAQs, scanners, etc). I am able to do these things pretty easily using VB.net using vendor-provided SDK's.
    Therefore, my question is this...given the investment I have in software already, do I gain anything by migrating to LabWindows/CVI? What do I lose?
    I should point out that regardless of the path I choose I will need to bone up on my programming skills in the corresponding language.
    Thanks for all your help!

    Hello Steverino!
    Here are some advantages when using LabWindows/CVI over Visual Studio, which make the product more suitable for various industry-related applications:
    You are correct, LabWindows/CVI integrates with the NI platform: NI hardware and software, like TestStand or LabVIEW (e.g. debugging source code from one software to another, seamlessly).
    NI hardware and third-party hardware connectivity.
    OpenMP support.
    CVI integrates with intrument control.
    CVI Run-Time benefits from User Protection.
    Run-Time checking (e.g. for uninitialized variables).
    Scientific User Interface Controls and GUI Editor.
    Advanced debugging capabilities:
    Remote debugging support from ADE.
    Real-Time debugging support from ADE.
    Memory leak detection using the LabWindows/CVI Resource Tracking Window.
    Just-In-Time debugging.
    Deployment: build custom installers and patches that you can ship as stand-alone easy-to-use installers.
    LabWindows/CVI libraries: Advanced Analysis, Toolbox, Connectivity (Network Variables, Network Streams, DataSocket), etc.
    Support for LabWindows/CVI Toolkits: SQL Toolkit, Vision, PID, RT.
    Regards,
    - Johannes.

  • Software Development Engineer positions at Hysitron, Inc. in Minneapolis (LabWindows CVI exp preferred)

    Software Development Engineer
    Hysitron, Inc. is a premier scientific instrument manufacturer. Founded in 1992 with headquarters located in Eden Prairie, MN we are committed to promoting nanotechnology by developing advanced transducer and control technology. This leadership has made Hysitron the world leader in nanomechanical test instruments. The TriboIndenter®, TriboScope®, Ubi, and other Hysitron innovations have opened new horizons for scientists interested in investigating and understanding mechanical properties of materials at nano-scale. Hysitron fosters an environment and culture where innovation flourishes, teamwork is encouraged, and superior performance is rewarded.
    Hysitron invites applications for multiple software development engineer positions from those aspiring to explore and succeed in the nano world. Hysitron, Inc. is an Equal Opportunity Employer M/F/D/V
    Job responsibilities
    The software development engineers would be responsible for developing test and measurement software applications for nano-mechanical testing instrumentation. Job deliverables would include:
    -          Develop software applications in C based Labwindows CVI for Hysitron Instrumentation
    -          Support the development of applications to address challenges in instrument automation and control
    -          Test software applications using debugging and simulation tools
    -          Perform software releases and software quality assurance activities
    -          Participate in the design of new software products
    -          Perform maintenance activities for existing products
    -          Adapt and deliver on quality software development practices
    Minimum qualifications
    -          BS in Computer Science/ Computer Engineering/ Equivalent Scientific or engineering discipline
    -          Min of 3 yrs experience in Instrumentation software development in an industrial or R&D environment
    -          Expert at programming language C, knowledge of C++
    -          Working knowledge of various communication protocols, e.g. USB, RS232, IEEE, RS485, TCP/IP, Modbus
    -          Knowledge of general software design/documentation processes in test and measurement systems
    -          Proficient problem solving skills
    -          Strong analytical and technical skills
    -          Excellent communication and interpersonal skills
    Preferred Qualifications
    -          Proficient with LabWindows CVI and XML
    -          Working experience with DSP(Code Composer Studio) and/or FPGA level programming
    -          Exposure to digital electronics and instrumentation
    -          Working experience in Robotics interface programming
    -          Experience with Controls/Automation engineering
    Application and Information
    Qualified candidates should send a letter of application and their resumes to (please include ‘SW Engineer’ in subject line):
    Hysitron, Inc.
    10025 Valley View Rd
    Eden Prairie, MN 55344 USA
    Phone: (952) 835-6366
    Fax: (952) 835-6166
    E-MAIL: [email protected]
    Web: www.hysitron.com

    This position is still accepting resumes/CVs.

  • How to use CAN256 and CAN257 in Labwindows CVI?

    I am trying to learn about CAN programming in LabWindows CVI. None of the samples do anything other than generate cryptic error messages. I do not have a card or interface device yet, but reading in the help files I found this:
    "NI-CAN provides a virtual CAN card with two interfaces, CAN256 and CAN257. The two virtual interfaces are connected by a virtual bus. When you write CAN frames to one virtual interface, those frames are received by the other virtual interface, and can be read as channels. This feature allows you to read and write CAN data in the same manner as two real CAN interfaces connected by a real CAN cable. The conversion does not require real NI CAN hardware, and your application is not required to check for specific CAN IDs."
    I modified the Waveform ouput project and add CAN256 to the dropdown in the uir file. However when I run it, I get the same error message as always, error -1074388725.
    Is there an example CVI code someplace to demonstrate the use of these virtual channels?

    Thanks Drew.
    Ultimately, my customer provided me with a WriteCAN256.vi and ReadCAN257.vi that were perfect for my needs. The WriteCAN256.vi along with my NI USB 8473s allowed me to provide data collection on multiple CAN devices and to verify that my Software can handle all data types from CAN devices.
    Note: My customer allowed me to share his .vi's. They are enclosed ...
    Best Regards,
    Don W
    Attachments:
    CanBus Read (Frames)_85.vi ‏55 KB
    CanBus Write (Frames)_85.vi ‏48 KB

  • How to set a DMA transfer type for PXIe-6536 in LabWindows/CVI?

    I have a PXI chassis PXIe-1078 with a controller PXIe-8115 running under Windows 7. The digital output board is PXIe-6536.
    I use a function DAQmxSetChanAttribute to set a property DAQmx_DO_DataXferMech to a value DAQmx_Val_DMA, since I want to use a direct memory access data transfer. This wokred well with a PCI-6534 board using the same LabWindows/CVI code before migrating it to the PXIe system.
    Unfortunately, running this code on the PXIe system reports a DAQmx error -200452: "Specified property is not supported by the device or is not applicable to the task".
    The task is created in the following simple way (the board name in MAX is 'Dev1'):
       DAQmxCreateTask ("digTask", &digitalTask);
       DAQmxCreateDOChan (digitalTask, "Dev1/port0:3", "DIG_CHANNELS", DAQmx_Val_ChanForAllLines);
       DAQmxSetChanAttribute (digitalTask, "", DAQmx_DO_DataXferMech, DAQmx_Val_DMA, 15);
    How can I solve this problem? How is it possible to choose between different transfer types?
    Thank you in advance for any hint!

    Hi CavityQED,
    The PCI-6534 is a "Digital I/O" board while the PXIe-6536 is a "High Speed Digital I/O" board, that's why they don't have the same properties.
    By the way you can use DMA transfer with this method :
    http://zone.ni.com/reference/en-XX/help/370520J-01/hsdio/direct_dma/
    Let me know if it helps you.
    Regards.
    Mathieu_T
    Certified LabVIEW Developer
    Certified TestStand Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • 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

  • LabWindows/CVI 2013 SP2 stops working when I try to open a file using the project file menu.

    I have windows 7 on my system and sometime late last year I starrted getting a Windows dialog telling me that LabWindows/CVI has stopped working when I try to open a file from the project file menu.  I also get an error when I run a project debug mode and use a selectFilePopup in the code.  The error says, "The program has suspended execution at address 0x75D5025E.  No source line information is available."  I've tried removing and reinstalling CVI to no avail.  Any suggestions?

    Constantin,
    Thank you for your response.  I've attached screnshots showing the version details for kernal32.dll and ntdll.dll.  I also looked at the updates to see which might have been installed when the problem started.  Unfortunately there are 15-20 updates every month.  I didn't take note of when the error started to occur.  At first it only affected my ability to open files from within the project (i.e. file->open->Source, etc).  Then I went back to modify a project that had a SelectFilePopup and found that that wouldn't work either. 
    Attachments:
    ntdll.dll version.jpg ‏15 KB

  • Labwindows CVI problem

    hello I´m trying to create an installer for an application created in a previous version of Labwindows CVI that a dont know becasuse i receive just de sources files, i´m working with 2010 version, the problem is that the application run perfect in debug mode but when i run it in release mode the application doesnt work, only the icon in the taskbar is showed but the graphic interface never appears, someone can help me with that
    Solved!
    Go to Solution.

    I check all source files an there is no any  #ifdef that could cause problems, the program is correct because is running in an old PC, what i am doing is trying to create an installer to change the program to a new PC, what i receive was just the folders project that are in that machine, but i can do work the program in my machine.

  • Using DLLs created with LabWindows/CVI 8.0.0 in LabWindows/CVI 8.0.1

    Hi,
    I have created a project containing some methods with LabWindows/CVI 8.0.0 and then build the project and generated the DLL and LIB files. These DLL and LIB files are working fine in another projects created in LabWindows/CVI 8.0.0 (even on another machines).
    But when I use these DLL and LIB files in a project created with LabWindows/CVI 8.0.1 on another machine and try to call the methods of these files, the following error occurs: -
    "The program has caused a 'Unknown' fault at 001B:7C812AFB"
    Is this error occurs due to ther version mismatch or there is some other problem?
    Please help me to resolve this issue.
    Thanks,
    Sarabjit Singh

    Judging from this, I don't think NI has a newer version of this tool:
    http://forums.ni.com/t5/Measurement-Studio-for-VC/Convert-project-from-LabWindows-CVI-to-Visual-Stud...

  • Using the SVDEx function in LabWindows​CVI

    Hello,
    I am writing an application in LabWindows CVI to display and analize data that we obtain in an optical experiment.  The data is a matrix where the subsequent rows represent spectra collected a different times. There are about 200 columns and 100 rows in each matrix. I want to use singular value decomposition using the  SVDEx function. I get an error every time i try to execute the code in debugguing mode:
    FATAL RUN-TIME ERROR:    The program has caused a 'General Protection' fault at 0x0342BC16.
    I believe that I am passing the incorrect arrays to SVDEx. I  was wondering if there is any example code available, so I can learn how tro do do this.
    Here is a fragment of the code where I call the function SVDEx:
    //declare the arrays to hold S U V
    double *U,*S,*V;
    int isizeS=Y_DATA_POINTS;
    int i;
    int AnalisisError=0;
    if (X_DATA_POINTS<Y_DATA_POINTS) {isizeS=X_DATA_POINTS;}
    //Allocate arrays
    U=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    S=malloc(2*isizeS*sizeof(double));
    V=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    AnalisisError = SVDEx (adAbsMap, Y_DATA_POINTS, X_DATA_POINTS, FULL_SIZE, U, S+isizeS, V);
    FATAL RUN-TIME ERROR:   "Visualize_12.c", line 2451, col 17, thread id 0x00000E18:   The program has caused a 'General Protection' fault at 0x0342BC16.
    Any help will be very much appreciated.
    J. Hodak

    Hi,
    Thanks for trying to find an answer. I just realized now where the probem was. My mistake was when i allocated the arrays for holding the matrices. Because i was assking SVDEx to carry out FUL SIZE decomposition I must declare the arrays U and V to be , Y_DATA_POINTS*, Y_DATA_POINTS doubles and X_DATA_POINTS*, X_DATA_POINTS doubles respectively. My code was wrong, I was declaring the sizes to be smaller than necessary and  "Visualize_12.c", line 2451, was the call to SVDEx, and col 17 was pointing t that mistake. It took me a while to realize this because the error message did not exlicitly specify that the size or the array passed was too small. Now it is working well. But I believe that it will help to have an example to get started with this.
    Thanks again,
    Fundadero.

  • SCPI Instrument driver for LabWindows​/CVI ?

    Is there somthing like a plain SCPI instrument driver for LabWindows/CVI
    that works with all SCPI-DMMs ?
    Thanks,
    Manfred

    Manfred Schininger wrote:
    > "Kevin B. Kent" schrieb im Newsbeitrag
    > news:[email protected]..
    > > Manfred Schininger wrote:
    > >
    > > > Is there somthing like a plain SCPI instrument driver for LabWindows/CVI
    > > > that works with all SCPI-DMMs ?
    > > >
    > > > Thanks,
    > > > Manfred
    > >
    > > SCPI like any other standard is typically non-standard.
    > > You can try to get a DMM driver and it will probably work
    > > for the most part with any DMM. There may be some
    > > slight differences and some features may not work on all DMMs.
    > >
    > > I might suggest you look into IVI drivers. These follow SCPI for the most
    > > part. You get the drivers for each DMM you want and then you have a
    > > configuration
    file that tells the program which DMM you are using.
    > > It then loads the appropriate driver.
    > >
    > > Kevin Kent
    >
    > Hello Kevin,
    >
    > thank you for your answer.
    > Unfortunately there is no specific instrument-driver for the DMM I'd like to
    > use (Keithley 2700). As I understand this would be the precondition for the
    > IVI base classes to work. My hope was to find a simple SCPI instrument
    > driver to get into the advantage of instrument independence. But you are
    > right, I also once made the experiance that the "SCPI standard" isn't
    > completely perfect.
    >
    > Manfred
    Manfred,
    You could look for a driver for another Keithly model or try one for a
    different brand. They may be similar enough to modify easily. I realize this
    goes against the idea of SCPI and standards but it is the best we have now.
    Good Luck
    Kevin

Maybe you are looking for