pgf, tikz, circuitikz: define a new component

The error is due to the fact the the key circuititz/bipoles/length is not a normal "value" key, is just a .code to set the internal variable pgf@circ@Rlen.

So you have to substitute the line:

\pgf@circ@res@temp=\ctikzvalof{bipoles/length}

with

 \pgf@circ@res@temp=\pgf@circ@Rlen

and the error is gone.


You can use dipchip or qfpchip for drawing quadrupole.

enter image description here

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}

\begin{document}
\begin{circuitikz}
\draw (0,0) node[dipchip,num pins=4,external pins width=0.0,no topmark,](C1){IC1};
\draw (0,-2) node[qfpchip,num pins=4,external pins width=0.0,no topmark,](C2){IC1};

\draw (C1.pin 1) to[short] ++(-1,0) |- (C2.pin 1);
\draw (C1.pin 4) to[short] ++(1,0) |- (C2.pin 3);

\end{circuitikz}
\end{document}

EDIT

Aliases can be given to anchors, say input 1 instead of pin 1. See answer to: Renaming anchors in predefined shapes. You can hide the default pin numbers and give desired name to those pins. See MWE:

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\makeatletter
\newcommand*\pgfdeclareanchoralias[3]{%
    \expandafter\def\csname pgf@anchor@#1@#3\expandafter\endcsname
            \expandafter{\csname pgf@anchor@#1@#2\endcsname}}
\makeatother            

\pgfdeclareanchoralias{dipchip}{pin 1}{input 1}
\pgfdeclareanchoralias{dipchip}{pin 2}{input 2}
\pgfdeclareanchoralias{dipchip}{pin 4}{output 1}
\pgfdeclareanchoralias{dipchip}{pin 3}{output 2}

\begin{document}
\begin{circuitikz}
\draw (0,0) node[dipchip,num pins=4,external pins width=0.0,no topmark,hide numbers](C1){IC1};
\draw (0,-2) node[qfpchip,num pins=4,external pins width=0.0,no topmark,](C2){IC1};

\node [right, font=\tiny] at (C1.bpin 1) {IN1};
\node [right, font=\tiny] at (C1.bpin 2) {IN2};
\node [left, font=\tiny] at (C1.bpin 4) {OUT1};
\node [left, font=\tiny] at (C1.bpin 3) {OUT2};

\draw (C1.input 1) to[short] ++(-1,0) |- (C2.pin 1);
\draw (C1.output 2) to[short] ++(1,0) |- (C2.pin 3);

\end{circuitikz}
\end{document}

enter image description here