# CODESYS LN

Instructions · `LN` · verification: source checked

LN is an IEC operator that calculates the natural logarithm of a numeric input. It accepts any numeric basic data type as input and returns a REAL or LREAL result. For example, LN(45) yields approximately 3.80666.

## Specification

| Property | Value |
|---|---|
| Language | iec 61131 3 |
| Code | LN |
| Dialect | CODESYS |

## Study notes

- Permitted input data types: any numeric basic data type.
- Permitted output data types: REAL and LREAL.
- Example in ST: q := LN(45); returns 3.80666.

## Sources

1. [Beckhoff Information System](https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2529106571.html) (accessed 2026-10-26)
2. [CODESYS Group](https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_operator_ln.html) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/iec-ln  
JSON: https://machineschema.com/instruction/iec-ln.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
