LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to allow a user to select an instrument from a group and use that VI?

Hi All,

 

 

In a previous application I wrote using Agilent VEE I created a Configure Equipment and Initialise Panel for the user to select for example a signal generator from a drop down list of different types, and when initialised the functions for that item would loaded into a generic library called Signal Generator into my main program. I could then call these functions in my main program

 

 

When I wrote the instrument drivers I named each function the same for each type of signal generator I could offer the user. e.g. Set_Frequency (would be in all instrument drivers)

 

 

I would like to do this in LabVIEW and am struggling to find out how to do it.

 

 

Does anyone have any suggestions? And I hope what I have said above makes sense.

 

TIA
Martin

0 Kudos
Message 1 of 9
(3,408 Views)

I solved this task with the vi-server vis.

Each instrument is controlled by one source-vi with 'standard' terminals having type defined in and output clusters. In my case one of the inputs is a strictly type defined enumerate called action-control (startup,setup,init device, configuration, measure, free device, close,...) realized as a state MC. Each source-vi could run for his own, but don't need to show up a front panel.

If a vi that is called via vi-server open a reference to its own, the caller vi might even be closed and the source will still run in the background. Nice if you collect data (longtime) from a lot of different sources where one source might crash/stop but the others should keep on working. 

The main vi calls these sources, collect the data .....

 All sources where places in subdirectory tree, so one can 'simply' add sources without touching the main system. However these sources might even be distributed over different PCs 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 9
(3,398 Views)

You should find some ideas and implementation searching for 'plug-in architecture' in the forum. Also the SubPanel might be of interest to you.

 

Felix 

0 Kudos
Message 3 of 9
(3,392 Views)

Hi Henrik,

 

Thanks for that.  Do you have any code examples?  I'm still getting to grips with VI-Server, and its capabilities.

 

TIA
Martin

0 Kudos
Message 4 of 9
(3,380 Views)
You may wish to consider using classes, as it sounds like you're trying to develop an object-oriented approach.
0 Kudos
Message 5 of 9
(3,368 Views)

I'm also investigating whether IVI drivers will be able to do what I want.  Has anyone used IVI for instrument control?

 

0 Kudos
Message 6 of 9
(3,365 Views)

Marty H wrote:

Has anyone used IVI for instrument control?


Yes. What's your question? Smiley Very Happy

 

Seriously, though. IVI is nothing new, and there are many instrument driver examples in the Instrument Driver Network.  There are also several KnowledgeBase articles on IVI, such as:

 

Using IVI Drivers to Build Hardware-Independent Test Systems with LabVIEW and LabWindows/CVI

Using IVI Drivers in LabVIEW

 

 

0 Kudos
Message 7 of 9
(3,361 Views)

My question is the same as my first post, which is can you program LabVIEW so the user can select a signal generator that they may use of different manufacturer, ie. Agilent, R&S, Anritsu,  and then call a generic function in your main program, lets say Set Frequency, and determined from the choice, control that signal generator correctly.

 

I have also found how to create a library and add VIs to it.  Could you tell me what the library is for?  And how can you load/call them up in a VI.

 

Cheers

Martin

0 Kudos
Message 8 of 9
(3,349 Views)
Hi Martin,


With regards to communicating with hardware from other manufacturers, yes you are able to do this using LabVIEW provided the drivers are available from National Instruments, or sometimes the manufacturers themselves provide LabVIEW VIs to use with their instruments.


To configure the device it may be worth implementing some form of popup dialog box to input the values for your particular configuration. This can be done by creating a SubVI where you are able to input the values and once a button is pressed the dialog box closes (as in the example I have attached)


Just to mention also, VI Libraries are mainly for organization purposes, and grouping VIs together. It also allows you to protect your VIs by setting them to private, which means they are only able to communicate with other VIs within that particular library.


Hope this Helps,

 

Steve

0 Kudos
Message 9 of 9
(3,301 Views)