Jump to content

Changing available inputs based on user selection


Recommended Posts

Hello All,

First time posting here, but by no means new to LV.

I'm working on a DAQ application, and am curious how people would implement the following. The only ways I can really think of seem brute force, and I am sure there is a more elegant way. 

I am writing an application for some Agilent benchtop DAQs. Each channel of the DAQ can be configured as various types, and each type has a different set of parameters (ie temp has thermocouple type, strain has bridge config, etc).

I want the user to only see the parameters applicable to the channel type they select for that channel. So I'm picturing a configuration cluster for each channel type, then when the user selects the channel type from an enum of options, next to that will be the configuration cluster. Change the channel type, and the cluster changes with it (Similar to how Agilent's Datalogger already works if anyone here is familiar.)

Normally I would use an enum to drive a tab control and display the appropriate information. But that doesn't really work for this application as I am going to have upwards of 70 channels to be configured. That's too much to handle on a per-channel basis. 

I have not messed with LVOOP, but I feel that is probably the best way to do it. A parent "Channel" class with child classes for each channel type. When a user selects a different channel type, it becomes a different child class with different data. However, I don't want to put the time into learn LVOOP and then it end up not giving me what I want as I am on a very short timeline here.

How would you do this? Any ideas?

 

Thanks for your help!

 

Edited by ocmyface
Link to comment

You don't need to use classes but an advantage here is that you can pass around the different data sets as different objects, rather than having to convert everything back to one big cluster with all the options. That having been said I'm assuming that you're basically transmitting configuration as string commands to the daqs so it may be that you just use an array of strings for configuration and then you have a set of UIs which interpret that string configuration just like the daq does.

An example of a configuration as you describe can be seen here, using classes:
http://www.ni.com/example/51881/en/
For each device you can right click and select to add a current channel or a voltage channel or whatever and when the user clicks on that item in the tree it shows the UI associated with that class. If you have a finite number of classes and they all work using the same format of configuration strings, there is nothing to say you couldnt do something similar with plain VIs, and you just select the VI to add to the subpanel depending on the string that says "type=thermocouple" or whatever.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.