≡ Menu

02 VISV Hardware Emulation Using LabVIEW Classes


When writing a LabVIEW application that communicates with hardware. There are times when you need to have the code functional even though you don’t actually have the hardware in-hand. This could be because of time constraints. For example, parallel software development must happen while the instrument is being shipped or back-ordered. Or you’re presenting the software at a trade-show and you need a working demo without having to carry all the hardware around. In any case, you have to figure out a way to develop your application and work around this problem.

By designing your software around the use of LabVIEW classes, you can easily include hardware emulation capabilities from the start. In this video, I share a way that you can use LabVIEW classes to help you solve this problem.

Download: Code used in this tutorial (LabVIEW 2009)

Do you have any questions? Is there something you want to know about in more detail? Leave a comment below, or send your questions to feedback@vishots.com

Hey, this is Michael Aivaliotis! Thanks for reading my post, listening to the podcast or watching the video on this page. When I’m not posting content on this site, I help companies develop automation powered by LabVIEW. If you want to find out how I can help you succeed with your next LabVIEW project – Contact Me.

  • Wouter

    Nice video tutorial. Well explained and good basis for hardware emulation.

  • Yair

    Technical point – the video here was occasionally choppy and when I tried to download it it was even worse. Would it be possible to use a format such as FLV instead of QuickTime?

    • Thanks for the feedback on this. The video is actually playing in a flash player and it’s MP4 not quicktime. However, there appears to be an issue with some computers that cannot handle MP4 playback in a smooth way. I definitely want everyone to view the videos with the least amount of hassle. I’ll experiment with this and try to fix it moving forward.

      One thing to try is updating your flash player to the latest version, which I think right now is 10.x.

      • Yair

        Well, I used a link grabber which recognized it as a MOV file. My point was that after downloading it directly, it was even worse than in the browser, but that might have been due to the downloader working incorrectly (although I’ve never seen it do that before).

        My current version of Flash is 10.1, but it does seem like there is a newer version, so I’ll try that. In any case, at least in the browser the video was watchable. It just had occasional glitches.

  • will hardware emulation be available for all drivers on the idnet? Useful feature. keep blogging :)

    • Thanks for your comment. The emulation I describe in the tutorial is code that I developed myself. It’s a technique I use when developing my applications. This is not available from NI.

  • S_pinedo

    Nice tutorial,
    What tool are you using to create the video?

    • I’m using Camtasia Studio to do the screen recording and later editing. The animation is done using Powerpoint 2010.

  • K1200LT Rider

    This is great. Hardware emulation alone is reason enough to learn/use LVOOP. Can’t wait to implement it in a universal thermal chamber controller class. This gives exactly the organization, flexibility and expandability I’ve been looking for, and it should really help me clean up some really kludged up test equipment control loops I’ve had to deal with in the past. Thanks a million. I’ll definitely watch any other neat demos or tutorials that you post in the future. Doesn’t even have to be a video (I know they can be a lot of work).

    • Thanks for the encouraging words. I’m glad that I was able to spark some interest in LVOOP so you can start using it in your projects. This was one goal of the video. But be careful, once you start developing with this mindset, it’s hard to go back.

  • Pingback: 005 VISV Optimizing LabVIEW Class Loading with the Factory Pattern — VI Shots()

  • Bjarne Jørgensen

    Hi Michael

    about to make an application that counts laps on a Slotcar racing track.
    The club I am a member of, has only one data acquisition hardware for the counting system.
    if my program is a success, there are probably other clubs who will be interested in the program.
    They may have a different DAQ HW and I will then need to write new SW for that interface.
    Here it will indeed be appropriate to use a class with dynamic dispatch. Let’s call the class “LabCounter”.
    the future we might want to switch to another DAQ, which there is not written any SW for yet. How do I get it implemented?
    Can this be done without generating a new .exe file? Could it be done by dynamically calling the class “LabCounter”?

    regards Bjarne

    • Ajayvignesh M V

      Hi Bjarne,

      It has be 2 years you posted this comment. If you are still in need of answer, here it is. I have been in a project where we developed application as similar as you asked for. We have one final EXE which will adopt to instruments associated with the system. The only noticeable point was that we had classes as outsider of EXE. We just update the class libraries (methods & properites) basically which essentially enables the exe to be more adaptable model.

  • Pingback: Labview classes | Jbmobilenotary()

  • Israel Carriles

    Hey, very interesting work here. Definitely worth it.
    Dumb question, can it be implemented on NI hardware?

  • guest

    So in addition to creating a new class for another hardware option, the case structures need to be edited also, right?

  • Sebastian C

    Not sure why DMM class and lots of other things are missing after download? Can anyone help? Cannot run as it is.

  • Pingback: 002 VISP Interview With Darren Nattinger — VI Shots()

  • venu gopal

    Hi,Nice video Am new to this lvoop can you demo a rs232 Tutorial by using classes

  • natykhan

    Hi, nice work. what are the limitations of this method? how to handle more than one instrument if present? do you have to run different class wires for each?