---
name: "GENLIB_SET_LOCAP"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/GENLIB_SET_LOCAP"
---

# GENLIB\_SET\_LOCAP(3)

set the capacitance value of a logical capacitor, after its creation.

## NAME

GENLIB\_SET\_LOCAP - set the capacitance value of a logical capacitor, after its creation.

## SYNOPSYS

```
#include "mlo.h"
void GENLIB_SET_LOCAP(figname,capname,newcapa)
char ∗figname ;
char ∗capname ;
double newcapa ;
```

## PARAMETERS

- *figname*

  Name of the logical figure

- *capname*

  Instance name of the capacitor

- *newcapa*

  New capacitance value

## DESCRIPTION

**GENLIB\_SET\_LOCAP** looks in the list of capacitors of the logical model *figname* for a capacitor identified by its instance *capname* and set the CAPA field to the newcapa value.

## RETURN VALUE

None

## ERRORS

**"∗∗∗ mbk error ∗∗∗ getlocap impossible :** **capacitor** *name* **doesn't exist in figure** *ptfig -\> NAME***"**

No capacitor matches the name.

## EXAMPLE

```
#include <genlib.h>
int main(int argc,char ∗argv[])
{
  /∗ Create a figure to work on, a parallel capacitor ∗/
  GENLIB_DEF_LOFIG("parallel_cap") ;
  /∗ Define interface ∗/
  GENLIB_LOCON("i",IN,"input") ;
  GENLIB_LOCON("f",OUT,"output") ;
  /∗ Add capacitors ∗/
  GENLIB_LOCAP(CAPMIM,5.1,"input","output","cap1") ;
  GENLIB_LOCAP(CAPMIM,5.2,"input","output","cap2") ;
  /* Modify capacitors value */
  GENLIB_SET_LOCAP("parallel_cap","cap1",6.2) ;
  GENLIB_SET_LOCAP("parallel_cap","cap2",6.3) ;
  /∗ Save all that on disk ∗/
  GENLIB_SAVE_LOFIG() ;
  return 0 ;
}
```

## SEE ALSO

**mbk**(1), [**GENLIB\_DEF\_LOFIG**(3)](/GENLIB_DEF_LOFIG/3.md), **[GENLIB\_LOCAP(3)](/GENLIB_LOCAP/3.md)**
