NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback wanted for choosing LVOOP

Hello NI Community,

 

I'm currently working on developing LabVIEW code for a test platform, which will be sequenced by TestStand. My primary goal is to make the code maintainable, scalable, and easy to understand for future developers. To achieve this, I've decided to use LabVIEW classes to encapsulate instrumentation control code and leverage the concepts of encapsulation and abstraction. In the past, we have had a habit of cross pollinating instrument code and global variables amongst other projects / modules.

 

My approach involves creating classes for individual instruments, with each class containing instrument-specific code and providing a simple interface for interacting with the instruments. This way, the code is more modular and organized, making it easier for other developers to understand the functionality and locate instrument-specific code.

While I'm not heavily leaning into other OOP concepts like polymorphism or inheritance, I believe that using classes in this manner will lower the complexity and improve the overall readability of the code. Basically, I'll be creating a shopping list of Classes & Methods for a TestStand sequence.

 

I'd appreciate any feedback / thoughts on this approach. Do you think using LabVIEW classes for encapsulation and abstraction is a good idea in this context? Have you used a similar strategy in your projects, or do you have alternative suggestions for organizing code in a test platform development environment?

 

Thank you in advance for your time,

Rusky

0 Kudos
Message 1 of 3
(779 Views)

Last year, in my company, I developed a universal instrument library using C #. I refined the VISA interface so that all instruments and all communication methods (COM, USB, GPIB, LAN) can be universal. The difference in instructions between different instruments only needs to be achieved by calling different driver files (custom formats),

At present, it has been widely used in many projects, which may not be good, but for me, its convenience, universality, and execution efficiency have already made me feel very convenient

Message 2 of 3
(742 Views)

@rusky wrote:

I'd appreciate any feedback / thoughts on this approach. Do you think using LabVIEW classes for encapsulation and abstraction is a good idea in this context? Have you used a similar strategy in your projects, or do you have alternative suggestions for organizing code in a test platform development environment?


Sounds like you are on a good track.  Encapsulation is probably the most important aspect of OOP.  If you decide to go into the Hardware Abstraction Layer (HAL) mode, you will need to learn inheritance.  HALs can be very useful, but you will spend a lot of time to get it into a usable state (I've rewritten mine several times over the years).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(728 Views)