Questions tagged [codesys]

Codesys is a development environment for programming controller applications in accordance with the international industrial standard IEC 61131-3. The term Codesys is an acronym and stands for Controller Development System

Codesys is a development environment for programming controller applications according to the international industrial standard IEC 61131-3. The term Codesys is an acronym and stands for Controller Development System.

The IEC 61131-3 specification and the Codesys environment are popular in both industrial and mobile control systems. This includes, but is not limited to, supply chain/manufacturing, pipelines, oil/gas machinery, mining equipment, construction equipment, and similar.

The IEC 61131-3 standard specifies 5 types of programming languages, all of which, are supported by Codesys:

  • IL (Instruction list) is an assembler-like programming language
  • ST (Structured text) is similar to programming in Pascal or C
  • LD (Ladder diagram) enables the programmer to virtually combine relay contacts and coils
  • FBD (Function block diagram) enables the user to rapidly program both Boolean and analogue expressions
  • SFC (Sequential function chart) is convenient for programming sequential processes and flows

Additionally, Codesys offers an additional programming language:

  • CFC (Continuous Function Chart) is a sort of freehand FBD editor. Other than in the network-oriented FBD editor where the connections between inputs, operators and outputs are set automatically they have to be drawn by the programmer. All boxes can be placed freely which makes it possible to program feedback loops without interim variables.
145 questions
4
votes
5 answers

PLC Structured text, convert decimal to real(float). Not getting the value I expect. (IEEE-754)

I have a hardware that is communicating with the PLC over Profibus DP, that sends me 4 bytes of data in hex that is "44 79 FF FF" and in the PLC program I have declared a BYTE array for this input data. The problem is in the PLC the data I receive…
hijack
  • 253
  • 2
  • 3
  • 11
3
votes
3 answers

Creat an array in CoDeSys with changeable size

I am working on a moving average algorithm to analyze a sensor values and the values are stored in an Array. BUT, the length of Array is variabla (depends on speed of one motor). how can I Creat an array in CoDeSys with changeable size. It's wrong…
user2791484
  • 51
  • 1
  • 2
  • 4
3
votes
2 answers

Defining Arrays in Codesys

I'm using Codesys to create an array. The example below is what I'm using to create an array for 5 values ARRAY [1..5] OF INT := [1,2,3,4,5]; That's fine for an array of 5 but if I needed an array for 100 values? Is there a quicker way of doing an…
darnbar
  • 33
  • 1
  • 1
  • 5
3
votes
5 answers

Pausing Timers In Structured Text

I need to be able to pause a timer and retain it's ET value when the timer is no longer being asked to run. The timer times when the input from a proximity switch is not present, but I only want it to time when the pump that forwards on the material…
SilverShotBee
  • 1,480
  • 3
  • 23
  • 46
3
votes
2 answers

Communicate with CoDeSys program on a Linux-based WAGO PFC200 PLC

I'm currently getting familiar with PLC's, the WAGO 750-8206 PLC in particular. It offers a linux OS and can run CoDeSys programs. There are some I/O modules attached to the controller: 750-530, 750-430 and 750-600. What I would like to know is…
Rob
  • 10,600
  • 13
  • 51
  • 86
2
votes
1 answer

Pointers and online change in TwinCAT and CoDeSys

Are pointers safe against online change of running PLC program in TwinCAT 2.10 and in CoDeSys 2.3 on which the first one is based? What happens if memory block gets reallocated as part of online program change and there are pointers pointing to that…
Taras Boyko
  • 81
  • 1
  • 9
2
votes
1 answer

TwinCat How To Initialize Functionblock with Reference to Global Variable

Hello StackOverflow Community, i have another question regarding the TwinCat/Beckhoff/Codesys Programming Language, maybe someone is able to help me with this problem. Here is the Problem: I want to initalize a functionblock with a reference to some…
manuel2705
  • 35
  • 3
2
votes
1 answer

Trying to get Codesys to run a batch file from the HMI

So currently, I am trying to pick up this code that an intern left off for this project. I have a batch file that is run when clicked, and will execute a powershell script that will convert a generated CSV file from collected data to an Excel file.…
2
votes
2 answers

Instantiating of numerous function block in CODESYS (IEC61131)

I have made a function block using CODESYS to perform energy metering. The inputs of the function block is current and voltage and the output is energy. Now, we need to have 1000 instances of this function block to run the code for 1000 meter we…
aghd
  • 535
  • 1
  • 7
  • 17
2
votes
0 answers

Read/Write in Array of Structure stock in a persistant variable

I'm working on codesys (ST) to create a storekeeper programm. I have a persistant variable which is a strucure name ST_STORAGE, here it definition : TYPE ST_STORAGE : STRUCT xInitialized :BOOL; // Indicate if the storage have been already…
2
votes
1 answer

SyncStart with Codisys without PLCOPEN Part 4

I need to Approximate A SyncStart/SyncStop Function in Codesys using PLCOPEN. I don't have access to Part 4 that contains the Synchronized motion stuff. Any ideas on how to start down the right path this in ST would be Awesome.
2
votes
2 answers

Defining extern "C" function in C#

I have an ActiveX control written in C# and working when run in an ActiveX compatible program (CoDeSys). The problem I've come across is that in order to allow CoDeSys to interact with the ActiveX control, CoDeSys requires the dll to export the…
blastthisinferno
  • 529
  • 1
  • 6
  • 18
2
votes
1 answer

How to assign icon/pic to custom function block in Codesys?

I am creating Codesys library for public with common FBs. I wonder is there a way to add icon to the function block just like timer blocks have? Logically if there is icon on those blocks there should be a way to add icon to other blocks.
Sergey Romanov
  • 2,580
  • 2
  • 21
  • 37
2
votes
1 answer

Displaying Date and Time in Codesys

I am trying to display system time in Codesys Visualization. I am using "#dt" to get the time and displaying it in Text field using %t[ddd MMM dd.MM.yyyy HH:mm:ss] place holder. I want to get display the local time. But I am getting in 'UTC' time…
ajith
  • 553
  • 6
  • 13
2
votes
3 answers

How to place an instance of a custom Function Block in CoDeSys?

I'm learning CoDeSys (using V3.5 SP2) and I'm stuck with a rather beginner-level problem that I can't seem to find any resources for. I have defined a simple Function Block (by going to Add Object -> POU -> Function Block and using the FBD…
Theodoros Chatzigiannakis
  • 26,988
  • 8
  • 61
  • 97
1
2 3
9 10