Questions tagged [codesys]

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.

240 questions
1
vote
0 answers

Unable to open a file on boot application

I am using beagle bone black (very similar to Rasp pi). I created an program to open a file and read temperature readings from it. It works fine when I run the code manually in the Codesys IDE. However when I create a boot application and restart…
Djanko
  • 11
  • 1
1
vote
2 answers

How to inverse a matrix in CODESYS?

Is it possible to calculate the inverse of a matrix in CODEYS? I am trying to write the code for the following equation.
1
vote
1 answer

CONCAT two wstrings in codesys

I have the problem that the CONCAT(str1, str2) function does not take two wstrings and I have not found a concat function for wstring. So how should I do it? I cannot convert the input to string and then back to wstring as I then loose information…
SGKlee
  • 70
  • 6
1
vote
1 answer

Can you display messages in the Codesys message window during runtime? If so how?

My Problem: I have been creating projects using Codesys for the past 6 months or so and while I have learned a lot about the programming environment I have yet to discover a way to display custom messages during runtime to the console message…
Nicholas
  • 112
  • 12
1
vote
1 answer

TwinCAT - How to check contents of a directory from Beckhoff PLC

I am trying to perform file management within the PLC. Currently, NT_StartProcess works as follows, but I will not have any feedback after the process has been spawned. Is there a way to check the contents of a directory from the PLC? Is there any…
nah_ny
  • 37
  • 1
  • 8
1
vote
0 answers

How to implement an OpenVPN Client in CoDeSys?

I need to connect my Codesys PLC (RevPi Connect) to a Webserver using an OpenVPN Client. I could, of course, use the underlying Raspberry Pi to install the OpenVPN, but I would prefer to do this directly in CoDeSys. Is there any way to do…
1
vote
1 answer

CodeSys var_in_out interface and then passing an FB that implements the interface

I'm trying to create an FB which can complete work on an interface that can be implemented in many FINAL FBs. INTERFACE IBaseInterface FUNCTION_BLOCK Base IMPLEMENTS IBaseInterface FUNCTION_BLOCK SYSTEM // the function block that will do the work…
1
vote
1 answer

Performing a Shift Register operation on an array in TwinCAT3 using SHL/SHR

I am very new to PLC programming. Can anyone help with explaining how I can perform a SHR/SHL operation on an array of INT of lets say 10 elements using TwinCAT3. They way I thought I would do this is by moving the shift register one place so that…
pro_to_be
  • 11
  • 3
1
vote
2 answers

Can i save data to csv file using ec4p controller?

I want to save some data to csv file using eaton ec4p controller. I found tutorials that i can do this by using syslibfile library but i can't find it in my libraries. Is it possible that this controller doesn't have this library and can't write…
koliber
  • 23
  • 4
1
vote
1 answer

Use python instead of Structured Text

I have a Codesys Project which becomes more and more complex. Now I’m wondering if there is a python library that lets me do the programming part, I’m usually doing with Structured Text via Python? Thank you A
aerioeus
  • 1,348
  • 1
  • 16
  • 41
1
vote
1 answer

Why use pointers and reference in codesys V3?

My question is: what are the benefits of using pointers and reference to? I am new to codesys and in my previous job, I programmed in TIA portal (Siemens) and Sysmac Studio (Omron) and never came across pointers or something similar. I think I…
MrUncles
  • 13
  • 3
1
vote
1 answer

How can one preview the source code of a library in CoDeSys 2.3

Is there any way to preview the source code of an imported library in CoDeSys 2.3? When I check the library *.lib file I can see it is not compiled nor obfuscated, but in the CoDeSys there is no option to get into it. I've been browsing the web for…
czerwin
  • 972
  • 8
  • 10
1
vote
1 answer

Declare values of array of structures in POU using PLC ST

I have structure declared like this: TYPE board: STRUCT number: INT; color: DWORD; END_STRUCT END_TYPE And i want to declare array of these structures with starting values in POU. I do it like this: Program PLC_PRG VAR arr1: ARRAY[1..61]…
koliber
  • 23
  • 4
1
vote
1 answer

Are added parameters in a child class bad form?

I have a list of Ingredients where each Ingredient contains a structure of variables. The structure of variables is common to all Ingredients; however, occasionally an Ingredient will have a unique variable, in which case the variable is not in the…
1
vote
0 answers

Encoder position overflow in codesys

We are using LMC078 motion controller from Schneider electric in our project to control 12 motors simultaneously. Softmotion encoder will act as master for all the axis. We are using soMachine software which uses codesys for programming the…
jerryvdk
  • 11
  • 4