08-02-2024 02:18 AM
Hi everyone,
I have a question regarding which design pattern in LabVIEW is best suited for communication with measurement instruments using VISA. Specifically, I am working with various Keithley, Keysight instruments, power supplies, etc., that use the SCPI language for communication. I am looking for recommendations on which design pattern to learn and use for applications that, while not overly complex, require a responsive UI for the user. The UI should allow for switching functions of the measurement instruments and, of course, include data logging to a file, either in CSV or TDSM format. Additionally, I would like to simultaneously handle data logging in the background while independently displaying measured data in real-time on the UI.
I have some experience with patterns such as Producer-Consumer and Event-Driven State Machine. However, I need guidance on which pattern, any pattern, would be best to learn and implement for this specific use case. I have read various information on the internet and forums, but I am still uncertain which design pattern to use. Moreover, I haven't come across any examples in these patterns that handle VISA instrument communication along with data logging.
Could you please guide me on which design pattern would be most appropriate to start learning and using for these types of applications?
Thank you!
08-02-2024 10:46 AM
What you are describing is not even remotely "specific". Communicating with SCPI instruments, displaying data and logging results to file is the primary use for LabVIEW and probably accounts for over 90% of all LabVIEW programs.
Short answer: Use a State Machine. It's the meat and potatoes and will handle most tasks.
If you have lots of different instruments which perform a variety of functions, learn some OOP.
If you want to dive deeper into a very generalized HAL-based test station, get into the Actor Framework.
08-02-2024 07:08 PM
What is the goal of your application? to enable users to log data from various instruments?
08-02-2024 08:43 PM
Take a look at DQMH.
Install it and take a look at the Continuous Measurement and Logging (CML) Example