Dataflow Modeler for CBD Modelling

Tutorial: Developing a single CBD

Step 1. Open Dataflow Modeler by executing dfm.exe:

1570787951234

Step 2. Import the CBDLibrary classes:

1570788010155

1570788034762

Step 3. Save your empty CBD model:

1570788100738

Step 4. Create a counter CBD.

Drag and drop a ConstantBlock into the canvas:

1570790113293

Right click on the Process block and rename it to "1":

1570790182670

Add the remaining blocks (a ConstantBlock, AdderBlock, and a DelayBlock), and rename them accordingly:

1570790337269

Select the Connect Ports tool:

1570790401826

Connect the Out1 output port of the 0 block to the IC input port of the delay block by clocking once in the first output port, and clicking a second time in the target input port:

1570790505280

You can create "elbows" by clicking anywhere in the canvas.

Create the remaining connections according to the figure:

1570790575696

Don't forget to keep saving your CBD.

Step 5. Export the CBD Code.

Go to File, Export, Causal Block Diagrams:

1570790878070

Define the following constant values:

1570790933071

Hit OK and select the location where the code is to be exported:

1570790983214

The code looks like the following:

1570791026031

 

Tutorial: Developing a Hierarchical CBD

Step 0. Follow the previous tutorial if you haven't yet.
Step 1. Create a new empty CBD file, and call it: MyHierarchicalCBD.dfmx.

1570791243468

Step 2. Right click in cluster classes and create a new one named Counter

1570791349577

1570791360382

1570791369516

Step 3. Create the counter CBD from the first tutorial.

Note that the CBD is created inside the Counter cluster class:

1570791696588

 

Step 4. Add an output to the Counter CBD.

Right click on the canvas, and select Add Data Output:

1570791815917

Name it OutCounter:

1570791837629

Step 5. Connect the output of the delay to the OutCounter port.

Using the Connect Ports tool, click on the OutCounter port and then click on the connection leaving the output of the delay block:

1570791949966

Don't forget to keep saving your CBD.

Step 6. Instantiate the Counter CBD.

Click on the Edit Graph button:

1570792058625

Drag and drop the Counter cluster class:

1570792084358

And rename it to counter.

Step 7. Finish the CBD

On the Graph, add a few more block, as follows:

1570792258675

Step 8. Export the CBD.

Go to File, Export, Causal Block Diagrams, and define the following constant values:

1570792333088

Select an adequate name for the generate python file:

1570792373982

And enjoy:

1570792394986

 

Tutorial: Working with Custom Blocks

Follow this tutorial if you want to code your own block, and still use Dataflow Modeler to link that block with other blocks.

Step 0. Follow the previous tutorials if you haven't yet.
Step 1. Open Dataflow Modeler and create a new cluster. Name it MyCustomBlock:

1572398124107

Step 2. Add the required data inputs and outputs to the MyCustomBlock cluster.

1572398340897

Step 3. Save your CBD as MyCustomBlock.dfmx.
Step 4. Create a new CBD, choose File -> Import -> Classes, and select MyCustomBlock.dfmx.

The MyCustomBlock cluster should now be available to use.

1572398573605

Step 5. Import the CBDLibrary classes and create your cbd.

1572398637215

Step 6. Generate cbd code. Choose File -> Export -> Causal Block Diagrams, and generate the MyCBDWithCustomBlock.py file:

1572398708646

Step 7. Replace the generated MyCustomBlock class with your own code:

1572398822915