A sequence is an ordered list of procedural commands which Dewesoft will execute one after another. It contains building blocks (also called elements). A sequence can be defined as a function whose domain is a countable totally ordered set, such as the natural numbers.
A sequence is an ordered list of procedural commands which Dewesoft X will execute one after another. It contains building blocks (also called elements).
The order of elements is important since the execution flow starts at the first block marked with a grey dot and follows the path defined by the arrow lines. Same elements can appear multiple times at different positions in the sequence.
Most precisely, a sequence can be defined as a function whose domain is a countable totally ordered set, such as the natural numbers. Clear? No? That is from the doctoral thesis on the sequencer made by one of our main programmers. Even if it sounds complicated, the sequencer is really easy to use. Let me show you how.
In Dewesoft X the Sequencer is located in Measure mode -> Setup files tab as it is shown on the image 2.
Image 2: Sequencer location inside Dewesoft X
If we take a look at the main screen in the Dewesoft X sequencer, we can see three main tabs: Sequence, Test Cases, and Settings. See image 3.
Image 3: Sequencer window
If we take a look at the sequence tab screen, we can see different buttons as shown in image 4.
Image 4: Sequence buttons
Under the Sequence section, we can create a new sequence or save an existing one.
Under the Diagram section, we can press the Main button that brings us to the main screen, or Event button that opens a new Event block section. The Custom button enables us to import our block or to create a new one by pressing the '+' button.
We also have a Debug section where we can find two buttons. Play button for playing our created sequence and Debug button.
On the left side of the screen, we can find different Blocks. Blocks are separated into 4 main categories: Action Blocks, Decision Blocks, Wait Blocks, and Others. Each of these blocks performs different actions, decisions,... that we can use when creating a sequence.
All of these blocks can be simply drag and dropped into the Main sequence screen, see image 5.
Image 5: Different blocks can be drag & dropped inside the Main Sequence area
Let’s try to make the first simple sequence to show how easy it is, before we continue to the details.
A typical workflow is:
load the setup,
perform some measurement,
review the data, and
ask the user to control the sequence.
The new sequence can be created from the Measure mode -> Setup files toolbar and click on the New sequence button.
Image 6: Create new sequence
The main screen of the sequencer editor has a main toolbar on the top, the list of available blocks on the left, a sequence sheet in the middle, and a property tab on the right side.
Blocks can be added by double-clicking on their name or by drag and drop principle into the Main sequence area.
Image 7: The main screen of the sequencer
As said before, blocks can be added by double-clicking on their name or by drag and drop principle of dragging them into the Main sequence area.
For this example we would like to do the following:
tell the user to confirm that the measurement can be started by adding a Wait block, and
perform an action in Dewesoft X, so we have to choose the Action block. There are many actions that can be chosen for an Action block under DCOM structure.
Image 8: Adding blocks in the Main Sequence area
Let's connect the selected block together.
As it is previewed on image 8, blocks are already connected. The reason for it is that they were added by double-clicking so they connected one after another automatically as they were added.
If they are not connected yet, we can connect them by dragging the first block over the next one in the sequence or by dragging the second block in the sequence over the first one.
Image 9: Connect blocks with dragging them one over another
The black arrow created between the blocks indicates a created connection in a certain direction. Remember that arrow will be in most cases directed downwards, so moving blocks one over another will generate a downwards directed arrow.
Image 10: Connection between blocks is made
If we made a mistake either by adding the module or adding a connection line, any element can be deleted by right-clicking on the element and choosing Delete.
Setting block properties
Now, that we have connected the modules together, let’s set the properties of the building blocks.
First we choose the block that we want to set up and then define its properties on the right side of the sequencer screen. The block that we chose turns yellow.
In the upper section of Text Info we define the name of the block that will appear while running the sequence in Dewesoft X. The name of the block is a command, which the user needs to perform while measuring.
Image 11: Block settings are located right to the Main Sequencer window
Next we can choose the Output Voice option. This option will speak out the Text Info through the Windows Text-To-Speech option. In Windows OS you can define the human voices which allow disabled people to operate the system.
In our case there are several applications where the user can’t really look at the screen while performing the test and for that purpose this option can be really helpful.
The Setup file section depends on the block. For the Load Setupblock we can define the setup file which will be loaded. In our case we have prepared upfront a simple setup called FirstTry. By clicking on the three dots push button we can choose which setup to load. The name of the setup will also be noted on the Load Setup block.
Image 12: Settings for Load setup block
At this point we can also explain the meaning of Dynamic and Staticlinks. If we choose the Dynamic link, it means that our sequence will be saved separately from the setup in Dewesoft X. In case we choose the Static link, we will save the setup together with our sequence, so we don't have to be so careful while moving our measurement to a different computer, because there is only one file to move.
Then we select the Wait for user block. We can wait for user interaction, trigger, or certain value of the selected channel. At this point, the only thing needed is to inform the user what to do. That can be entered in the Text info field.
Image 13: Wait for user block settings
The Action button needs a selection of a Dewesoft X event. There are many actions that can be performed with this block, but let’s start with a simple one, the Start action. This action will start the measurement.
Image 14: Choose start action under DCOM structure
Let's add a few more blocks to our Example
First add another Action. Drag it over the Start block. The black line will appear on the bottom of the Start block and when releasing the mouse button, a new action module will be added and automatically connected to the Start block.
Now choose the Start storing action, and add also aDelay block from the left side. This block will wait with the execution of the sequence for the specific time period. Add two more Actions: Stop and Analyse by adding the Action block and selecting an appropriate action from the list.
To see the structure of the sequence, take a look at image 15.
We can also add decision blocks to the sequence. The decision can be made either by the user or from the formula. In this example we would like to ask the user if another measurement should be performed. So enter this text in the Text info field.
Image 15: Current structure of the sequence, and 'If' Decision block settings window
If the answer is No, then the sequence can be stopped, and therefore no connection line is needed. If the answer is Yes, a new line to some point above has to be drawn to repeat the execution.
Currently we are already in Analyse mode (Analyze block). Therefore add another Action called Measure to go back to measure mode. Connect the 'If' positive action (green tick) to the Measure action.
Also if another measurement is desired, the next step performed should be the Start of the measurement, therefore connect the Measure to the Start block we have already created it before. See image 16.
Image 16: Add Measure block to return back to the measure mode and connect it to the Start block to start measuring
If you wrongly connected the blocks, you can correct this by right-clicking on the connection line and choosing Delete or by left-clicking on the connection line and pressing the Delete button on the keyboard.
Run the sequence
As the sequence build is over, save the sequence by pressing the Save button, and after the sequence can be run. This is done by pressing the Play button. In real life, the sequence can be run just by loading it from the start-up screen, but for testing purposes, Play and Debug buttons are great to test the sequencer out.
Image 17: Save, Play and Debug buttons
The sequence should load the setup now and show the top bar. There are several actions which the user can perform:
Pause the sequence,
Stop the sequence or
Skip one block of the sequence.
These buttons are always available. Based on the chosen block the additional buttons will be shown. This allows the user to enter some parameters, prepare the measurements, and so on. At the wait block, we could see the text info we have entered and the button Continue. See image 18.
Image 18: Running the sequence
In this case, the Continue button will start the measurement. The delay will store the data for five seconds and the user will need to wait for that time period. After a delay of five seconds, the stored file will be reloaded and the question will come to the user if another measurement should be taken. If you say Yes, another data file will be stored, if you say No, the execution will stop and the software will go to startup screen or to the sequence editor.
Image 19: 'If' decision block question is now previewed
Let’s refine the first example from the previous section a little bit.
We will eliminate the user’s ability to interfere with the flow execution and, on the other hand, give him a chance to enter important information about the measurement conditions. If we have left the sequence editor, the editor can be reopened from the start-up screen by choosing the right sequence and pressing the Edit sequence button.
Image 20: Open and edit the old sequence
To the first example sequence we will add a few more actions. It is possible to drag and drop the block in the sequence window to move them by holding the left mouse button. Move with the mouse button over the block, but take care that the cursor doesn’t change to drag the connection lines.
Now add another Action between the Load setup block and Wait for user block. There are two ways of editing and adding new blocks to the sequence:
First way and longer one:
Click on the connection line between the 'Load setup' and 'Wait for user' block and press the Delete button on the keyboard. The connection line is gone.
After add another Action. Add it over the Load Setup to connect to that and then manually connect the Action with Wait for user block.
When a single module needs to be added, there is a much easier way to add a block. Simply place the new block on the upper one under which the new module should be inserted and all other modules will be pushed away. The new module will be connected with the upper and lower one.
Define added action block as a 'Set Main Tool Bar' action in the DCOM window of the action block settings, which allows you to navigate through Dewesoft X menus as you would press the buttons manually. The sequence should look like the one on the image 21 now.
Image 21: New action block added
In the property panels of the SetMainToolBar action, we need to enter the Tab and the Button name. In the image 22 you can see which are tabs and buttons in Dewesoft X.
Image 22: Tabs and buttons selection in a channel setup
For this example, we would like, that the software asks for storing location, before proceeding with the measurement. So first select the Ch. setup as our TabName and Storing as our ButtonName.
If you want to prevent the user to change the screens or to stop, block, accelerate the execution of the sequence we need to go to Settings and disable the Show Sequence Control Toolbar and Show display property panels and channel selector options.
Image 23: Disable both View options
Run the sequence now. This time the sequence will stop in the Storing screen allowing the user to enter the file name, storing conditions and acquisition rate.
Image 24: SetMainToolBar action
Please note that you don’t have a chance now to control the execution of the sequence. The only available button is the continue button. In the measurement screen, all the properties are hidden.
In the analysis mode, the only available buttons are the selection to make another measurement or exit the sequence. With a few simple settings, we have made a very simple user interface for the end-user and hide all in-depth abilities while and, therefore, prevent mistakes during the measurement process.
Image 25: Continue the measuring with Yes, or exit with No
In the following sections, we will take a look into all available blocks that can be used in the sequencer. Since there are many possibilities in the sequencer, there are also many options to choose from.
Each block has a Text info that will show at the top. We have seen the usage of the text info already in the short example, but it has also one interesting option. It can parse variables or channels and show them in the upper bar. As we can enter a variable in the formula we can also enter it in the text info. During measurement, it will show up as a real value and will update with the display refresh rate.
Image 26: Text info of each sequence block
There are several blocks to help you build your sequence:
Actually there are all the functions that are also available from Dewesoft X's programming DCOM interface, so the sequence is actually an easy visual way to program the execution workflow like it could be done in any external programming language. Commands are the same as in Dewesoft X DCOM… We can also look at the sequencer as an easy replacement for the classic programming languages.
Action can be chosen from the list shown on the right side under the DCOM structure caption. Some of the actions have the parameters which can be edited inthe Parameters list. Help window provides the short-form information on what the action does.
Image 27: Action can be chosen from the list in DCOM structure
There are many possible actions and the following context will go through all in alphabetical order.
AO Set Manual
If the function generator is set to Manual output, the user can choose whenever the output will start.
Image 28: Function generator set on 'manual' start output
The action is the same as if the user would press the Manual button to start the function generator as it is shown on image 29.
Image 29: Start output for Function generator in Storing mode
This action puts Dewesoft X in Analysis mode like pressing the Analysis button on the screen. Please take a look also at the Measure action.
Image 30: Analyze action
This action exports the data. It is replaced by ExportDataEx which has more parameters, but this function can still be used if these additional parameters are not needed.
Image 31: Export Data action exports the data
ExportDataEx will export the opened file with an extended set of parameters. Please note that the file must be open in Analysis mode to call this action.
There are several parameters that must be set:
The export type defines the type of the export to be used. The list of exports is enumerated in the same way as the drop-down list in the export is shown. We can find all the export type files if you go to Analysis mode -> select Data file -> go to Export -> File export.
Image 32: Export options
You need to enter:
Universal File Format 58 (*.unv)
NSoft time series (*.dac)
RPCIII (*. rsp)
Custom exports must be enumerated with negative values starting with -2. The custom exports depend on the installed exported (.exp) files. In our case from the screenshot above it would be:
Google earth KLM
Time Axis defines how the time will be exported:
Pre Trigger time
Export Data Type:
Defines which data will be exported:
Full speed data
Defines which data will be exported at a reduced rate. So if we want to export min and max, we need to enter: 1+2=3. If we want to export min and RMS, we need to enter 1+8=9. The property is important only if reduced data is exported.
The value is a set from:
Defines the file name to be exported:
If the file extension is not defined, the default file extension will be taken.
If the file-path is not defined (just the file name is entered), then the default export folder will be taken.
If not even a file name is defined (field is blank), then the loaded Dewesoft X file name will be taken.
This action will open the Settings window of Dewesoft X.
Image 33: Hardware Setup action opens the Setting window
This action will load the DBC file for CAN ports. You have to define the port number and the File name of the DBC library to load. It is the same action as the DBC/XML Import found in CAN setup:
Image 34: CAN import as a Load DBC action
This action will load the Dewesoft Xdata file. If the file name is wrong or if it is not defined, it will show the dialog to choose the file manually. If the path is not defined, it will try to load the data from the main data folder of the currently selected project.
This action will open the project file. This brings the sequence above setup as well as the above project files. It allows us to load in one single sequence different projects and different setups.
This action loads the setup. A file name must be defined. The action is the same as the Load Setup main block.
This action will put Dewesoft X in Measure mode. It is the opposite action from Analysis and has the same effect as clicking on the Measure button.
Measure Sample Rate Ex
This action will change the measure sample rate - Dynamic acquisition rate. Property MeasureSamplerate must be set to the new wanted sample rate.
IMPORTANT:Dewesoft X must be running in Measure mode –> Ch. setup screen that this command is taken.
This action will open a new setup. It is equal to the Dewesoft X button – New setup menu item.
This action will pause storing. It is equivalent to the Pause button and works in conjunction with Resume. Dewesoft X must be in Measure mode and should be storing the data that this command is valid.
This action will make a screen dump to the printer. It is the same as the Analysis Print command.
This action will set the reduced rate of the data. Please note that you need to be in Measure – Setup screen that this command is valid. It is the same as the Static acquisition rate entry field.
Image 36: Reduced rate action
This action will resume storing if paused. It is equivalent to the Resume button and works in conjunction with Pause. Dewesoft X must be in Measure mode, should be storing the data, and should be paused that this command is valid.
This action will save the setup under the defined file name. If the file name is empty, it will store the currently loaded setup.
This action will send the keystroke to Dewesoft X. The parameter Key is the key code according to the character map.
This action will change the shown display. The ID parameter defines the main index of the screen. This command is valid only in the measure mode. In case as shown on image 37, defined 0 will set Recorder, 1 will set the Overview, 2 will set the Scope and 3 will set the Custom, regardless of the display name.
Image 37: Displays preview
Set Main Data Dir
This action sets the main folder of the data.
Set Main Toolbar
This action is very important. It sets Dewesoft X to a certain mode. The TabName property defines the name of the main toolbar. Here a Name of the main toolbar must be entered (like Ch. Setup, Measure, Print and so on). Please note that some of the tabs are not always available and depends if Dewesoft X is in Measure or Analyse mode. See image 38.
The next selection – ButtonName defines which main menu button will be selected. Here it is again important to take care of which buttons are available in which menu.
Image 38: Toolbar setup
Set Screen Index
This action changes the sub displays. If the main display has several sub-screens, this action can change between them.
Set Store Mode
This action can set the store mode. Possible values are:
fast on trigger
fast on trigger, slow otherwise
Setup Sample Rate
This action changes the setup sample rate. It is similar to the Channel setup sample rate option available in the Settings window. Please note that Dewesoft Xmust NOT be in the acquisition setup mode when this parameter is set.
Image 39: Channel sample rate setup
This action changes Dewesoft X to the setup screen mode.
Shown Property Frame
This action shows or hides the property frame and channel list while measuring.
Image 40: Shown Property Frame shows or hides the property frame and channel list while measuring
Show SR Options
This action will show or hide the sample rate panel in Ch. Setup –> Storing and Ch. Setup –> Analog tabs.
Show Store Options
This action will show or hide the storing options in Ch. Setup –> Storing and Ch. Setup –> File details. It is important if you want the user to be able to change the header entries, but not the file name. It is defined as True or False.
This action will start the measurement.
This action will start storing the data. Dewesoft X must be in the Measure mode that this command is working. It is the same as the Store button.
Stay On Top
If the property StayOnTop is true, then Dewesoft X will be always on top even if another application has the focus.
This block can be used for making a User decision. The decision is based on user choice where the question is asked in theText info and the user answers with Yes or No.
Image 41: User Condition type IF block properties
Another option is to make a decision based on the Value. We can add any number of conditions by pressing plus and minus. In the first field, we can add any channel and then choose either >, <, =, and != (not equal). In the second field, we can also add a variable OR we can enter a fixed value.
Image 42: Value-based Condition type
There are also two other Condition types available - File exist and Error state.
This block is used to repeat a certain workflow fixed number of times. The only property is the number of repetitions. We need to connect to Yes the blocks which need to be repeated and to No the blocks which are following the Repeat block.
Image 43: Repetition block
This action is used to wait for a certain amount of time defined in the delay field. Time is defined in seconds.
This block is used to wait for a certain event. It can wait for user interaction. It will output a Text info and show the Continue button. The execution of the workflow will continue when the user has pressed it. The User wait is related to a question inside the Text info area and on the Yes or No answer.
Another option is to wait for a value. We can add any number of conditions by pressing plus and minus. In the first field we can add any channel and then choose either >, <, = and != (not equal). In the second field we can also add a variable OR we can enter a fixed value.
Image 45: Wait for user
Image 46: Wait for value
The third option is to wait for a trigger. We can either wait for the start or stop trigger. Dewesoft X must be in the store mode with triggering so that this option is valid.
There are also other options for waiting condition: Load setup, Stop storing, and Stop playing.
This block is used to play audio, video files, slideshows, or outputs text-to-speech. A short video or audio instruction might be a valuable help for the unskilled user. We can choose from .avi, .mkv, .mov, mp4, mpg, wmv, mp3, or .wav files.
Image 47: Audio video block
Another option is to create a slideshow to show. We can enter any number of pictures and define delay between them.
Image 48: Slideshow type
The third option is text-to-speech. This option gives usability that the text is output to the speaker which is written in the entry field. Also here a value of the channel can be entered, so if we have AI 0 at 40, the computer will say “Temperature is 40”.
This block is used to record and replay Macro. With pressing the Play sequence and Record Macro, Dewesoft X will execute the sequence up to the point where Macro needs to be recorded and then we can operate the mouse, keyboard, or even record the voice during our actions.
Image 49: Macro block
When playing it back, Dewesoft X will repeat the same actions.
This block is used to set variables or control channels. We can set the data header values, internal variables used in math or control channels which operate analog or digital output.
The first entry is the channel which we will set. In the example below we will define the data header variable. Since this variable is set to Text, we must enter the value with the double apostrophe.
Image 50: Calculation block
If the variable is integer or float, we can enter the value or enter any Dewesoft X channel with the full function of math formulas. We can, for example, define the counter. In the Project setup – Internal variable, I defined the ‘CNT’ variable which can be used as shown on image 51. On each transition of this block, the value will be increased by 1.
Image 51: Counter formula in Calculation block
This block can also set the control channels. In the example below the frequency of the function, a generator is set to 50.
This block is used as the black box which can hold more modules to reduce the complexity of the main sequence. Please note that on the upper bar you have a choice to see the main sequence, event actions, or Custom blocks. If we go to the custom block, we can add a new one by pressing the + button. After defining the blocks, we can enter this single or multiple times in the main sequence by adding a custom block.
Image 53: In existing sequence add a Custom block and with the right click find the option 'Extract custom block' which can be later added in another sequence as a Custom block
The only thing to define in the custom block is the name of the block.
Image 54: Define a name of the created Custom block
Image 55: Assigning saved sequence as a Custom block
This block is used to perform actions on the files. You can, for example, run an external program with some parameters, delete, copy or rename the files, which are defined under Operation type and will be described below in this chapter.
Image 56: File manager block
Opens or executes the file defined in the file name. This is similar to Start – Run … option in Windows. We can also define parameters for executables.
The second option is to Copy files. We can either Copy a series of files or choose to Copy the last stored file to a defined Destination folder. This is used, for example, to create backups on network drives.
Another option is to Delete defined files or last stored file. We can, for example, ask the user if the measurement is ok and if it was not, delete the last stored file.
At last, we can also rename the last stored file to a different name which can be either fixed or defined by the user.