DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update 2 controls simultaneously in Dasylab

I have 3 analog outputs that are controlling 3 frequency drives.  I need 2 of the analog outputs to update simultaneously to prevent one drive from getting ahead of the other.

Example: The user changes the values in the Layout screen of a control then changes the value of a different control.  But neither control updates in the worksheet until the user clicks a momentary button on the layout screen.

Any suggestions for doing this???

Thanks,
Dave
0 Kudos
Message 1 of 4
(6,909 Views)
There are two considerations.... first, that you need to synchronize the update, and second, that you need to send that data to an analog output, which typically requires continuous data update.

The Latch module, in the first mode, will allow you to update the value on the click of a one-shot (momentary) switch.

Attached is a V10 example to do this.

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 4
(6,908 Views)
CJ,
Thanks, that worked better than the solution I came up with.
Unfortunately I'm using Dasylab 9 so I didn't try to look at your example but your description was good so I was able to build what you described.

I had a similar solution but it gave me an error down stream of the Latch.

I have 3 sliders.  The outputs go thru a scale block and then to the analog output block.

On slider 1 I needed to change its scale depending on a switch.  So I wired slider 1 to 2 inputs on the scale block which now has 4 outputs.
To determine which output from the scale from slider one to use I used a time slice set to Time controlled signal switch.  (Your solution I found in another thread)  The control input is a switch.

I needed slider 2 & 3 to update the AO block simultaneously.  (my initial question)  But my first solution was to use a shift register.
I had a one-shot wored to the 2 shift register controls.  I changed the sliders and clicked the one-shot and the 2 sliders updated at the AO simultaneously.

That worked so well I decided to add slider 1 to the shift register.  I gave slider one its own one-shot control.

But now when I tried to run I got an error from the time slice stating the block sizes or timing were inconsistent.

I did a little testing and found that the error occured when I had all 3 controls wired to a single one-shot or to multiple one-shots.

If I disconnected the slider 1 output from the shift register and the scaling block and wired slider 1 directly to the scaling block it works fine.

Any idea why the error occured.

My worksheet is attached.  The latch is in place but the shift register is still there.  To test just wire the outputs of the shift register to the scale block in the same order as the latch.

Thanks,
Dave

0 Kudos
Message 3 of 4
(6,903 Views)
The output of the Shift Register reduces the data -- your data is 1000 s/sec with a block size of 500. The output of the Shift Register is 2 samples/sec with a block size of 1.
The input control for the Time Slice is at the higher rate.

You can fix it by setting the Time Slice to output a full block, 500, for each channel.

Note  The block size at the module output is defined by the register size. The relation of sampling rate and block size is the same as at the input:
Global Sampling Rate =200 Hz; Block Size = 100; Register Size = 10
=> At input A/B = 200/100 = 2 ; at output Register Size = B = 10 => A = 20
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 4 of 4
(6,899 Views)