Jump to content

Recommended Posts

Hi,

Say, I am going to build a system and control it using labview through DAQ.

For example, the system has stepper motors to move a heating chamber back and forth, a temperature monitoring system, a pressure controlling gauge etc.

Now, before diving into building the actual system, Is it possible to make a simulation of the whole device and integrate the necessary LV coding, where I can show on screen how the LV program controls the different parts of the system?

Link to comment
  • 2 weeks later...

It's definitely possible. But depending on how well you implement it it will possibly not be a very realiatic simulation and mostly just allow you to execute the HMI without running into errors from calling non existent hardware. A good simulation is generally non-trivial to implement and having a good architecture helps in making it not a total disaster.

Personally I tend to abstract away hardware by using LabVIEW OOP and defining a generic basic class that does nothing or implements a minimalistic simulation of the hardware and make the real hardware interface in a derived class from that basic class, possibly with different child classes for different types of hardware interfaces.

Another approach that goes even one step further in abstraction would be to use a message based framework like the actor framework.

Edited by Rolf Kalbermatter
Link to comment

@AbdulQuader As Rolf says: Yes.

You can trivially build one just by building placeholder subVIs that either do nothing or return dummy data when called, and then fill in those subVIs with real hardware calls later. 

But more sophisticated simulations are very application specific. Unfortunately, there isn't (and cannot be) a general "HW simulator API". This guide to building a hardware abstraction layer may help you design one for yourself. Or it may not help -- the PDF is one that I've handed around to many users, and it's about 50/50 chance of people either happy it is so helpful or frustrated that it is so unclear. But maybe give it a chance. 

Good luck. 

Link to comment

As everyone else is suggesting. Simulators are non-trivial and product specific. You pretty much end up reverse engineering the software in the device you are simulating.

One method I have used in the past though is message capture. This works with TCPIP, serial and other similar devices. Basically you capture/record the message strings for specific control messages and play them back to your software-usually used for testing. If your software architecture is message based, then it's trivial to switch out the endpoint just by redirecting to the comms interface instead of a play-back VI and you don't suffer from the "bug in simulator vs bug in device" problem.

Edited by ShaunR
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.