LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to manage multiple instrumments possibilities


@Quiztus2  ha escrito:

This is exactly what I am doing right now here: https://github.com/pettaa123/HAL/tree/GOOP4 

It still under heavy construction, but you get the idea from the test_whatever.vi's . Feel free to contact me directly if you are interested.


This seems really interesting but I cannot open the files since I am using LabVIEW2017 . I was trying to update but the subscription model is not welcomed at the company I work for.

0 Kudos
Message 11 of 21
(834 Views)

Do a search (on the Web or in this Forum) for "Hardware Abstraction Layer", often abbreviated "HAL".  The search term "LabVIEW HAL" yielded a lot when I typed it into Google.

 

Bob Schor

0 Kudos
Message 12 of 21
(778 Views)

I developed my own HAL.

BDCCapture.PNG

I have been using this for a decade and it has been very easy to add new instrument models to our test systems as older instruments are replaced.

 

========================
=== Engineer Ambiguously ===
========================
Message 13 of 21
(736 Views)

Hi antoniobeta,

 

I second the suggestion of others to implement a hardware abstraction layer for your instruments using OOP. I have moved away from wanting to build a larger abstraction layer for multiple instruments and instead choose modularity. 
That means that each instrument type (like scope, signal generator, dmm... ) becomes a module and within that module there is a simple HAL which consists of a base class for the instrument type and child classes for the implementation of each instrument of that type. 

The modularity gives you the advantage that you can easily test it, have multiple instances of that instrument module and re-use it in other projects.

Your actual application would then use your instrument modules and you implement all testing logic separately (also in modules) or a simple state machines.

My choice of framework for modularity is DQMH because of the developer experience (scripting tools) and expressive code, but there are others. DQMH can both be used for instrument and application modules. Check out DNATTs Introduction to DQM. There is also and article on HALs in a DQMH module: HAL in your (D)QMH - DQMH® than can help to get you started.
If the application is simpler application  and re-use of parts of it is not important then I use the JKI State Machine.

Below you can see two diagrams which demonstrate the structure:

JoGra_0-1725003349776.png       JoGra_0-1725006987039.png

 

 



 

Message 14 of 21
(699 Views)

Hi antoniobeta,`

I second the suggestion of others to implement a hardware abstraction layer for your instruments using OOP. I have moved away from wanting to build a larger abstraction layer for multiple instruments and instead choose modularity.` 
That means that each instrument type (like scope, signal generator, dmm... ) becomes a module and within that module there is a simple HAL which consists of a base class for the instrument type and child classes for the implementation of each instrument of that type.
The modularity gives you the advantage that you can easily test it, have multiple instances of that instrument module and re-use it in other projects.

`Your actual application would then use your instrument modules and you implement all testing logic separately (also in modules) or a simple state machines.`

My choice of framework for modularity is DQMH because of the developer experience (scripting tools) and expressive code, but there are other frameworks too DQMH can both be used for instrument and application modules. Check out DNATTs Introduction to DQMH. There is also and article on HALs in a DQMH module: [HAL in your (D)QMH - DQMH® than can help to get you started.`
If the application is simpler application and re-use of parts of it is not important then I use the JKI State Machine

Here is are two diagrams on how it could look like:

JoGra_0-1725017341917.pngJoGra_1-1725017351974.png

 

 



0 Kudos
Message 15 of 21
(699 Views)

@RTSLVU wrote:

I developed my own HAL.

BDCCapture.PNG

I have been using this for a decade and it has been very easy to add new instrument models to our test systems as older instruments are replaced.

 


Thanks for posting that, I'm always interested to see how others do it. Do you not use any TCP? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 16 of 21
(684 Views)

@Jay14159265 wrote:


Thanks for posting that, I'm always interested to see how others do it. Do you not use any TCP? 


LXI is the standard for Ethernet communications.  

 

Our four new systems use LXI predominantly. 

========================
=== Engineer Ambiguously ===
========================
Message 17 of 21
(660 Views)

@RTSLVU wrote:

@Jay14159265 wrote:


Thanks for posting that, I'm always interested to see how others do it. Do you not use any TCP? 


LXI is the standard for Ethernet communications.  

 

 


Standards, that sounds nice : ) 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 18 of 21
(647 Views)

When you bring in NI Instruments, things get a bit messy since those use dedicated driver APIs, and sessions are IVI class variants.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 19 of 21
(629 Views)

@mcduff wrote:

Whatever road you take, try to find models of instruments that use SCPI Commands. Then any changes should be minimal between models.


This really stuck with me after reading it, but I was disappointed to find that NI SCOPE and friends do not use SCPI.

CLA
0 Kudos
Message 20 of 21
(528 Views)