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
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
3 answers

variable mapping using Beckhoff device

i'm new to PLC programming and i have a problem with connection to the beckhoff device. I used a EL1008 device which has 8 Inputs. On the beckhoff website i found this table below. I'm confused when assigning variable to the inputs, which variable…
newww0
  • 181
  • 3
  • 12
2
votes
1 answer

CodeSys 2.3 State Machine

What is the best way to make efficient and flexible state state machine(SM) in IEC61131-3 / CodeSyS v2.3? Are there any good examples of SM realizations on CodeSys V2.3? As far as I understand, there are 3 different types of SM: 1.Case logic SM -…
Andrew
  • 29
  • 1
  • 1
  • 4
2
votes
2 answers

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 K
  • 593
  • 6
  • 13
2
votes
1 answer

Parsing CoDeSys .pro file

I'm trying to parse a .pro file, but I get strange chars within the file. public List GetTextBlocks(int minBlockSize = 10) { if (_TextBlocks != null && _TextBlocksMinBlockSize == minBlockSize) return…
Jens
  • 505
  • 5
  • 17
1
vote
2 answers

Bit Array in Codesys

I can assign different values to a bit variable with the array of bit structure in C. On the Codesys side, I am not allowed to define an array of bits in the structures. Is there a solution you can suggest to solve this problem? Best regards in…
Ars
  • 11
  • 2
1
vote
1 answer

In IEC61131-3, what are the semantics of the assignment operator for variables of Function Block type?

In IEC 61131-3 implementations (e.g. CoDeSys, TwinCAT, Unity), what actually happens when you use the assignment operator on variables of Function Block type? I've looked at the TwinCAT and CoDeSys docs without finding any kind of clear description;…
Hydrargyrum
  • 3,378
  • 4
  • 27
  • 41
1
vote
1 answer

Why can Codesys start array from nonzero value?

In some project I get to work with for an IFM PLC I encountered this code: someArray:ARRAY [6..8] OF BYTE; When I inspect the array on breakpoint I see that it has three elements: someArray[6] = 0 someArray[7] = 0 someArray[8] = 0 I can't for the…
Malinko
  • 124
  • 11
1
vote
0 answers

Mapping a device input or output to an instance of a function block through a config file

I'm trying to find a way to map the device inputs and outputs directly to a variable in an instance of a function block. I know I could solve this with full path mapping through the IDE I/O config, but I want to modify the mapping without using the…
SturmGhost
  • 111
  • 1
  • 11
1
vote
2 answers

Combining four 16 bit UINT to one 64 bit UINT in Codesys

I'm trying to combine four 16 bit UINT to a single 64 bit UINT in codesys. I am able to do this in C but I haven't been able to figure out the syntax in Codesys. I have four elements of an array that are 16 bit UINT values. If anyone knows a way to…
Andrew180
  • 13
  • 2
1
vote
1 answer

check if a specific hardware input is linked to a plc variable in Twincat 3.1

i am trying to check if a specific input from a hardware device is linked to my plc application on Twincat 3.1, in my example below i would like to check if "Terminal Overtemperature" is linked to a variable in the plc application side at runtime. I…
DonMiguelSanchez
  • 376
  • 3
  • 15
1
vote
1 answer

Codesys v.3.5 sp18 p3 - visualistation toolbox is empty

I am starting a PLC course on my uni, The Proffesor has recorded a tutorial on how to download and start CodeSyS, so I am completly yellow about it all. I have followed the instructions carefully but for some reason visualistian toolbox is empty. I…
1
vote
1 answer

How to pass an array of struct as an argument of a function block in codesys

How can you pass an array of structure as an argument to a function block? Initializing the array dirrectly as an argument didn't work: myFunctionBlock(inArrayOfStruct := [(Param1 := TRUE), (Param1 := FALSE)])
1 2
3
15 16