1ADDLORES(3) MBK LOGICAL FUNCTIONS ADDLORES(3)
2
3
4
6 addlores - create a logical resistor
7
9 #include "mlo.h"
10
11 lores_list ∗addlores(ptfig,type,resi,rcon1,rcon2,name)
12 lofig_list ∗ptfig ;
13 char type ;
14 double resi ;
15 losig_list ∗rcon1, ∗rcon2 ;
16 const char ∗name ;
17
19 ptfig Pointer to the figure in which the resistor should
20 be added
21
22 type Resistor type
23
24 resi Resistor value in Ohms
25
26 rcon1 Pointer to the signal to be connected on the resis‐
27 tor top plate
28
29 rcon2 Pointer to the signal to be connected on the resis‐
30 tor bottom plate
31
32 name Resistor instance name
33
35 addlores creates a new resistor, and adds it to the list of resistors
36 pointed to by ptfig -> LORES. The new resistor is added in front of the
37 list, and becomes itself the list head.
38 The type parameter can take one value :
39
40 RESMIM for a metal resistor
41
42 The resi argument is the resistor value in Ohms.
43 Two connectors are created each time a resistor is added, and the rcon1
44 and rcon2 losigs are attached to the SIG field of the locon of the
45 appropriate connector. The connectors names are rcon1 and rcon2; their
46 direction, DIR, are set to 'R', and their TYPE INTERNAL. For details
47 on the structures, see locon(3) and lores(3).
48
50 addlores returns a pointer to the newly created resistor.
51
53 "∗∗∗ mbk error ∗∗∗ illegal resistor type : type"
54 The type is not a legal resistor type.
55
57 #include "mlo.h"
58
59 void parallel_resistors(void) /∗ netlist of two parallel resistors ∗/
60 {
61 lofig_list ∗pt = NULL ;
62 losig_list ∗in = NULL ;
63 losig_list ∗out = NULL ;
64
65 pt = addlofig("parallel_resistors") ;
66 addlocon(pt,"in",in = givelosig(pt,0),IN) ;
67 addlocon(pt,"out",out = givelosig(pt,1),OUT) ;
68
69 addlores(pt,RESMIM,0.2e-6,in,out,"res1") ;
70 addlores(pt,RESMIM,0.2e-6,in,out,"res2") ;
71 }
72
74 mbk(1), lofig(3), lores(3), locon(3), dellores(3).
75
76
77
78
79
80
81ASIM/LIP6 August 14, 2002 ADDLORES(3)