DAPstudio provides an easy way to reproduce a command with auto-increment parameters. If you have a large number of channels, this feature is particularly useful. It allows you to copy and paste commands – even multiple commands – for multiple channels without manually changing the number in each command line.
This application samples four channels at 1000 samples per second per channel and decimates the data rate by a factor of 100 by applying the AVERAGE
command on each input channel pipe.
To see an example, enter a command line in the DAPstudio Processing|Procedures|DAPL Listing
edit box.
Average(IP0, cCnt0_, pAvg0)
You then can use a simple Ctrl-C
(copy) and Ctrl-E
(increment/paste/copy) keystroke sequence to add additional Average
command lines. They will look like this.
Average(IP1, cCnt0_, pAvg1) Average(IP2, cCnt0_, pAvg2) Average(IP3, cCnt0_, pAvg3)
Use this shortcut as many times as you need to. The increment/paste/copy operation does not just duplicate your lines of code with new numbers, it also duplicates all required structure declarations to support that code. So, after using Ctrl-C/Ctrl-E, you can run your application without any more work.
While in this application you only duplicate one command, the increment/paste/copy command works just as well for multiple commands.
File|New
.4
from the Channels
combo box.Average(IP0, cCnt0_, pAvg0)
" in the Processing|Procedures|DAPL Listing
edit box. Please see App0401 for step-by-step instructions on adding a DAPL command. Using the underscore ensures that the constant cCnt0_
will not be incremented.Average
command and its parameters.Ctrl-C
on the keyboard to copy the highlighted items to the clipboard.end
, and press Ctrl-E
to increment/paste/copy the items from the clipboard. Where a parameter has a number at the end, the number automatically is incremented when it is pasted to the new line. The new command line reads Average(IP1, cCnt0_, pAvg1)
.Average
commands.Processing|Declarations
tab and change the value of constant cCnt0_
from 10
to 100
.Processing|Send To PC
tab.Ctrl-A
. Then press the space bar. The IP0
through IP3
checkboxes are now unchecked, and instead the pAvg0
through pAvg3
checkboxes are now checked.Window|Graph
.Start!
or press Alt-S
on the keyboard.