Post by helcioburd on How long can a WSTRING be in CodeSys V3?
CODESYS Forge
talk
(Post)
Thank you, very useful information. I did a library for serial communication and could not understand the reason only 256 chars could be read (after sending more than 256). Following your suggestion, I can now send any number of chars and everything will be received.
Last updated: 2025-03-02
Post by cellohorst on File Creation Issue
CODESYS Forge
talk
(Post)
Nope! The file path is $$PlcLogic$$ and NOT $$PLCLogic$$. Otherwise a new folder ('PLCLogic') is created (at least with a linux rt - like raspberry or compute module) with the new file in it if you open the file with eFileMode := FILE.MODE.MRDWR. That is a bad bug that I'll report right after this comment.
Last updated: 2025-03-03
Post by domebruce on Which database to use?
CODESYS Forge
talk
(Post)
We have developed a similar application few years ago with .Net and MS Sql Server. The database has about 30 tables, the more bigger tables have 2 or 3 thousands records. We can have multiple threads accessing at the same time to the DB. To garantie the data integrity we need to manage data locks and transactions. Thanks
Last updated: 2025-03-04
Post by lockupversus on High resolution displays with 150% scaling causes CodeSys IDE to be blurry
CODESYS Forge
talk
(Post)
What version of Windows are you using? If you are using older Windows, just upgrade to the latest version and use CodeSys IDE as usual. Nothing will happen. Some more complex options below. https://forge.codesys.com/prj/codesys-example/element-collect/home/Home/ https://store.codesys.com/en/mysql-library-sl.html Doodle Baseball
Last updated: 2025-03-05
Post by suyash on Version Control
CODESYS Forge
talk
(Post)
Hello, I face issues opening old Codesys 3 program when I am having a newer version installed. Unfortunately since I was forced to format my laptop after an unexpected crash. I lost all the setup files of the older versions. Is there ant where I can download it from? BR, Suyash
Last updated: 2025-03-07
Post by timvh on Assignment Efficiency - Repetitive Assignment vs IF statement
CODESYS Forge
talk
(Post)
You can consider using OR_ELSE: Coils[0] := Coils[0] OR_ELSE (Buttons[0] AND Sensors[0] > 6); https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_operator_or_else.html IF Coils[0] is TRUE, then the rest is not relevant anymore and doesn't have to be evaluated anymore. PS, there is also an AND_THEN https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_operator_and_then.html
Last updated: 2025-03-08
Post by wayne-riesterer on Assignment Efficiency - Repetitive Assignment vs IF statement
CODESYS Forge
talk
(Post)
Thanks for your responses. I like to write the leanest possible code that I can because it makes it much easier to read/maintain/debug. OR_ELSE is what I was looking for. I wasn't sure if CodeSys short-circuited evaluation and I didn't realize this operator existed. Thanks!
Last updated: 2025-03-08
Post by juki01 on HMI über Webbrowser
CODESYS Forge
talk
(Post)
Auf meiner Kendrion SPS läuft eine WebVisu. Über einem touchpanel-IPC mit Win10 greife ich über den Webbrowser auf die SPS zu alles o.k. Nun möchte ich den IPC mit einem Visu-Element runterfahren da der Webbrowser im Kiosk-Mode läuft. Das gelingt mir irgendwie nicht. Kann mir da bitte jemand helfen ? Gruß juki
Last updated: 2025-03-11
Post by peterkcontrols on Making a Visu Element normally invisible and visible if variable is true
CODESYS Forge
talk
(Post)
Hello I would like an element in my visu to be only visible when a certain Variable is true, currently it is only capable of being normally visible and then invisible if a certain variable is true. Is this possible without programming a new variable to be the opposite of my desired control variable? Thanks.
Last updated: 2025-03-12
Post by fmon on Modbus : dis- / re-connect cable: modbus does not re-start
CODESYS Forge
talk
(Post)
Hello, I am using codesys Modbus TCP client (4.4.0.0) to communicate with a python modbus server (package pyModbusTCP). I first start my python server on the distant machine. After a fresh codesys compilation, a plc connection/transfer and a PLC run, the modbus connection is OK. Every time in this context the connection is created correctly. When I shut down the server, the modbus connection falls, that is normal. When I restart the python server, impossible to recreate the modbus connexion. With the client autoreconnection, I see on my server that the client tries to connect but unsuccesfully. I have the following message : DEBUG:pyModbusTCP.server:accept new connection from ClientInfo(address='192.168.1.20', port=33476) DEBUG:pyModbusTCP.server:Exception during request handling: NetworkError('recv return null') I tried to stop the codesys client and to restart it with these commands : Modbus_TCP_Client.xStop := True; // Or False Modbus_TCP_Client.Enable := True; // Or False Modbus_TCP_Server.Enable := True; // Or False I tried to confirm the error manually to force reconnection with: Modbus_TCP_Server_Motors.xConfirmError := TRUE; I tried also this command to STOP/RESET/START client and server (codesys side) but nothing happens : status_client := Modbus_TCP_Client.SetCommunicationState(eRequestedState := DED.DEVICE_TRANSITION_STATE.STOP); // .RESET & .START The answer of this function when executed is "status_client = NOT_SUPPORTED" It seems that is a socket problem, but I do not understand if it is on the client or server side. I tried a modbus simulator called "ananas.exe" and the result is the same. Impossible to get a modbus reconnection. What is different at the first connection and at a reconnection attempt ? Thanks for your help
Last updated: 2025-03-14
Post by hassaank on CODESYS V3+ WAGO PFC200+ MODBUS RTU
CODESYS Forge
talk
(Post)
Hi everyone, I’m new to CODESYS and Wago devices, and I’m trying to set up Modbus RTU communication. I have a Wago PFC200 (8110) and a 750-653 RS485 module, and I want to read data from an energy meter using Modbus RTU. Thanks in advance for your help!
Last updated: 2025-03-17
Post by fmon on Modbus TCP client reconnection problem
CODESYS Forge
talk
(Post)
Hello, I am using codesys Modbus TCP client (4.4.0.0) to communicate with a python modbus server (package pyModbusTCP). I first start my python server on the distant machine. After a fresh codesys compilation, a plc connection/transfer and a PLC run, the modbus connection is OK. Every time in this context the connection is created correctly. When I shut down the server, the modbus connection falls, that is normal. When I restart the python server, impossible to recreate the modbus connexion. With the client autoreconnection, I see on my server that the client tries to connect but unsuccesfully. I have the following message : DEBUG:pyModbusTCP.server:accept new connection from ClientInfo(address='192.168.1.20', port=33476) DEBUG:pyModbusTCP.server:Exception during request handling: NetworkError('recv return null') I tried to stop the codesys client and to restart it with these commands : Modbus_TCP_Client.xStop := True; // Or False Modbus_TCP_Client.Enable := True; // Or False Modbus_TCP_Server.Enable := True; // Or False I tried to confirm the error manually to force reconnection with: Modbus_TCP_Server_Motors.xConfirmError := TRUE; I tried also this command to STOP/RESET/START client and server (codesys side) but nothing happens : status_client := Modbus_TCP_Client.SetCommunicationState(eRequestedState := DED.DEVICE_TRANSITION_STATE.STOP); // .RESET & .START The answer of this function when executed is "status_client = NOT_SUPPORTED". Is it normal ? It seems that is a socket problem, but I do not understand if it is on the client or server side. I tried a modbus simulator called "ananas.exe" and the result is the same. Impossible to get a modbus client reconnection. What is different at the first client connection and at a reconnection attempt ? Thanks for your help
Last updated: 2025-03-17
Post by peterkcontrols on Codesys Network driver install for Codesys Control RTE x64
CODESYS Forge
talk
(Post)
I am using Codesys Control RTE V3 Version 3.5.21.0 I am not sure what you are asking. Which hardware ID has the network interface card? I have ran ipconfig /all and attached an image. Let me know what other information I can provide to you to help troubleshoot this problem. Thank
Last updated: 2025-03-18
Post by eschwellinger on Codesys Network driver install for Codesys Control RTE x64
CODESYS Forge
talk
(Post)
Yes, either adding in the CODESYSContro_User.cfg because the driver will no longer appear in the list or type the name from the documentation in the configuration and when the gray check mark appears, the driver is also installed. It is just not selectable anymore.
Last updated: 2025-03-21
Post by davidmic on Struct Literal
CODESYS Forge
talk
(Post)
Hi all I want to pass a struct into a function without declaring the struct in a VAR/END_VAR. Is this possible? I think this would be called a struct literal It would look something like this someFB.write(structArgument := MyStruct#(a := 1, b := 1.2), otherArgument := TRUE); With this struct declaration TYPE MyStruct : STRUCT a : INT; b : REAL; END_STRUCT END_TYPE
Last updated: 2025-03-28
Post by chocojun on CODESYS WebSocket Client (IIOT Library)
CODESYS Forge
talk
(Post)
Has anyone used a library related to websocket client? I will be in charge of websocket client in CODESYS, and websocket server in python. In CODESYS, I will use WebSocketClient(FB) WebSocketRead(FB) WebSocketWrite(FB) to configure the client, Does anyone know an example of how to use it? Please help me.
Last updated: 2025-03-31
Post by chocojun on CODESYS WebSocket Client (IIOT Library)
CODESYS Forge
talk
(Post)
Has anyone used a library related to websocket client? I will be in charge of websocket client in CODESYS, and websocket server in python. In CODESYS, I will use WebSocketClient(FB) WebSocketRead(FB) WebSocketWrite(FB) to configure the client, Does anyone know an example of how to use it? Please help me.
Last updated: 2025-03-31
Post by madskaizer on Exception when OPCUA datasource disconnects from Server
CODESYS Forge
talk
(Post)
We have similar issues, with crashing PLCs, but this ranges from 3.5.16.40 to 3.5.19.70. Which log made you confirm the exception crash? I am currently looking for evidence of what causes our PLCs to crash. Network stability could be an issue with latest security roll-outs like 802.1X and segregation.
Last updated: 2025-03-31
Post by eaglealex on Length of string and Array of bytes
CODESYS Forge
talk
(Post)
Thank you for your answer! I know that 0 will be the end of the string. I checked it. There is no 0 in array of bytes. I made screenshots. There is array of bytes, aborted string and the result of my test via online converter.
Last updated: 2025-04-02
Post by benemenn on Type mappings in Datasource
CODESYS Forge
talk
(Post)
Hi! I am trying to achieve the same issue. Has there been a solution? I can create the mapping, and map the local variable, but somehow the object does not update. Furthermore, i have an issue where codesys doesn't let me set ReadWrite accesses to the variables in the "Type Mapping" place. The access will simply not be set. Has anyone ran int that issue?
Last updated: 2025-04-02
Post by jampid on What is the CFC editor (page oriented) "Add page" keyboard shortcut?
CODESYS Forge
talk
(Post)
Bonjour, Dans la boite à outils du CFC Page en haut à droite, il y a l'icône de Page. Il suffit de glisser déposer cet objet sous ou au-dessus du numéro 1 de la 1ère page, etc. Bon développement! JM
Last updated: 2025-04-03
Post by jampid on url String notation
CODESYS Forge
talk
(Post)
Bonjour damian177, Je pense que le problème vient du caractère dollar qu'il faudra doubler. La déclaration sans erreur est celle-ci : sURL:WSTRING(1024) := "https://mydomain.pl/api/rce-lte?$$filter=doba eq 2025-03-18"; De plus il faut bien note la chaîne entre guillemet car au dela de 255 caractères , il s'agit de WString au lieu de String. Bon développment! JM
Last updated: 2025-04-04
Post by jampid on What is the CFC editor (page oriented) "Add page" keyboard shortcut?
CODESYS Forge
talk
(Post)
ULVIS, tu peux copier la 1ère page par exemple ou une autre CTRL+C et la recopier autant de foix que tu souhaites: CTRL+V Voici le lien pour accédre aux raccourcis du langage CFC Pages https://content.helpme-codesys.com/en/CODESYS%20CFC/_cds_edt_cfc_shortcuts.html J'espère que cela t'aidera. JM
Last updated: 2025-04-04
Post by gseidel on Dynamic limits invaild
CODESYS Forge
talk
(Post)
Hi jbu0105, which error doe you get, exactly? Is it error 11008, SMC_MOVE_INVALID_DYNAMICS? (It might help if you check the "Log" tab in the PLC device and copy the exact error.) Please double-check whether the inputs Velocity, Acceleration, Deceleration, and Jerk of MC_MoveCircularAbsolute have correct (positive) values. Best regards, Georg
Last updated: 2025-04-07
Post by jampid on PersistentVars and Webvisu Element
CODESYS Forge
talk
(Post)
Bonjour, est-ce que les espaces de noms des variables sont bien indiqu dans les commutateurs ? Je viens de faire un petit essai: OK {attribute 'qualified_only'} VAR_GLOBAL PERSISTENT RETAIN xBit1: BOOL:=1; xbit2: BOOL:=1; END_VAR Déclaration de variable dans le commutateur (et aussi dans un voyant pour le test) :PersistentVars.xBit1 Bon développement!
Last updated: 2025-04-07
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND
or OR
.