|
Resources to Codesys
Abbreviations:
Videos The videos are in Norwegian. Introduksjon til PLS Introduksjon inkl. LD-programmering FBD med ferdiglaget FUN
FBD med ferdiglaget FB CFC med egenutviklet FUN
CFC med egenutviklet FB
CFC med simulert reguleringssystem SFC SFC koplet mot simulert prosess
Regulering av fysisk prosess med PLS Eksport/import av POU fra/til et prosjekt Function blocks The following function blocks (*.export files) can be imported into a Codesys project with the meny Project -> Import (in Codesys). Measurement scaling
P is calculated with the following linear formula: P = a*M + b where a = (P2 – P1) / (M2 – M1) b = P1 - a*M1
Measurement filter
y_mf is calculated as: y_mf = (1 - a) * y_mf_prev + a * y_m where a is the filter constant: a = 1/Nf where Nf is the filter length: Nf = (tf/ts) + 1 At the first iteration, y_mf_prev is set equal to y_m, which makes the initial value of y_mf become equal to y_m.
Time delay This function block implements a time delay, which can be used in e.g. a process simulator.
The time delay is implemented with an array of appropriate length, i.e. The time delay is between the input signal and the output signal from the array. The time delay can be adjusted continuously (i.e. during the simulation). By default, the maximum lenght of the array is N_delay_max = 100, i.e. The largest time delay that can be simulated is tf = 100 * ts. However, by setting N_delay_max to a larger value than 100 inside the function block, you can simulate a larger time delay. E.g. with N_delay_max = 500, you can simulate a time delay of up to 500 * ts. Updated 6 April 2026 by Finn Aakre Haugen |