DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing module properties at runtime

Hi Everyone,

I'm running DASYLab 7, and I'm a beginner. In the simplest terms, here
is what I need to do:

I have a bar graph module with specific settings for the lower limit
and upper limit properties. While the program is running, I need to
find a way to change the lower and upper limits on the bar graph when
the signal from a digital input goes to zero (for example).

Basically, I want to dynamically change the scaling of the bar graph
while the program is running. Is this possible with some sort of
action module? Although I'm new to DasyLab, I know VB and C++ in case
this solution might require some programming.

Thanks in advance,
Andy

0 Kudos
Message 1 of 3
(7,453 Views)
There are several ways to accomplish this.

First, replace the values in the Bar Graph Scaling From / To with Global Variables. You can easily tell if a Global Variable is allowed by right-clicking in a dialog box parameter field. If the Global Variable menu item is displayed, choose it. You can then choose a Global Variable to enter into the field. Since this puts a placeholder, such as ${VAR_1} into the field, you can simply type it, as well.

Once you have this configured, then you have many ways to update the Global Variables.

For example, you can provide user control by creating a Slider module with two outputs, connected to a Variable Set module with two inputs. When you move the slider, the specified variables will update.

Or, as you have suggested, use the Action module to monitor a Digital Input. On Rising Edge, set each variable to the desired values, and on Falling Edge, set them to the other set of values. Note that you'll need an Action channel for each variable for each event, a total of 4 channels. You may want to also configure two Experiment Start channels, to ensure that the initial settings are correct at program start.

Good luck,

--cj


@Anonymous wrote:
Hi Everyone,

I'm running DASYLab 7, and I'm a beginner. In the simplest terms, here
is what I need to do:

I have a bar graph module with specific settings for the lower limit
and upper limit properties. While the program is running, I need to
find a way to change the lower and upper limits on the bar graph when
the signal from a digital input goes to zero (for example).

Basically, I want to dynamically change the scaling of the bar graph
while the program is running. Is this possible with some sort of
action module? Although I'm new to DasyLab, I know VB and C++ in case
this solution might require some programming.

Thanks in advance,
Andy




Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(7,444 Views)
Thanks, CJ. This is good stuff.

-Andy


CJ Butler -- DASYLab Pro wrote:
> There are several ways to accomplish this.
>
> First, replace the values in the Bar Graph Scaling From / To with
> Global Variables. You can easily tell if a Global Variable is allowed
> by right-clicking in a dialog box parameter field. If the Global
> Variable menu item is displayed, choose it. You can then choose a
> Global Variable to enter into the field. Since this puts a placeholder,
> such as ${VAR_1} into the field, you can simply type it, as well.
>
> Once you have this configured, then you have many ways to update the Global Variables.
>
> For example, you can provide user control by creating a Slider module
> with two outputs, connected to a Variable Set module with two inputs.
> When you move the slider, the specified variables will update.
>
> Or, as you have suggested, use the Action module to monitor a Digital
> Input. On Rising Edge, set each variable to the desired values, and on
> Falling Edge, set them to the other set of values. Note that you'll
> need an Action channel for each variable for each event, a total of 4
> channels. You may want to also configure two Experiment Start channels,
> to ensure that the initial settings are correct at program start.
>
> Good luck,
>
> --cj
> Anonymous wrote:Hi Everyone, I'm running DASYLab 7, and I'm a beginner. In the simplest terms, here is what I need to do: I have a bar graph module with specific settings for the lower limit and upper limit properties. While the program is running, I need to find a way to change the lower and upper limits on the bar graph when the signal from a digital input goes to zero (for example). Basically, I want to dynamically change the scaling of the bar graph while the program is running. Is this possible with some sort of action module? Although I'm new to DasyLab, I know VB and C++ in case this solution might require some programming. Thanks in advance, Andy

0 Kudos
Message 3 of 3
(7,442 Views)