I'm trying to draw the following dataflow diagram in tikz:
Here is what I got so far:
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,positioning,petri}
\begin{document}
\begin{tikzpicture}[thick,
node distance=2cm,
on grid,
every transition/.style={fill=black,minimum width=.1cm, minimum height=0.9cm},
every label/.style={black!75}]
node distance=2cm,
on grid,
every transition/.style={fill=black,minimum width=.1cm, minimum height=0.9cm},
every label/.style={black!75}]
\node[place, label=above:$n_1$] (n1) {+};
\node[place, right=of n1, label=above:$n_2$] (n2) {$\times 2$};
\node[place, right=of n2, label=above:$n_3$] (n3) {+};
\node[place, below=of n2, label=above:$n_4$] (n4) {+1};
\node[place, right=of n3, label=above:$n_5$] (n5) {$\Delta(0)$};
\node[right of=n5] (x) {X};
\node[below of=n5] (y) {Y};
\node[left of=n1] (i) {Input};
\draw[->] (n1) edge (n2.west);
\draw[->] (n2) edge (n3.west);
\draw[->, to path={-| (\tikztotarget)}] (n4) edge (n3.south);
\draw[->] (n3) edge (n5.west);
\draw[->] (n5) edge (x);
\draw[->] (n4) edge (y);
\draw[->] (i) edge (n1.west);
\draw[->, to path={|- (\tikztotarget)}] (i) edge (n4.west);
\end{tikzpicture}
\end{document}
As you can see, drawing the nodes work fine but I'm having trouble getting the edges right. I want the edges to be angled and also there to be dots so it's clear where the flow branches.
I updated my code with edge drawing commands. I still cannot get the feedback edge right nor do I get dots where the edges branches.
Best Answer
Try the following:
Edit: Ar adding labels the chain had to be handled different as above: it should be add to
C
nodes style. Doing this, macrojoin had to be interrupted because it should not connect last
Cnode in code with others. In this case the
scope` is not needed anymore.