\path [line] (switches) -- node {[[1, 0, 1], [0, 1, 0], [0, 1, 0], [0, 1, 0]]} (switches-ind);
places the text right of the line, above places it left. How can I place it exactly in the middle of the line?
Edit: Heres a complete example of my document.
\documentclass[
a4paper,
DIV = 12,
fleqn,
liststotoc,
bibtotoc,
idxtotoc]{scrreprt}
\usepackage[pdftex]{graphicx} %% Grafikeinbindung
\usepackage{subfigure} %% Bilder => Unterbilder (a),(b),.. innerhalb einer Figure
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
% Define block styles
\definecolor{foreground}{HTML}{6200EE}
\definecolor{background}{HTML}{03DAC5}
\tikzstyle{decision} = [diamond, draw, text=white, fill=foreground,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=foreground, text=white,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{input-block} = [rectangle, draw, fill=background,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=background, node distance=3cm,
minimum height=2em]
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[node distance = 3cm, auto]
% Place nodes
\node [block] (serial) {calculate serial modules};
\node [input-block, left of=serial] (voltage) {desired voltage};
\node [input-block, above of=serial] (cell-voltage) {cell voltage};
\node [input-block, right of=serial] (number-cells) {number of cells};
\node [block, below of=serial] (steps) {calculate steps};
\node [block, below of=steps] (config) {compute switch config};
\node [block, below of=config] (switches) {compute switch position};
\node [block, below of=switches] (switches-ind) {set switch position};
% Draw edges
\path [line] (serial) -- node {3} (steps);
\path [line] (steps) -- node {[1, 1, 2, 3]} (config);
\path [line] (config) -- node {[1, 0, 0, 0]} (switches);
\path [line] (switches) -- node [midway] {[[1, 0, 1], [0, 1, 0], [0, 1, 0], [0, 1, 0]]} (switches-ind);
\path [line,dashed] (voltage) -- node {12} (serial);
\path [line,dashed] (cell-voltage) -- node {4} (serial);
\path [line,dashed] (number-cells) -- node [above] {4} (serial);
\end{tikzpicture}
\end{figure}
\end{document}



node[midway,right]ornode[pos=0.5,right]? – BambOo Aug 08 '19 at 10:02midwaydoesnt work, see code above. It seems to be the second keyword i need to find a "center" option for. – Julian Aug 10 '19 at 07:27midwaydoesnt work for me, I don't agree with the duplicate. – Julian Aug 10 '19 at 08:05