Debian Codegraph @

texmf-dist/doc/latex/tikz-relay/tikz-relay-doc.tex

raw
1 %% This is file `tikz-relay-doc.tex'
2 %% Version: 1.3
3 %% Version date: 2022-08-07
4 %%
5 %% Copyright (C) 2018-2022 by Luis Paulo Laus, [email protected]
6 %%
7 %% This package can be redistributed and/or modified under the terms
8 %% of the LaTeX Project Public License distributed from CTAN
9 %% archives in directory macros/latex/base/lppl.txt; either
10 %% version 1 of the License, or (at your option) any later version,
11 %% with `The Package' referring to the software `tikzlibrarysfc.code.tex' and its
12 %% accompanying documentation and `The Copyright Holder' referring to the
13 %% person Luis Paulo Laus.
14 %%
15 %%
16 %% IMPORTANT NOTICE:
17 %%
18 %% For error reports, comments or suggestions in case of UNCHANGED
19 %% versions send mail to:
20 %% [email protected]
21 %%
22 %%
23 % to allow compression of cross references.
24 % both pgfmanual and pgfplots manual would be MUCH larger without it.
25 \pdfminorversion=5
26 \pdfobjcompresslevel=2
27 \documentclass[a4paper]{ltxdoc}
28 \usepackage[hyphens]{url}
29 \usepackage[version=latest]{pgf}
30 \usepackage{calc,listings,tikz,units}
31 \usepackage{pdfpages}
32 % if you need an index.
33 \usepackage{makeidx}
34
35 % for cross-references:
36 \usepackage[pdfborder=0 0 0]{hyperref}
37 \hypersetup{%
38 colorlinks=true, % use true to enable colors below:
39 linkcolor=blue,%red,
40 filecolor=blue,%magenta,
41 pagecolor=blue,%red,
42 urlcolor=blue,%cyan,
43 citecolor=blue,
44 %frenchlinks=false, % small caps instead of colours
45 pdfborder=0 0 0, % PDF link-darstellung, falls colorlinks=false. 0 0 0: nix. 0 0 1: default.
46 %plainpages=false,
47 %pdfsubject=,
48 }
49
50 % this is due to some stupidity in pgfmanual-en-macros.tex:
51 % if this macro is not defined, the automatic cross-referencing is
52 % disabled:
53 \def\pgfautoxrefs{1}
54
55 % We need lots of libraries\ldots
56 \usetikzlibrary{backgrounds,circuits.logic.IEC}
57
58 \newif\ifgdccodebasic
59 \newif\ifgdccodeogdf
60
61 \usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
62 \usepackage{amsmath,amssymb}
63 \usepackage{xxcolor}
64 %% \usepackage{pifont}
65 \usepackage{tgpagella} % no ligatures (test)
66 \usepackage{makeidx}
67 \usepackage{enumitem}
68 \usepackage[T1]{fontenc}
69 \usepackage[latin9]{inputenc}
70
71
72 \input{pgfmanual-en-macros} % Borrowed from TikZ/PGF manual
73 % look at ctan:/graphics/pgf/base/doc/macros/pgfmanual-en-macros.tex
74 % http://mirrors.ctan.org/tex-archive/graphics/pgf/base/doc/macros/pgfmanual-en-macros.tex
75
76
77 \makeatletter
78 % the index of PGF contains
79 % ----
80 % This index only contains automatically generated entries. A good index should
81 % also contains carefully selected keywords. This index is not good.
82 % ---
83 % use this line to reset that entry:
84 \def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index}
85 }
86 \makeatother
87
88
89 % this here allows automatic cross-referencing:
90 \RequirePackage{pgfmanual}
91
92 % this here configures automatic cross-referencing.
93 % It works for ANY package that uses pgfkeys and is independent on tikz/pgf.
94 \pgfkeys{
95 % whenever an unqualified key is found, the following key prefix
96 % list is tried to find a match.
97 /pdflinks/search key prefixes in={/tikz/,/pgf/},
98 %
99 % the link prefix written to the pdf file:
100 /pdflinks/internal link prefix=pgfp,
101 %
102 /pdflinks/codeexample links=true,
103 /pdflinks/warnings=false, % for debugging
104 /pdflinks/show labels=false,% for debugging
105 }
106
107 % belongs to \usepackage{makeindex}
108 \makeindex
109
110 \makeatletter
111 \renewcommand*\l@section[2]{%
112 \ifnum \c@tocdepth >\z@
113 \addpenalty\@secpenalty
114 \addvspace{1.0em \@plus\p@}%
115 \setlength\@tempdima{2.5em}%
116 \begingroup
117 \parindent \z@ \rightskip \@pnumwidth
118 \parfillskip -\@pnumwidth
119 \leavevmode \bfseries
120 \advance\leftskip\@tempdima
121 \hskip -\leftskip
122 #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
123 \endgroup
124 \fi}
125 \renewcommand*\l@subsection{\@dottedtocline{2}{2.5em}{3.3em}}
126 \renewcommand*\l@subsubsection{\@dottedtocline{3}{5.8em}{4.2em}}
127 \def\@pnumwidth{2.2em}
128 \makeatother
129
130
131 % Global styles:
132 \tikzset{
133 every plot/.style={prefix=plots/pgf-},
134 shape example/.style={
135 color=black!30,
136 draw,
137 fill=yellow!30,
138 line width=.5cm,
139 inner xsep=2.5cm,
140 inner ysep=0.5cm}
141 }
142
143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 %
145 % This file really starts here, all the above is for pgfmanual
146 % compatibility
147 %\usetikzlibrary{circuits.ee.IEC.relay}
148 \input ../tex/tikzlibrarycircuits.ee.IEC.relay.code
149 \tikzset{circuit symbol unit=2.5mm}
150 \sloppy
151
152 \tikzset{help lines/.style={blue!20,very thin}}
153
154 %\tikzset{circuit symbol open/.style={draw=blue,fill=blue!10},circuit symbol filled/.style={fill=blue,draw},circuit symbol lines/.style={draw=orange},circuit symbol wires/.style={ultra thick,draw=violet}}
155
156 % counter for automatic placement
157 \newcount\xpos
158 \newcount\ypos
159
160 \begin{document}
161
162 \title{Typesetting Electrical Wiring Diagrams for \emph{Relay} Control Systems with \LaTeX{} and \tikzname{}}
163 \author{Luis Paulo Laus\\e-mail: \texttt{[email protected]}}
164 \date{Version: 1.3, Version date: 2022-08-07}
165
166 \maketitle
167
168 \section{Abstract}
169
170 This package contains a collection of symbols for typesetting electrical wiring diagrams for relay control systems. The symbols are meant to agree with international standard IEC~60\,617 \cite{60617-2,60617-4,60617-7,60617-8} which is worldwide adopted with perhaps the exception of the USA. It extends and modifies when needed, the \tikzname-libray |circuits.ee.IEC|. A few non-standard symbols are also included mainly to be used in presentations, particularly with the |beamer| package.
171
172 \section{Introduction}
173 The relay control system has been gradually replaced by PLC (Programmable Controllers) software. However, small automation systems are usually implemented using relay control systems and the descriptions of PLC connection to external components are done using the same symbols as in relay control systems. Relay control systems are traditionally introduced at the very beginning of industrial automation disciplines. This package provides symbols to represent those systems accordingly to IEC~60\,617 \cite{60617-2,60617-4,60617-7,60617-8}.
174
175 Very unfortunately, the author has no access to the current version of that standard. The standards consulted during the elaboration of this package are:
176 \begin{itemize}
177 \item IEC~60\,617-2/1996 Graphical symbols for diagrams -- Part 2: Symbol elements, qualifying symbols and other symbols having general application \cite{60617-2};
178 \item IEC~60\,617-4/1996 Graphical symbols for diagrams -- Part 4: Passive components \cite{60617-4};
179 \item IEC~60\,617-7/1996 Graphical symbols for diagrams -- Part 7: Switchgear, controlgear and protective devices \cite{60617-7};
180 \item IEC~60\,617-8/1996 Graphical symbols for diagrams -- Part 8: Measuring instruments, lamps and signalling devices \cite{60617-8}.
181 \end{itemize}
182 All of the aforementioned standards have been withdrawn and correspond to edition~2 of IEC~60\,617 \cite{60617-2,60617-4,60617-7,60617-8}. The up-to-date edition in now on-line \cite{60617}. The author trust that the symbols in this package have not been modified between versions, but without access to the new edition, it is impossible to say for sure. One indication that improves confidence in the up-to-dateness of this package is the fact that the current edition is based on editions~2 and 3 and the blunt fact that symbols, once adopted, tend to remain unchanged over time. There are also other libraries with free access\footnote{See, for instance, \url{https://symbols.radicasoftware.com/stencil/IEC.html} and \url{https://www.tracepartsonline.net/} and search for ``CEI IEC''.} that show symbols with the same form they appear herein. Please, report any inaccuracy and out-to-date symbols.
183
184 You can also help if you have access to the current standard and can verify and report the accuracy of the information presented herein. Particularly regarding the dimensions employed in the graphs. Some of them were devised using sounding geometrical rules, but many (like circle diameters) were estimated using poor resolution graphics.
185
186 The international standard IEC~60\,617 is adopted worldwide, except the USA, which uses NEMA ICS~19-2002 -- National Electrical Manufacturers Association \cite{NEMA}. If you are interested in NEMA standards you should refer to the |tikz-ladder| package. This package is meant to be used for PLC programming, but can also be used for relay control systems.
187
188
189 \section{Relay Library}
190 \begin{pgflibrary}{circuits.ee.IEC.relay}
191 This library provides graphics for electrical wiring diagrams for relay control systems according to the international standard IEC~60\,617 \cite{60617-2,60617-4,60617-7,60617-8}. The library was written to extend the \tikzname-library |circuit.ee.IEC|. The reader is urged to read the Section~``Circuit Libraries'' of \tikzname\ manual \cite{Tantau}.
192 This library defines the following key:
193
194 \begin{key}{/tikz/circuit ee IEC relay}
195 This key should be passed as an option to a picture or a scope that contains a diagram. It will do some internal setups.
196 \end{key}
197
198 \begin{key}{/tikz/activated}
199 Adding this key to a contact symbol will ``activate the contact'' so that a |make contact| will close, a |break contact| will open and a |change over contact| will change. The ``activated'' symbols are not in accordance with IEC~60\,617 because contact shall be drawn in the deactivated position, but it comes in handy we need to illustrate how a circuit works. The main purpose is for \beamer\ presentations, see Section~\ref{sec:beamer} for details and further examples. Compare deactivated (normal) and activated break contact:
200 \begin{codeexample}[width=3cm]
201 \tikz[circuit ee IEC relay]
202 \draw (0,0) to[break contact] (0,1.5)
203 (1,0) to[break contact,activated] (1,1.5);
204 \end{codeexample}
205 \end{key}
206
207 \begin{key}{/tikz/term=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
208 This key is meant to place text information about the upper terminal of the component. It has nearly the same effect as the |label| key, only the placement position is changed and the following style is used additionally and automatically:
209 \begin{stylekey}{/tikz/every term (initially {font=\string\scriptsize})}
210 Set this style to configure the styling of term labels. Since this
211 key is \emph{not} used with normal labels, it provides an easy way
212 of changing the way info labels look without changing other
213 labels.
214 \end{stylekey}
215 The \meta{options} and \meta{angle} are passed directly to the |label| command. For a detailed discussion of the |label| option refer to the \tikzname\ manual \cite{Tantau}.
216
217 The use of this key is exemplified in Section~\ref{sec:labels}.
218 \end{key}
219
220 \begin{key}{/tikz/term'=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
221 This key is similar to |term|, but it is meant to place text information about the lower terminal of the component. It has nearly the same effect as the |label| key, only the placement position is changed and the following style is used additionally and automatically:
222 \begin{stylekey}{/tikz/every term' (initially {font=\string\scriptsize})}
223 Set this style to configure the styling of term' labels. Since this
224 key is \emph{not} used with normal labels, it provides an easy way
225 of changing the way info labels look without changing other
226 labels.
227 \end{stylekey}
228 The \meta{options} and \meta{angle} are passed directly to the |label| command. For a detailed discussion of the |label| option refer to the \tikzname\ manual \cite{Tantau}.
229
230 The use of this key is exemplified in Section~\ref{sec:labels}.
231 \end{key}
232
233 \begin{key}{/tikz/term''=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
234 This key is similar to |term|, but it is meant to place text information about the upper left terminal of the component mainly for |change over contact|. It has nearly the same effect as the |label| key, only the placement position is changed and the following style is used additionally and automatically:
235 \begin{stylekey}{/tikz/every term'' (initially {font=\string\scriptsize})}
236 Set this style to configure the styling of term'' labels. Since this
237 key is \emph{not} used with normal labels, it provides an easy way
238 of changing the way info labels look without changing other
239 labels.
240 \end{stylekey}
241 The \meta{options} and \meta{angle} are passed directly to the |label| command. For a detailed discussion of the |label| option refer to the \tikzname\ manual \cite{Tantau}.
242
243 The use of this key is exemplified in Section~\ref{sec:labels}.
244 \end{key}
245
246 \end{pgflibrary}
247
248
249 \section{Convention}
250 In this library, the |mid| anchor is used to place annotations, which are secondary symbols placed on top of another symbol, on contacts and the |north| or |south| anchor on |relay coil|. The key |info|, as described in Section~``Circuit Libraries'' of \tikzname\ manual \cite{Tantau}, is used to place the component identification. Observe that the |info| has to be provided for the annotation, if any, or for the symbol itself if the annotation is placed on the right side of the symbol. The keys |term|, |term'| and |term''| are used to place terminal numbers by the side of component terminals. See Section~\ref{sec:labels} for details and examples.
251
252 \section{Symbols}
253 \begin{minipage}{\linewidth}
254 The symbols in this library are:
255 \begin{center}
256 \begin{tabular}{lcc}
257 \emph{key} & IEC~60\,617 \emph{number} & \emph{Appearance}\\
258 |/tikz/resistor| & 04-01-01 &
259 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[resistor] (0,1);}\\
260 |/tikz/fuse| & 07-21-01 &
261 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[fuse] (0,1);}\\
262 |/tikz/inductor IEC relay graphic| & 04-A3-01 &
263 \tikz[circuit ee IEC relay,set inductor graphic = inductor IEC relay graphic,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[inductor] (0,1);}\\
264 |/tikz/bulb| & 08-10-01 &
265 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[bulb] (0,1);}\\
266 |/tikz/magnetic sensor| & 02-08-02 &
267 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[magnetic sensor] (0,1);}\\
268 |/tikz/thermic sensor| & 02-08-01 &
269 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[thermic sensor] (0,1);}\\
270 |/tikz/make contact| & 07-02-01 &
271 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[make contact] (0,1);}\\
272 |/tikz/break contact| & 07-02-03 &
273 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[break contact] (0,1);}
274 \end{tabular}
275 \end{center}
276 \bigskip\end{minipage}
277 \begin{center}
278 \begin{tabular}{lcc}
279 \emph{key} & IEC~60\,617 \emph{number} & \emph{Appearance}\\
280 |/tikz/change over contact| & 07-02-04 &
281 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[change over contact] (0,1);}\\
282 |/tikz/relay coil| & 07-15-01 &
283 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[relay coil] (0,1);}\\
284 |/tikz/proximity sensor coil| & 07-19-01 &
285 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[proximity sensor coil] (0,1);}\\
286 |/tikz/mechanical interlock| & 02-12-11 &
287 \tikz[circuit ee IEC relay,baseline=0cm] {\draw[help lines] (-1.25,-0.5) grid[step=\tikzcircuitssizeunit] +(2.5,1); \draw[dashed] (-0.75,0) to[mechanical interlock] (0.75,0);}\\
288 |/tikz/horn| & 08-10-05 &
289 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-0.75,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[horn] (0,1);}\\
290 |/tikz/var horn IEC relay graphic| & 08-10-05 &
291 \tikz[circuit ee IEC relay,set horn graphic = var horn IEC relay graphic,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[horn] (0,1);}\\
292 |/tikz/buzzer| & NA &
293 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.25) grid[step=\tikzcircuitssizeunit] +(2.5,1.5); \draw (0,0) to[buzzer] (0,1);}\\
294 |/tikz/loud speaker| & NA &
295 \tikz[circuit ee IEC relay,baseline=.5cm] {\draw[help lines] (-1.25,-0.75) grid[step=\tikzcircuitssizeunit] +(2.5,2.5); \draw (0,0) to[loud speaker] (0,1);}
296 \end{tabular}
297 \end{center}
298 Above, the IEC~60\,617 \emph{numbers} in the format of \emph{part-section-number} are as they appear in the standards \cite{60617-2,60617-4,60617-7,60617-8}.
299
300 Three symbols, |resistor|, |inductor| and |bulb| are already defined in \tikzname-library |circuits.ee.IEC|. They are redefined in this package because their proportion was not in agreement with IEC~60\,617. The symbol |inductor| is listed in Annex~A of IEC~60\,617 \cite{60617-4} implying it is deleted and should appear in old diagrams or documentation explaining it is now obsolete. To use this symbol set the option \verb|set inductor graphic = inductor IEC relay graphic| either globally with |tikzset| or locally as the option of a picture or a scope.
301
302 ``Change over contact'' is described in Section~\ref{sec:changeover}. The symbols |make contact|, |break contact| and |change over contact| can be activated (the contact changes the position) and this feature is needed for creating presentations. See Section~\ref{sec:beamer} for details.
303
304 This list may look short, but several other symbols are possible by combining these symbols with annotation. In fact, it is annotations that empower this library.
305
306
307 \subsection{Annotation for relay coils}
308 \begin{minipage}{\linewidth}
309 The |relay coil| can be used alone or combined with annotations to form:
310 \begin{center}
311 \hspace*{-3ex}\begin{tikzpicture}[circuit ee IEC relay,thick,x=16\tikzcircuitssizeunit,y=\tikzcircuitssizeunit]
312 \draw[help lines] (-0.5,-5) grid[step=\tikzcircuitssizeunit] +(4,12); % -(11*n+1-7), 11*n+1
313 \global\xpos=0
314 \global\ypos=0
315 \foreach \x in {, slow operating, slow releasing, slow operating and slow releasing}
316 {
317 \ifnum \xpos>3 \global\xpos=0 \global\advance\ypos by 11 \fi
318 \node[below,align=center,text width=20\tikzcircuitssizeunit] at (\the\xpos,-\the\ypos) {\verb|\x|};
319 \draw (\the\xpos,-\the\ypos) to[relay coil={\x}] (\the\xpos,6-\the\ypos);
320 \global\advance\xpos by 1
321 }
322 \end{tikzpicture}
323 \end{center}
324 \bigskip\end{minipage}
325 \begin{center}
326 \hspace*{-3ex}\begin{tikzpicture}[circuit ee IEC relay,thick,x=16\tikzcircuitssizeunit,y=\tikzcircuitssizeunit]
327 \draw[help lines] (-0.5,-27) grid[step=\tikzcircuitssizeunit] +(4,34);
328 \global\xpos=0
329 \global\ypos=0
330 \foreach \x in {high speed, mechanically latched, alternating current, polarized, electronic, remanent, var remanent, thermal, unaffected by alternating current, mechanically resonant, solenoid valve, pulse counter}
331 {
332 \ifnum \xpos>3 \global\xpos=0 \global\advance\ypos by 11 \fi
333 \node[below,align=center,text width=20\tikzcircuitssizeunit] at (\the\xpos,-\the\ypos) {\verb|\x|};
334 \draw (\the\xpos,-\the\ypos) to[relay coil={\x}] (\the\xpos,6-\the\ypos);
335 \global\advance\xpos by 1
336 }
337 \end{tikzpicture}
338 \end{center}
339 Note that the symbol |relay coil| is used to produce the graphic for other devices which are not relays at all.
340
341
342 \subsection{Annotation for contacts}
343 \begin{minipage}{\linewidth}
344 The contacts can be used alone or combined with annotations to form:
345 \begin{center}
346 \begin{tikzpicture}[circuit ee IEC relay,thick,x=16\tikzcircuitssizeunit,y=\tikzcircuitssizeunit]
347 \draw[help lines] (-0.5,-38) grid[step=\tikzcircuitssizeunit] +(4,45); % -(11*n+1-7), 11*n+1
348 \global\xpos=0
349 \global\ypos=0
350 \foreach \x in {, manually operated, protected manually operated, var push button, push button, pull switch, turn switch, emergency switch, pedal operated, lever operated, crank operated, key operated, removable handle, proximity switch, touch switch, magnetic switch}
351 {
352 \ifnum \xpos>3 \global\xpos=0 \global\advance\ypos by 11 \fi
353 \node[below,align=center,text width=14\tikzcircuitssizeunit] at (\the\xpos,-\the\ypos) {\verb|\x|};
354 \draw (\the\xpos,-\the\ypos) to[make contact={\x}] (\the\xpos,6-\the\ypos);
355 \global\advance\xpos by 1
356 }
357 \end{tikzpicture}
358 \end{center}
359 \bigskip\end{minipage}
360 \begin{center}
361 \begin{tikzpicture}[circuit ee IEC relay,thick,x=16\tikzcircuitssizeunit,y=\tikzcircuitssizeunit]
362 \draw[help lines] (-0.5,-49) grid[step=\tikzcircuitssizeunit] +(4,56);
363 \global\xpos=0
364 \global\ypos=0
365 \foreach \x in {position switch, roller, level switch, var level switch, thermal switch, delayed activation, delayed deactivation, delayed both, static switch, circuit breaker, counter switch, pressure switch, closing momentarily, closing momentarily',early or late,early or late', emergency pull switch, var emergency pull switch, emergency turn switch, var emergency turn switch}
366 {
367 \ifnum \xpos>3 \global\xpos=0 \global\advance\ypos by 11 \fi
368 \node[below,align=center,text width=14\tikzcircuitssizeunit] at (\the\xpos,-\the\ypos) {\verb|\x|};
369 \draw (\the\xpos,-\the\ypos) to[make contact={\x}] (\the\xpos,6-\the\ypos);
370 \global\advance\xpos by 1
371 }
372 \end{tikzpicture}
373 \end{center}
374 Temperature sensitive switch is indicated by either the Greek capital letter $\Theta$ or by the operating temperature conditions written on the right side of the contact and it can be achieved using the |info'| key. It is also usual to indicate pressure-sensitive switches with the roman letter P or by the operating pressure conditions in the same way.
375
376 Some symbols can be obtained by combining symbols in this library with symbols from the \tikzname-library |circuit.ee.IEC|, for instance, a ``static switch, passing current in one direction only'' (IEC symbol 07-25-03) can be drawn using a |make contact| and a |diode| as:
377 \begin{center}
378 \begin{tikzpicture}[circuit ee IEC relay,thick,
379 x=4\tikzcircuitssizeunit,
380 y=2\tikzcircuitssizeunit]
381 \draw[help lines] (-0.5,-.5) grid[step=\tikzcircuitssizeunit] +(2,4);
382 \draw (0,0) -- ++(0,.5)
383 to [diode={scale=-1}] ++(0,1)
384 to [make contact] ++(0,1) -- ++(0,.5);
385 \draw (1,0) -- ++(0,.5)
386 to [diode] ++(0,1)
387 to [make contact] ++(0,1) -- ++(0,.5);
388 \end{tikzpicture}
389 \end{center}
390
391 In this case, the space or grid should be treated very carefully.
392
393 \subsection{Annotation self-placement}
394 \begin{minipage}{\linewidth}
395 The |mid| anchor is used for contacts to place the annotation at the correct position. For instance, a |push button| applied to all kinds of contacts produces:
396 \begin{center}
397 \begin{tikzpicture}[circuit ee IEC relay,thick,x=10\tikzcircuitssizeunit,y=3\tikzcircuitssizeunit]
398 \draw[help lines] (-0.5,-0.3334) grid[step=\tikzcircuitssizeunit] +(5.7,3);
399 \global\xpos=0
400 \global\ypos=0
401 \foreach \x/\s in {make contact, make contact/activated, break contact, break contact/activated, change over contact, change over contact/activated}
402 {
403 \ifnum \xpos>5 \global\xpos=0 \global\advance\ypos by 3 \fi
404 \draw (\the\xpos,-\the\ypos) to[\x={push button,\s}] (\the\xpos,2-\the\ypos);
405 \global\advance\xpos by 1
406 }
407 \end{tikzpicture}
408 \end{center}
409 \bigskip\end{minipage}
410
411 In the case of a |position switch|, |delayed activation|, |delayed deactivation|, |delayed both| and |static switch|, the orientation is also adjusted with the help of the |input| anchor:
412 \begin{center}
413 \begin{tikzpicture}[circuit ee IEC relay,thick,x=10\tikzcircuitssizeunit,y=3\tikzcircuitssizeunit]
414 \draw[help lines] (-0.5,-0.3334) grid[step=\tikzcircuitssizeunit] +(5.7,3);
415 \global\xpos=0
416 \global\ypos=0
417 \foreach \x/\s in {make contact, make contact/activated, break contact, break contact/activated, change over contact, change over contact/activated}
418 {
419 \ifnum \xpos>5 \global\xpos=0 \global\advance\ypos by 3 \fi
420 \draw (\the\xpos,-\the\ypos) to[\x={position switch,\s}] (\the\xpos,2-\the\ypos);
421 \global\advance\xpos by 1
422 }
423 \end{tikzpicture}
424 \end{center}
425
426 \noindent{}and
427
428 \begin{center}
429 \begin{tikzpicture}[circuit ee IEC relay,thick,x=10\tikzcircuitssizeunit,y=3\tikzcircuitssizeunit]
430 \draw[help lines] (-0.5,-0.3334) grid[step=\tikzcircuitssizeunit] +(5.7,3);
431 \global\xpos=0
432 \global\ypos=0
433 \foreach \x/\s in {make contact, make contact/activated, break contact, break contact/activated, change over contact, change over contact/activated}
434 {
435 \ifnum \xpos>5 \global\xpos=0 \global\advance\ypos by 3 \fi
436 \draw (\the\xpos,-\the\ypos) to[\x={delayed both,\s}] (\the\xpos,2-\the\ypos);
437 \global\advance\xpos by 1
438 }
439 \end{tikzpicture}
440 \end{center}
441
442 Annotations can be mirrored using the apostrophe ('), e.g., a ``make contact (of a multiple contact assembly) which is \emph{early} to close relative to the other make contacts of the assembly'' (IEC symbol 07-04-01) obtained from annotation \verb|early or late|. When mirrored, this annotation produces a ``make contact (of a multiple contact assembly) which is \emph{late} to close relative to the other make contacts of the assembly'' (IEC symbol 07-04-02):
443 \begin{codeexample}[width=1.7cm]
444 \begin{tikzpicture}[circuit ee IEC relay,thick]
445 \draw
446 (0,0) to[make contact={early or late}] ++(0,2)
447 (1,0) to[make contact={early or late'}] ++(0,2);
448 \end{tikzpicture}
449 \end{codeexample}
450
451 In the case of a break contact, as in ``break contact (of a multiple contact assembly) which is \emph{late} to open relative to the other break contacts of the assembly'' (IEC symbol 07-04-03) and ``break contact (of a multiple contact assembly) which is \emph{early} to open relative to the other break contacts of the assembly'' (IEC symbol 07-04-04), the use apostrophe (') is reverted:
452 \begin{codeexample}[width=1.7cm]
453 \begin{tikzpicture}[circuit ee IEC relay,thick]
454 \draw
455 (0,0) to[break contact={early or late'}] ++(0,2)
456 (1,0) to[break contact={early or late}] ++(0,2);
457 \end{tikzpicture}
458 \end{codeexample}
459
460 The ``passing make contact closing momentarily when its operating device is \emph{actuated}'' (IEC symbol 07-03-01) and ``Passing make contact closing momentarily when itsoperating device is \emph{released}'' (IEC symbol 07-03-02) are obtained from annotation \verb|closing momentarily| and its mirrored version, respectively.
461
462 Sometimes it is necessary to use both annotation versions as in ``passing make contact closing momentarily when its operating device is actuated or released'' (IEC symbol 07-03-03) which is constructed as:
463 \begin{codeexample}[width=0.7cm]
464 \begin{tikzpicture}[circuit ee IEC relay,thick]
465 \draw
466 (0,0) to[make contact={closing momentarily, closing momentarily'}] ++(0,2);
467 \end{tikzpicture}
468 \end{codeexample}
469
470 Another example of using both annotation versions is the ``position switch, mechanically operated in both directions with two separate circuits'' (IEC symbol 07-08-03) which would be:
471 \begin{codeexample}[width=2.3cm]
472 \begin{tikzpicture}[circuit ee IEC relay,thick]
473 \draw
474 (0,0) to[break contact={name=sw1, position switch, position switch'}] ++(0,2)
475 (2,0) to[make contact={name=sw2, position switch, position switch'}] ++(0,2);
476 \draw[dashed] (sw1.south) -- (sw2.north);
477 \end{tikzpicture}
478 \end{codeexample}
479
480
481 \subsection{Change over contact\label{sec:changeover}}
482 The ``change-over break before make contact'' (IEC symbol 07-02-04) and ``change-over make before break contact'' (IEC symbol 07-02-06) are both obtained from \verb|change over contact| although the latter would require both annotations \verb|early or late, early or late'| as in:
483 \begin{codeexample}[width=0.8cm]
484 \begin{tikzpicture}[circuit ee IEC relay,thick]
485 \draw
486 (0,0) to[change over contact={name=sw1,early or late,early or late'}] ++(0,2) coordinate(n1)
487 (sw1.output 1) -- (sw1.output 1 |- n1);
488 \end{tikzpicture}
489 \end{codeexample}
490
491 The \verb|change over contact| is the only contact in this library that has three terminals. The bottom and top right terminal are connected in the usual way, namely, using the command |to|. To allow the user access to the top left terminal, an anchor named\footnote{The same name convention adopted in \tikzname-library |circuits.ee.IEC| is used here: the symbol default orientations make the component appear as rotated $90^{\circ}$ clockwise. The terminals on the left (bottom in the normal orientation) are named inputs and anchors with names starting with |input| are automatically placed. The terminals on the right (top in the normal orientation) are the outputs and anchors with names starting with |output| are automatically placed.} |output 1| is automatically placed. To use this anchor, the contact has to be named. The reference is available in the same and subsequent paths. Therefore,
492
493 \begin{codeexample}[width=2.9cm]
494 \begin{tikzpicture}[circuit ee IEC relay,thick]
495 \draw (0,0) to[change over contact={name=sw1}] ++(0,2) coordinate(n1)
496 (sw1.output 1) -- (sw1.output 1 |- n1);
497 \draw[{<[sep=2pt]}-,red,thin] (sw1.output 1) -- ++(-0.5,0)
498 node[left]{3$^{\mathrm{rd}}$ term.};
499 \end{tikzpicture}
500 \end{codeexample}
501
502 \noindent{}where \verb|(n1)| is used to store the coordinates of the second point making it possible to draw a vertical line with the same vertical level\footnote{In this case, the second point coordinates are known to be \verb|(0,2)|, but in general it is a good idea to use the command |coordinate| to store the information for future use. This allows for the contact to be moved easily when needed.}. The second part of the |\draw| command just draws a line from |(sw1.output 1)| to \verb!(sw1.output 1 |- n1)!, a point with $x$ coordinate equal to |(sw1.output 1)|${}_{x}$ and $y$ coordinate equal to |(n1)|${}_{y}$. Refer to Section~``Coordinates at Intersections'' of \tikzname\ manual \cite{Tantau} for details. This example also uses relative points; refer to Section~``Special Syntax for Specifying Points'' of \tikzname\ manual \cite{Tantau} for details. The use of relative coordinates and anchor allows for the easy repositioning of the elements. Keep in mind that:
503 \begin{codeexample}[width=3.4cm]
504 \begin{tikzpicture}[thick]
505 \coordinate (n1) at (0,0);
506 \coordinate (n2) at (1.3,1);
507 \draw node[red,label={below left:n1}]{$\times$}
508 (n1) -- (n1 |- n2) node[draw=violet]{} node[above left] {\verb!|-!} -- (n2)
509 (n1) -- (n1 -| n2) node[draw=orange]{} node[below right]{\verb!-|!} -- (n2)
510 node[blue,label={above right:n2}]{$\times$};
511 \end{tikzpicture}
512 \end{codeexample}
513
514
515 \section{Labels\label{sec:labels}}
516 You can place information on the left side of a symbol using |info| and on the right side with |info'|. Note that, if the symbol has an annotation on its left side and you want to use |info|, you have to use |info| in the annotation. The same is valid for |info'| if the annotation is on the right side of the symbol.
517 For instance, a relay coil named K1 is labelled as:
518 \begin{codeexample}[width=2.5cm]
519 \tikz[circuit ee IEC relay,thick]
520 \draw (0,0) to[relay coil={info=K1}] (0,1);
521 \end{codeexample}
522 \noindent{}but a slow operating relay coil has to be labelled in the |slow operating| key as:
523 \begin{codeexample}[width=2.5cm]
524 \tikz[circuit ee IEC relay,thick]
525 \draw (0,0) to[relay coil={slow operating={info=K2}}] (0,1);
526 \end{codeexample}
527 \noindent{}failing to do so produces an incorrect labelling position as:
528 \begin{codeexample}[width=2.5cm]
529 \tikz[circuit ee IEC relay,thick,red]
530 \draw (0,0) to[relay coil={slow operating,info=K2}] (0,1);
531 \end{codeexample}
532 \noindent{}In the last case, the |info| is applied to |relay coil|, not to the annotation |slow operating|.
533
534 On the other hand, if the annotation is placed at the right of the symbol, like a solenoid valve, the |info| is placed in the symbol itself (not in the annotation):
535 \begin{codeexample}[width=3cm]
536 \tikz[circuit ee IEC relay,thick]
537 \draw (0,0) to[relay coil={solenoid valve,info=Y2}] (0,1);
538 \end{codeexample}
539
540 The same reasoning applies to the right side using the |info'| key: if there is an annotation on the right side, use the |info'| inside the annotation key:
541 \begin{codeexample}[width=4.5cm]
542 \tikz[circuit ee IEC relay,thick]
543 \draw (0,0)
544 to[relay coil={solenoid valve={info'={[blue]RELEASE}},info=Y2}] (0,1);
545 \end{codeexample}
546 \noindent{}but if there is no annotation or the annotation is on the left side, use the |info'| inside the symbol:
547 \begin{codeexample}[width=3.8cm]
548 \tikz[circuit ee IEC relay,thick]
549 \draw (0,0)
550 to[relay coil={slow operating={info=K2},info'={[blue]START}}] (0,1);
551 \end{codeexample}
552
553 It is also possible to label the terminals for assembling reference. There are three specially designed keys for it:
554
555 \begin{description}[align=right,leftmargin=14mm,labelwidth=12mm,labelsep=2mm]
556 \item [{term}] places a label at the top right side of the symbol. It is meant to identify the top terminal. Because of the \tikzname\ convention, an anchor named |output| is placed on this terminal;
557 \item [{term'}] places a label at the bottom right side of the symbol. It is meant to identify the bottom terminal. Because of the \tikzname\ convention, an anchor named |input| is placed on this terminal;
558 \item [{term''}] places a label at the top left side of the symbol. It is meant to identify the top left terminal of a change over contact. Because of the \tikzname\ convention, an anchor named |output 1| is placed on this terminal. The key term'' places the label such that a line to |output 1| can be drawn vertically or horizontally without crossing the label.
559 \end{description}
560 Each one of these three keys can be individually styled using the style, e.g., |every term'/.style|.
561
562 A slow operating relay coil:
563 \begin{codeexample}[width=2.5cm]
564 \tikz[circuit ee IEC relay,thick]
565 \draw (0,0) to[relay coil={slow operating={info=K2},term=A1,term'=A2}] (0,1);
566 \end{codeexample}
567 A change over contact of the same relay:
568 \begin{codeexample}[width=2.5cm]
569 \tikz[circuit ee IEC relay,thick]
570 \draw (0,0) to[change over contact={info=K2,
571 term=34,term'=31,term''=32}] (0,1);
572 \end{codeexample}
573
574
575 \section{Design Guidance\label{sec:guidance}}
576 This section brings some recommendations that reflect the way I produce diagrams for relay control systems. It may or may not work for you. Feel free to e-mail me if you have better ideas.
577
578 The first thing to consider is that, as the manual says, ``\tikzname\ \emph{ist kein Zeichenprogramm}'' which translates to ``\tikzname\ \emph{is not a drawing program}'' \cite[p.~27]{Tantau}. You shall start with a draft of your diagram and then codify it using \tikzname. Generally, a handmade pencil sketch will do. In this draft, you shall use node names for future reference. For instance, the |contact| named |N1| below is used as a connection point for the latching contact of relay $K_1$; contacts |N0L| and |N24L| are used for power rails (left side).
579
580 \begin{codeexample}[width=2.5cm]
581 \begin{tikzpicture}[circuit ee IEC relay,thick]
582 \draw (0,0)
583 node[contact,name=N0L]{}
584 to [relay coil={info=$K_1$}] ++(0,1)
585 to [break contact={thermal switch={info=$F_R$}}] ++(0,1)
586 to [break contact={push button={info=$b_0$}}] ++(0,1)
587 node[contact,name=N1]{}
588 to [make contact={push button={info=$b_1$}}] ++(0,1)
589 node[contact,name=N24L]{};
590 \node[left,red] at(N1) {N1};
591 \node[left,red] at(N0L) {N0L};
592 \node[left,red] at(N24L) {N24L};
593 \end{tikzpicture}
594 \end{codeexample}
595
596 The second thing to consider is that |tikz-relay| uses the |\tikzcircuitssizeunit| to keep all figures proportional. Therefore, when you consider any dimension related to symbol size it is a good idea to set that dimension with respect to |\tikzcircuitssizeunit|, i.e., using |\tikzcircuitssizeunit| as the unit of length. The default value of |\tikzcircuitssizeunit| is 7\,pt or approximately 2.46\,mm and it can be set by the |circuit symbol unit| key among several other keys. You can think of |\tikzcircuitssizeunit| as the module size $M$ in IEC~60\,617 \cite{60617-7}.
597 Most symbols presented in the IEC~60\,617 are draw using $M=\unit[2.5]{mm}$. This can be achieved by placing the command \verb|\tikzset{circuit symbol unit=2.5mm}| in the document preamble which changes |\tikzcircuitssizeunit| to \the\tikzcircuitssizeunit\ document wide (not too different from the default value though). You can establish your own length unit and set $x$ and $y$ to that length unit. In this way you will be working on a grid; if it is too big or too small you will have to change a single declaration.
598
599 Finishing up the previous example, the |x| grid is set to five |\tikzcircuitssizeunit| to allow horizontal space for labels and the |y| grid is set to four |\tikzcircuitssizeunit| because the symbols used in the control circuit schematics are two |\tikzcircuitssizeunit| tall, so there will be one |\tikzcircuitssizeunit| above and below the symbol. Starting at |N1|, the latching contact of $K_1$ is placed one horizontal length unit aside $b_1$.
600
601 \begin{codeexample}[width=4.1cm]
602 \begin{tikzpicture}[circuit ee IEC relay,thick,
603 x=5\tikzcircuitssizeunit,y=4\tikzcircuitssizeunit]
604 \draw (0,0)
605 node[contact,name=N0L]{}
606 to [relay coil={info=$K_1$}] ++(0,1)
607 to [break contact={thermal switch={info=$F_R$}}] ++(0,1)
608 to [break contact={push button={info=$b_0$}}] ++(0,1)
609 node[contact,name=N1]{}
610 to [make contact={push button={info=$b_1$}}] ++(0,1)
611 node[contact,name=N24L]{};
612 \draw (N1) -- ++(1,0)
613 to [make contact={info=$K_1$}] ++(0,1)
614 node[contact,name=N24R]{};
615 % power rails
616 \draw (N24L) ++(-0.8,0) node[left]{$\unit[+24]{V}$} -- (N24R) -- ++(0.3,0)
617 (N0L) ++(-0.8,0) node[left]{$\unit[0]{V}$} -- (N0L -| N24R) -- ++(0.3,0);
618 \end{tikzpicture}
619 \end{codeexample}
620 \noindent{}Power rails are placed using named nodes. This is not really necessary since the beginning and end of the power rail lines can be determined easily because we are working on a grid.
621
622 Because of the direction chosen when the symbols were first defined in \tikzname, we start from the bottom moving to the top of the diagram. This is not mandatory, although changing the direction requires that all symbols and annotations be negatively scaled (locally rotated by $180^{\circ}$), for instance, the last example would be:
623
624 \begin{codeexample}[width=4.1cm]
625 \begin{tikzpicture}[circuit ee IEC relay,thick,
626 x=5\tikzcircuitssizeunit,y=4\tikzcircuitssizeunit,
627 every circuit symbol/.style={scale=-1},
628 every circuit annotation/.style={scale=-1}]
629 \draw (0,0)
630 node[contact,name=N24L]{}
631 to [make contact={push button={info=$b_1$}}] ++(0,-1)
632 node[contact,name=N1]{}
633 to [break contact={push button={info=$b_0$}}] ++(0,-1)
634 to [break contact={thermal switch={info=$F_R$}}] ++(0,-1)
635 to [relay coil={info=$K_1$}] ++(0,-1)
636 node[contact,name=N0L]{};
637 \draw (1,0)
638 node[contact,name=N24R]{}
639 to [make contact={info=$K_1$}] ++(0,-1) -- (N1);
640 % power rails
641 \draw (N24L) ++(-0.8,0) node[left]{$\unit[+24]{V}$} -- (N24R) -- ++(0.3,0)
642 (N0L) ++(-0.8,0) node[left]{$\unit[0]{V}$} -- (N0L -| N24R) -- ++(0.3,0);
643 \end{tikzpicture}
644 \end{codeexample}
645 \noindent{}where \verb|every circuit symbol/.style={scale=-1}| and \verb|every circuit annotation/.style={scale=-1}| were used to scale the symbols and annotations, respectively. This example produces the very same diagram, but we start at the top and work down to the bottom.
646
647 \subsection{Some tricks}
648 Power circuit schematics use a more diverse variety of symbol heights than control circuit schematics. Thus, it is better to set the grid to a smaller value. This allows for higher control over the symbol's distance. For each symbol, consider its height and allow some extra space between symbols.
649
650 Some symbols like relay coils for power circuits schematics are not available, thus we can draw a square by the side of the relay contacts and connect it to the rightmost contact using a dashed line. The |mid| anchor is perfect for that. We shall start at the |mid| anchor of the rightmost contact and draw a dashed line to the left using relative coordinates, at the end of the dashed line we place a square node with no text inside, but with a label above (or left) identifying the relay coil.
651
652 The inductors look a bit odd: the semicircles end in very sharp corners. It is better to change the |line joint| to |bevel|.
653
654 You can use different styles for |info| and |info'|, and also for |term|, |term'| and |term''|, but it is usually a bad idea. It is normally best to set a style for one of these keys and copy it to the others.
655
656 For example, a star-delta motor starter has a power circuit schematic like:
657
658 % Power Circuit Schematic
659
660 \begin{codeexample}[width=4.5cm]
661 \begin{tikzpicture}[circuit ee IEC relay,thick,
662 x=\tikzcircuitssizeunit,
663 y=1.2\tikzcircuitssizeunit,
664 every inductor/.style={line join=bevel},
665 every term/.style={gray,font=\scriptsize},
666 every term'/.style=every term,
667 every term''/.style=every term]
668 \draw (0,0)
669 to[make contact={term=1,term'=2}] ++(0,4)
670 -- ++(0,1)
671 node[contact,name=N1R]{}
672 -- ++(0,4)
673 to [inductor={name=LR,term=1,term'=4}] ++(0,5)
674 node[contact,name=N2R]{}
675 to [thermic sensor={info=$F_R$,term=1,term'=2}] ++(0,3)
676 to [make contact={term=1,term'=2}] ++(0,4)
677 to [fuse={info={$\unit[3\times5]{A}$}}] ++(0,4)
678 node[above]{R};
679 \draw (0,0) -- ++(4,0) node[contact]{}
680 to[make contact={term=3,term'=4}] ++(0,4)
681 -- ++(0,1)
682 node[contact,name=N1S]{}
683 -- ++(0,4)
684 to [inductor={name=LS,term=2,term'=5}] ++(0,5)
685 node[contact,name=N2S]{}
686 to [thermic sensor={term=3,term'=4}] ++(0,3)
687 to[make contact={term=3,term'=4}] ++(0,4)
688 to [fuse] ++(0,4)
689 node[above]{S};
690 \draw (4,0) -- ++(4,0)
691 to[make contact={name=K2T,term=5,term'=6}] ++(0,4)
692 -- ++(0,1)
693 node[contact,name=N1T]{}
694 -- ++(0,4)
695 to [inductor={name=LT,term=3,term'=6}] ++(0,5)
696 node[contact,name=N2T]{}
697 to [thermic sensor={term=5,term'=6}] ++(0,3)
698 to[make contact={name=K1T,term=5,term'=6}] ++(0,4)
699 to [fuse] ++(0,4)
700 node[above]{T};
701 \draw
702 (N1R) -- ++(2,0)
703 to[make contact={term=3,term'=4}] ++(0,4) |- (N2S)
704 (N1S) -- ++(2,0)
705 to[make contact={name=K3T,term=5,term'=6}] ++(0,4) |- (N2T)
706 (N1T) -| ++(2,-6) -| ++(-15,6) -- ++(3,0)
707 to[make contact={term=1,term'=2}] ++(0,4) |- (N2R);
708 \draw[dashed](K1T.mid) --++(-10,0) % relay coils
709 node[left,draw,solid,minimum size=3mm,label={[above]:$K_1$}]{};
710 \draw[dashed](K2T.mid) --++(-10,0)
711 node[left,draw,solid,minimum size=3mm,label={[above]:$K_2$}]{};
712 \draw[dashed](K3T.mid) --++(-10,0)
713 node[left,draw,solid,minimum size=3mm,label={[above]:$K_3$}]{};
714 \end{tikzpicture}
715 \end{codeexample}
716
717 Control circuit schematics can use a much bigger grid space because the symbol heights are the same, i.e. always two units of length. When setting the |x| unit of length, you need to consider the space occupied by labels and annotations.
718
719 Sometimes we need to place a symbol upside-down. This is the case of the star-delta motor starter control circuit schematic in which a change over contact is used to change from $K_2$ to $K_3$. To achieve the correct orientation, a negative |y| scaling is set by |yscale=-1|. This contact is named |t1| for future reference, in this case, to access the |output 1| and connect it to $K_2$. If you think it is against IEC~60\,617 rules to draw the change over contact upset-down you will end up with a terrible layout because of the position of the common terminal.
720
721 The relay coil $K_3$ is also placed using a top-down direction and, consequently, it has to be negatively scaled (mirrored). In this case, we need to mirror the symbol in both |x| and |y| direction so the terminal and symbol identification will be correctly located. So, |scale=-1| is used.
722
723 The power rails are drawn using grid coordinates. A fuse is placed on the top power rail.
724
725 % Control Circuit Schematic
726
727 \begin{codeexample}[]
728 \begin{tikzpicture}[circuit ee IEC relay,thick,
729 x=9\tikzcircuitssizeunit,
730 y=5\tikzcircuitssizeunit,
731 every term/.style={gray,font=\scriptsize},
732 every term'/.style=every term,
733 every term''/.style=every term]
734 \draw (0,0)
735 node[contact]{}
736 to [relay coil={info=$K_1$,term=A1,term'=A2}] ++(0,1) -- ++(0,1)
737 node[contact,name=N1]{}
738 to [break contact={thermal switch={info=$F_R$},term=21,term'=22}] ++(0,1)
739 to [break contact={push button={info=$b_0$},term=11,term'=12}] ++(0,1)
740 node[contact,name=N2]{}
741 to [make contact={push button={info=$b_1$},term=13,term'=14}] ++(0,1)
742 node[contact,name=N3]{};
743 \draw (N2) -- ++(1,0)
744 to [make contact={info=$K_1$,term=13,term'=14}] ++(0,1)
745 node[contact]{};
746 \draw (1,0)
747 node[contact]{}
748 to [relay coil={slow operating={info=$T_1$},term=A1,term'=A2}] ++(0,1) -- ++(0,1)
749 node[contact,name=N4]{} --(N1);
750 \draw (N4) -- ++(2,0)
751 to [change over contact={yscale=-1,info=$T_1$,name=t1,term=24,term'=21,term''=22}] ++(0,-1)
752 to [relay coil={scale=-1,info=$K_3$,term=A1,term'=A2}] ++(0,-1)
753 node[contact]{};
754 \draw (2,0)
755 node[contact]{}
756 to [relay coil={info=$K_2$,term=A1,term'=A2}] ++(0,1) |- (t1.output 1);
757 \draw(-0.8,0) node[left]{$\unit[0]{V}$} -- +(4.2,0) % power rails
758 (-0.8,5) node[left]{$\unit[+24]{V}$} to[fuse={info={$\unit[2]{A}$}}] (N3) -- +(3.4,0);
759 \end{tikzpicture}
760 \end{codeexample}
761
762
763 \subsection{Beamer presentation with overlay\label{sec:beamer}}
764
765 Perhaps the most important feature of \beamer\ is its capacity of creating a series of slides based on one slide, e.g., showing one concept step by step. It is called \emph{overlay}. Unfortunately, \beamer\ overlay and \tikzname\ present some compatibility issues when overlay macros are typed in the options list of a \tikzname\ command. This can be solved by setting two \tikzname\ keys that take advantage of the fact that |\pgfkeysalso| doesn't change the path.
766
767 \begin{codeexample}[code only]
768 \tikzset{ % alt and visible (overlay)
769 alt/.code args={<#1>#2#3}{%
770 \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
771 },
772 visible/.code args={<#1>#2}{%
773 \alt<#1>{\pgfkeysalso{#2}}{}
774 }
775 }
776 \end{codeexample}
777 Once these keys are in place, they can be used instead of |\visible| and |\alt| macros with a syntax slightly different. The following example creates three slides to illustrate how a push button works with a |break contact| and, when pushed, |break contact| is |activated|. Bellow, the result is shown side by side:
778
779 \begin{codeexample}[width=6.8cm,render instead={\begin{tikzpicture}[circuit ee IEC relay,thick,y=3\tikzcircuitssizeunit]
780 \node[ground={point down,name=gnd}] at(0,0) {};
781 \draw(gnd)
782 to ++ (0,0.5)
783 to[bulb={info=L1,fill=yellow}] ++ (0,1)
784 to[break contact={push button={info=B1}}] ++ (0,1)
785 -- ++ (0,0.5) node[current direction={point up}]{} node[right]{12V};
786 \node[red,font=\small\itshape,below=4mm] at(gnd) {slide 1};
787 \node[ground={point down,name=gnd}] at(2cm,0) {};
788 \draw(gnd)
789 to ++ (0,0.5)
790 to[bulb={info=L1}] ++ (0,1)
791 to[break contact={push button={info=B1},activated}] ++ (0,1)
792 -- ++ (0,0.5) node[current direction={point up}]{} node[right]{12V};
793 \node[red,font=\small\itshape,below=4mm] at(gnd) {slide 2};
794 \node[ground={point down,name=gnd}] at(4cm,0) {};
795 \draw(gnd)
796 to ++ (0,0.5)
797 to[bulb={info=L1,fill=yellow}] ++ (0,1)
798 to[break contact={push button={info=B1}}] ++ (0,1)
799 -- ++ (0,0.5) node[current direction={point up}]{} node[right]{12V};
800 \node[red,font=\small\itshape,below=4mm] at(gnd) {slide 3};
801 \end{tikzpicture}}]\begin{tikzpicture}[circuit ee IEC relay,thick,
802 y=3\tikzcircuitssizeunit]
803 \node[ground={point down,name=gnd}] at(0,0) {};
804 \draw(gnd)
805 to ++ (0,0.5)
806 to[bulb={info=L1,visible={<1,3>{fill=yellow}}}] ++ (0,1)
807 to[break contact={push button={info=B1},
808 alt={<2>{activated}{}}}] ++ (0,1)
809 -- ++ (0,0.5) node[current direction={point up}]{}
810 node[right]{12V};
811 \end{tikzpicture}
812 \end{codeexample}
813 \noindent{}During the presentation you can say that ``pressing B1 the lamp~L1 turns off, releasing it turns L1 on again''. One cool trick is to move forward and backwards between slides~2 and 3.
814
815 To draw this example, we start with the schematics and once it is ready the animation part is done by placing keys |visible| and |alt| in suitable locations. The filling of L2 is visible only in slide~1 and 3. B1 appears differently depending on the slide. For slides~1 and 3, B1 is a normal break contact (closed), but in slide~2 it is an ``activated'' break contact which is open. Note that key |bulb| receives or not the key |fill|. Similarly, the key |break contact| receives or not the key |activated| (the key |visible| could be used instead of |alt|).
816
817 When developing ``animations'', you may need to know the overlay number. It can be printed, say in the frame title, using macro |\overlaynumber|; type this in the document preamble:
818
819 \begin{codeexample}[code only]
820 \makeatletter
821 \newcommand*{\overlaynumber}{\number\beamer@slideinframe}
822 \makeatother
823 \end{codeexample}
824
825 If you need to generate a handout, the |visible| argument will be drawn as well as the \emph{first} argument of |alt| no matter what is the overlay specification (the thing between |<| and |>| signs). Therefore, the above example would appear like this:
826 \begin{codeexample}[width=2.5cm]
827 \begin{tikzpicture}[circuit ee IEC relay,thick,
828 y=3\tikzcircuitssizeunit]
829 \node[ground={point down,name=gnd}] at(0,0) {};
830 \draw(gnd)
831 to ++ (0,0.5)
832 to[bulb={info=L1,fill=yellow}] ++ (0,1)
833 to[break contact={push button={info=B1},activated}] ++ (0,1)
834 -- ++ (0,0.5) node[current direction={point up}]{}
835 node[right]{12V};
836 \end{tikzpicture}
837 \end{codeexample}
838 \noindent{}and it does not match any of the previous slides\footnote{It is just wrong.}. Keep in mind that you shall finish the schematic in the regular form (without any activated contact) and then |activated| can be inserted always as the second argument of |alt|; the first argument shall be left empty, e.g., \verb|alt{<1,3>{}{activated}}|. Alternatively, you can use, e.g., \verb|alt{<1,3>{activated=false}{activated=true}}|. The slide numbers enlisted in the overlay specification shall correspond to slides in which the contact is \emph{not} activated.
839
840 The ``correct'' diagram that works both in |beamer| and |handout| modes is:
841
842 \begin{codeexample}[code only]
843 \begin{tikzpicture}[circuit ee IEC relay,thick,
844 y=3\tikzcircuitssizeunit]
845 \node[ground={point down,name=gnd}] at(0,0) {};
846 \draw(gnd)
847 to ++ (0,0.5)
848 to[bulb={info=L1,visible={<1,3>{fill=yellow}}}] ++ (0,1)
849 to[break contact={push button={info=B1},
850 alt={<1,3>{}{activated}}}] ++ (0,1)
851 -- ++ (0,0.5) node[current direction={point up}]{}
852 node[right]{12V};
853 \end{tikzpicture}
854 \end{codeexample}
855 \noindent{}The handout will show a lighted lamp in series with a deactivated break contact. If you do not want that the lamp appears lighted, use \verb|alt={<2>{}{fill=yellow}}| instead of |visible|. So, the lamp will not the lighted on slide~2 (implying it will be in slides~1 and 3) and it will not be lighted in the handout as well.
856
857 A complete, though minimalistic, example is provided in a separated file\footnote{This file should be in the same folder you have found this document, if not try \url{http://repositorios.cpai.unb.br/ctan/graphics/pgf/contrib/tikz-relay/doc/BeamerAnimation.tex}.}: ``BeamerAnimation.tex'', which is listed in Appendix~A for your convenience. In this example, a four-step sequencer is animated. A total of twenty slides are generated based on a single schematic. The frame title includes the macro |\overlaynumber| which generates the slide number and shall be removed once the presentation is ready. So, all slides would look like the same slide, but with animation on it.
858
859
860 \subsection{Adjusting the diagram size}
861
862 The diagram size can be adjusted by setting |x| and |y| units. Mainly, you change those to control the space between symbols, not the diagram size in total\footnote{The total size will change, but it is more like collateral damage than intentional deed.}. If your diagram is too big, consider using a landscape page.
863
864 For presentations, adjustments can be done using |resizebox|. Note that you should only use |resizebox| if your diagram is slightly bigger than the presentation area. If it is too much bigger, the use of |resizebox| will render small symbols leading to readability problems. In this case, one option is to divide the diagram into smaller pieces. Also, you should reconsider why you need such a big diagram in a presentation. Usually, small examples are better to clarify your point.
865
866 It is not a good idea to change the diagram size setting |\tikzcircuitssizeunit| using |circuit symbol unit|. |\tikzcircuitssizeunit| shall be set document-wise in the document preamble and kept unchanged.
867
868
869 \section{Shapes}
870 This is rather technical material, but it is here anyway and you may use it to modify or extend the library. In that case, if you need help, please do not hesitate in contacting the author.
871
872 Several anchors are defined for each symbol (or, more exactly, shapes). The mechanism \tikzname\ uses to place anchors and define borders is sophisticated. It takes into account the line width (or an optional additional space defined by |outer sep|\footnote{See Section~``Common Options: Separations, Margins, Padding and Border Rotation'' of \tikzname\ manual \cite{Tantau}.}) to place the anchors just on the line border of the symbol. Something called ``anchor border'' is also defined in the same manner. An Anchor border is used to place labels around the symbol and interrupt the line directed to the symbol. Remember that a symbol is usually placed by command |to| which interrupts the path line the symbol is placed on. It makes perfect sense for symbols that enclose some area, like |proximity sensor coil| and |relay coil| and even for symbols that, although they do not enclose an area, define some intuitive border, like |magnetic sensor| and |thermic sensor|. But it makes little sense for contacts.
873
874 Contacts can be considered a special case of symbols. They have no defined border and no intuitive notion of inside and outside. The \tikzname-library |circuits| places them in a category called ``wires''. The normal anchors (north, south, south west, etc.) have no practical use. Even so, they need a |center| anchor, used to place the symbol, and a |mid| anchor used to place annotations. They also need an anchor border to interrupt the line during placement (and also for label positioning). The anchor border controls the gap that appears on the line. Thus, it is defined as the symbol size. In other words, the symbol size is an invisible border a bit smaller than the actual symbol because the inclined line which represents the movable contact has an addendum that protrudes beyond the symbol border.
875
876 Outer separation is also undesired when placing contact. If the normal treatment were dispensed for contacts, setting the outer separation to any positive number would disrupt the line connected to the symbol. Instead of setting the outer separation to zero, the shape code that produces contacts simply disregards the outer separation when drawing the component.
877
878 All symbols below but the |mechanical interlock| look rotated $90^{ \circ}$ because \tikzname\ uses this orientation to place the symbol in a line.
879
880
881 \begin{codeexample}[]
882 \begin{tikzpicture}[circuit ee IEC relay]
883 \node[name=s, shape=make contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=3cm]{};
884 \foreach \anchor/\placement in {center/above, 30/above right, 70/above, 358/below right,
885 north/above, north east/above, north west/above,
886 south/below, south east/below, south west/below,
887 east/left, west/right, mid/above, input/left,output/right,
888 tip/right}
889 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
890 \end{tikzpicture}
891 \end{codeexample}
892
893
894 \begin{codeexample}[]
895 \begin{tikzpicture}[circuit ee IEC relay]
896 \node[name=s, activated, shape=make contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=3cm]{};
897 \foreach \anchor/\placement in {center/above left, 30/above right, 70/above, 358/below right,
898 north/above, north east/above, north west/above,
899 south/below, south east/below, south west/below,
900 east/left, west/right, mid/above right, input/left,output/right,
901 tip/above}
902 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
903 \end{tikzpicture}
904 \end{codeexample}
905
906
907 \begin{codeexample}[]
908 \begin{tikzpicture}[circuit ee IEC relay]
909 \node[name=s, shape=break contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=3cm]{};
910 \foreach \anchor/\placement in {center/above left, 30/above right, 280/below, 358/below right,
911 north/above right, north east/above, north west/above,
912 south/below, south east/below, south west/below,
913 east/left, west/right, mid/above, input/left,output/right,
914 tip/right}
915 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
916 \end{tikzpicture}
917 \end{codeexample}
918
919
920 \begin{codeexample}[]
921 \begin{tikzpicture}[circuit ee IEC relay]
922 \node[name=s, activated, shape=break contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=3cm]{};
923 \foreach \anchor/\placement in {center/above left, 30/above right, 280/below, 358/below right,
924 north/above right, north east/above, north west/above,
925 south/below, south east/below, south west/below,
926 east/left, west/right, mid/above, input/left,output/right,
927 tip/right}
928 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
929 \end{tikzpicture}
930 \end{codeexample}
931
932
933 \begin{codeexample}[]
934 \begin{tikzpicture}[circuit ee IEC relay]
935 \node[name=s, shape=change over contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=6cm]{};
936 \foreach \anchor/\placement in {center/above, 30/above right, 358/below right,
937 north/above, north east/above, north west/above,
938 south/below, south east/below, south west/below,
939 east/left, west/right, mid/above, input/left,output/right, output 1/below right, output 2/above right,
940 tip/right}
941 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
942 \end{tikzpicture}
943 \end{codeexample}
944
945
946 \begin{codeexample}[]
947 \begin{tikzpicture}[circuit ee IEC relay]
948 \node[name=s, activated, shape=change over contact IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=6cm]{};
949 \foreach \anchor/\placement in {center/above left, 30/above right, 358/below right,
950 north/above, north east/above, north west/above,
951 south/below, south east/below, south west/below,
952 east/left, west/right, mid/above right, input/left,output/right, output 1/below right, output 2/above right,
953 tip/above}
954 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
955 \end{tikzpicture}
956 \end{codeexample}
957
958
959 \begin{codeexample}[]
960 \begin{tikzpicture}[circuit ee IEC relay]
961 \node[name=s, shape=magnetic sensor IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=6cm]{};
962 \foreach \anchor/\placement in {center/below, 15/above right, 330/below right,
963 north/above, north east/above, north west/above,
964 south/below, south east/below, south west/below,
965 east/left, west/right, mid/above, input/left,output/right}
966 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
967 \end{tikzpicture}
968 \end{codeexample}
969
970 \begin{codeexample}[]
971 \begin{tikzpicture}[circuit ee IEC relay]
972 \node[name=s, shape=thermic sensor IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=6cm]{};
973 \foreach \anchor/\placement in {center/below, 15/above right, 330/below right,
974 north/above, north east/above, north west/above,
975 south/below, south east/below, south west/below,
976 east/left, west/right, mid/above, input/left,output/right}
977 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
978 \end{tikzpicture}
979 \end{codeexample}
980
981 \begin{codeexample}[]
982 \begin{tikzpicture}[circuit ee IEC relay]
983 \node[name=s, shape=proximity sensor coil IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=6cm]{};
984 \foreach \anchor/\placement in {center/above, 30/above right, 358/below right,
985 north/above, north east/above, north west/above,
986 south/below, south east/below, south west/below,
987 east/left, west/right, input/left, output/right}
988 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
989 \end{tikzpicture}
990 \end{codeexample}
991
992
993 \begin{codeexample}[]
994 \begin{tikzpicture}[circuit ee IEC relay]
995 \node[name=s, shape=mechanical interlock IEC relay, shape example, inner xsep=1cm, inner ysep=1cm, minimum width=6cm, minimum height=5.2cm]{};
996 \foreach \anchor/\placement in {center/above, mid/below, 30/above right, 358/below right,
997 north/above, north east/above, north west/above,
998 south/below, south east/below, south west/below,
999 east/left, west/right, input/left, output/right}
1000 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
1001 \end{tikzpicture}
1002 \end{codeexample}
1003
1004
1005 \section{Known Issues}
1006
1007 The use of a single plus sign in relative coordinates specification, like |+(0,1)|, can lead to very strange results. See, for instance, the red symbol below:
1008
1009 \begin{codeexample}[width=4.2cm]
1010 \begin{tikzpicture}[circuit ee IEC relay,thick,
1011 error/.style={red,
1012 circuit symbol wires/.style={red},
1013 circuit symbol lines/.style={red}}]
1014 \draw (0,0)
1015 to [make contact={push button={info=$b_1$}}] ++(0,1);
1016 \draw[error] (2.5,0)
1017 to [make contact={push button={info=$b_1$}}] +(0,1);
1018 \end{tikzpicture}
1019 \end{codeexample}
1020
1021 Though it is not clear exactly why it happens, and consequently no permanent solution is available at the moment, one walkaround is to use the double plus sign instead, |++(0,1)|. Note, however, that it will be necessary to reconsider the coordinates of the following points on the path if there are any. Command |coordinate| might help to keep track of previous points.
1022
1023 This library is based on withdrawn standards and the current standardized symbols might be different. It is also rather incomplete; so many symbols are missing, though to my best knowledge the missing symbols are rarely used. Let me know if you need a symbol, I will do my best to implement it.
1024
1025 If you want the report a bug or have any suggestions, please feel free to send me an e-mail. Contact details are on the first page. Every feedback is important.
1026
1027
1028 \section{Final Remarks}
1029
1030 This package has been tested and used for more than three years, so I do believe it is mature by now and I decided to share it. On the other hand, I was the only person who used it, therefore idiosyncrasies were not detected.
1031
1032 Any comments, suggestions, requests for missing symbols and feedback are welcomed. I will do my best to answer as soon as possible. My contact e-mail is on the first page.
1033
1034 It should be great if someone with experience in writing \tikzname\ libraries could have a look at the code and point out errors or improvements to be made.
1035
1036
1037
1038 \begin{thebibliography}{1}
1039
1040 \bibitem{60617-2}\textbf{International Electrotechnical Commission}. \textit{IEC 60\,617-2/1996 Graphical symbols for diagrams -- Part 2: Symbol elements, qualifying symbols and other symbols having general application}. Geneva, 1996.
1041 \bibitem{60617-4}\textbf{International Electrotechnical Commission}. \textit{IEC 60\,617-4/1996 Graphical symbols for diagrams -- Part 4: Passive components}. Geneva, 1996.
1042 \bibitem{60617-7}\textbf{International Electrotechnical Commission}. \textit{IEC 60\,617-7/1996 Graphical symbols for diagrams -- Part 7: Switchgear, controlgear and protective devices}. Geneva, 1996.
1043 \bibitem{60617-8}\textbf{International Electrotechnical Commission}. \textit{IEC 60\,617-8/1996 Graphical symbols for diagrams -- Part 8: Measuring instruments, lamps and signalling devices}. Geneva, 1996.
1044 \bibitem{60617}\textbf{International Electrotechnical Commission}. \textit{IEC 60\,617 - Graphical Symbols for Diagrams}, \url{https://std.iec.ch/iec60617}. Geneva, accessed on 31st July 2022.
1045 \bibitem{NAME}\textbf{National Electrical Manufacturers Association}. \textit{NEMA Standards Publication ICS 19-2002 (R2007, R2011, R2016, R2022) : Diagrams, Device Designations, and Symbols for Industrial Control and Systems}. Rosslyn, 2022.
1046 \bibitem{Tantau}\textbf{Tantau}, Till. \textit{The TikZ and PGF Packages} : Manual for version 3.1.9a-34-ga0d9cada, \url{https://github.com/pgf-tikz/pgf}, 2021.
1047
1048 \end{thebibliography}
1049
1050 \appendix
1051 \newgeometry{left=1cm,right=1cm,top=1.5cm,bottom=1.5cm,nohead}
1052 \section*{Appendix A -- Beamer Example of a Four Step Sequencer}
1053
1054 In this example, the animations are done in two layers: the schematics are drawn in the foreground with contact and filling animation; in the background, circles (actually, ellipses since |x| and |y| scales are different) are drawn in light blue to highlight with contact or coil that has been activated because several of them change from one slide to the next. To place the ellipses in the precise position, every contact and coil is named.
1055
1056 At first, only one coil and the contacts respective to one step are drawn, then they are copied three times and the information is changed as needed. Finally, the $b_s$ is added. When the schematics are done, the animation part is made adding the |alt| key in the foreground and the |\visible| macro in the background.
1057
1058 After the \LaTeX\ code, the slides were included for reference. They shall be found as a separated PDF file in the same folder you have found in this document.
1059
1060 \lstinputlisting[language={[LaTeX]TeX},basicstyle={\small},breakautoindent=true]{BeamerAnimation.tex}
1061 \clearpage
1062 \eject \pdfpagewidth=128mm \pdfpageheight=96mm
1063 \includepdf[pages=-,offset=-116 285,noautoscale]{BeamerAnimation.pdf}
1064
1065 \end{document}