CODESYS is an IDE for application development on programmable logic controllers (PLCs) distributed by the CODESYS Group in Germany. Use this tag only for questions about CODESYS installation and usage as well as related CODESYS software like CODESYS Control Runtime System and CODESYS Automation Server. Use the tags [structured-text], [ladder-logic], and [sfc], for (ide-agnostic) questions about [plc] or [servo] programming.
Questions tagged [codesys]
240 questions
0
votes
1 answer
OSCAT blinds and automatic calibration
I'm using OSCAT library to control blinds. My PLC is PFC200 from Wago and I'm using e!Cockpit. Everything works fine but I would like to get rid of automatic calibration after power failure built in the BLIND_CONTROL_S function block.
As it is…

Dawid Rutkowski
- 2,658
- 1
- 29
- 36
0
votes
0 answers
How to assign hardware output to a variable in codesys?
I'm actually using the Ecostruxure skin on codesys, trying to attach the output of a Modicon encoder to determine the speed a motor should go.
However, I can't figure out how to grab the variable that would correspond to that data. Any help…

David Boshton
- 2,555
- 5
- 30
- 51
0
votes
1 answer
How to merge multiple arrays in to one array in codesys
I have 4 arrays, each contains 10 words. The goal is to merge these 4 arrays into one bigger array (40 words) in codesys.
I'm able to copy the content of one array with help of a pointer in following way:
declaration:
array1: ARRAY [0..9] OF…

MrHUU
- 3
- 3
0
votes
1 answer
Usage of VAR RETAIN PERSISTENT
I'm using WAGO PLC PFC200 in my home automation project. I've plenty of POUs, each for one room. Each room implements IRoom interface and uses base POU for common logic like turning off all lights.
For lights management, I'm…

Dawid Rutkowski
- 2,658
- 1
- 29
- 36
0
votes
1 answer
Compiling CoDeSys project using the command line
Is it possible to run the CoDeSys compiler to build my project without running the IDE, using only the command line interface?
May be there are other options, for example, some scripts, that can launch the IDE, start the build process, collect the…

jubnzv
- 1,526
- 2
- 8
- 20
0
votes
0 answers
Table of pointers
I'm using Wago PLC - PFC200 - for home automation. I already did most of the things like lights or blinds automation. Recently I decided to do some refactoring and I started to think that such PLC is not a PC with a garbage collector and it might be…

Dawid Rutkowski
- 2,658
- 1
- 29
- 36
0
votes
1 answer
CodeSys killing eth0 on Raspberry Pi 4?
I'm running into a very strange issue attempting to run CodeSys on a 4GB RasPi-4. Long story short, the Pi works fine right up until I start running the CodeSys project. When I do, within 60sec, eth0 goes down and cannot be brought back up. Even…

William McMillan
- 21
- 5
0
votes
2 answers
Need to optimize code (Reduce the size) CODESYS ST (TwinCat 2) to save memory
The code size (CODESYS ST, TwinCat 2) for the beckhoff BC9000 PLC (64 kB max) should be reduced to a minimum:
var
word_CO2: word;
(code skipped)
Need to reduce the size of this…

Andrey Andreev
- 55
- 11
0
votes
1 answer
Change a value from A to B in a certain time
I want it to take a certain time for a value to change between value A to value B. It works this way, but I am limited by a BYTE (255) which makes the scale bad if I want to use larger numbers. And I cant figure out how.
I therefore want help to…

cha28
- 41
- 6
0
votes
2 answers
Codesys IF statement error with bit operation
The compiler gives an error for the following program. I can't solve it.
This is the Codesys system writing it in ST language. I want to operate a solenoid valve using bit operation.
CanRx := can_getDatabox (CAN_2, 10, ADR(CanRx_data),…

Taro NAKAMURA
- 11
- 2
0
votes
2 answers
Concatenate variable
I need to concatenate a string and an integer and a string into a variable - in this case an input.
The inputs are named as following:
DI_Section1_Valve AT %I*: BOOL;
DI_Section2_Valve AT %I*: BOOL;
DI_Section3_Valve AT %I*: BOOL;
Now, I want to…

Thoft
- 15
- 5
0
votes
2 answers
Codesys 3. How to get the translations from static or dinamic text file in ST?
I am using Twincat 3 (4024.10) and I tried the functions "GetTextByStringId" and "GetText" from the library SysLibTargetVisu but the compiler already gives me an error:
Error Unresolved reference: 'GETTEXTBYSTRINGID' 0
It seems that…

Daniel Müller Navarro
- 303
- 2
- 11
0
votes
3 answers
Accessing PLC metadata from Codesys (ABB AC500 PLC)
I have a single PLC program that will be run on multiple ABB AC500 PLCs. I need each PLC to have a very slightly different behaviour (limited to selecting an integer value unique for each PLC, to allow timing of a specific event to be different on…

Philip Jones
- 3
- 2
0
votes
2 answers
How to dynamically create fb instances during runtime on a plc?
I'm new to PLC programming and we need to create a library for a project. We need dynamically created function block instances during the runtime. There is a concept described on the codesys…

Jkirchho
- 3
- 1
0
votes
2 answers
CodeSys get constant value by name
It is possibile in CodeSys get the value of a constant dinamically?
For example:
VAR CONSTANT
MYCONST_1 : INT := 1;
MYCONST_2 : INT := 2;
MYCONST_3 : INT := 3;
MYCONST_4 : INT := 4;
END_VAR
toCheck := 3; // INT
result := 0; //…

Massimo
- 553
- 7
- 24