AbdulQuader Posted May 20, 2019 Report Share Posted May 20, 2019 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? Quote Link to comment
Rolf Kalbermatter Posted May 29, 2019 Report Share Posted May 29, 2019 (edited) 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 May 29, 2019 by Rolf Kalbermatter Quote Link to comment
Aristos Queue Posted May 30, 2019 Report Share Posted May 30, 2019 @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. Quote Link to comment
ShaunR Posted May 30, 2019 Report Share Posted May 30, 2019 (edited) 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 May 30, 2019 by ShaunR Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.