Archive
CODESYS Forge
talk
(Thread)
Archive
Last updated: 2026-03-10
Dynamically Update JSON Payload
CODESYS Forge
talk
(Thread)
Dynamically Update JSON Payload
Last updated: 2026-03-10
Post by fredashbolt on Dynamically Update JSON Payload
CODESYS Forge
talk
(Post)
I am trying to generate a JSON payload populated with a value that updates for use with a telemetry system, the payload is to be published by MQTT. I have established the MQTT client and can publish a working JSON payload but I can't get the payload to update as the value (iValue) changes. I am using a timer to trigger the .SetValue function periodically, but the JSON will only give the value as it is when it is first initialized using xFirst IF statement. Any suggestions? Thanks VAR pJsonData : POINTER TO JSON.JSONData := factory.Create(); fb_JBuilder : JSON.JSONBuilder; diRootIndex, diObject1Index : DINT; iValue : INT := 10 ; jsonArrayWriter : JSON.JSONByteArrayWriter; wsJsonData : WSTRING(1000); xFirst : BOOL := TRUE; utf8JsonData : STRING(2000); diTempVal : DINT ; PublishTimer : TON ; END_VAR IF xFirst = TRUE THEN fb_JBuilder ( pJsonData := pJsonData , diRootObj => diRootIndex ) ; diObject1Index := fb_Jbuilder.SetKeyWithObject ( "Device" , diParentIndex := diRootIndex ) ; diTempVal := fb_Jbuilder.SetKeyWithValue ( "Temp" , iValue , diParentIndex := diObject1Index ) ; xFirst := FALSE ; END_IF PublishTimer ( IN := PublishTimer.Q = 0 , PT := T#5S ) ; IF PublishTimer.Q THEN fb_JBuilder.SetValue ( iValue , diTempVal ) ; END_IF jsonArrayWriter( xExecute := PublishTimer.Q , pwData := ADR(wsJsonData), udiSize := SIZEOF(wsJsonData), jsonData := pJsonData^, xAsyncMode := FALSE ) ; JSON.Stu.ConvertUTF16toUTF8( ADR ( wsJsonData ) , ADR ( utf8JsonData ) , SIZEOF ( utf8JsonData ) , bStrictConversion := TRUE ) ;
Last updated: 2026-03-10
Post by infinitetool on No connection could be made because the target machine actively refused it
CODESYS Forge
talk
(Post)
Hi! I'm having trouble connecting to a device in Deploy Control SL. I'm able to see the device is available during a scan, and I can ping the device as well, but when I try to connect I get the message "No connection could be made because the target machine actively refused it". I've worked on this for hours including turning off the firewall on the device PC but nothing seems to work. The device is running a fresh install of Windows 11 IoT Enterprise 2024 and the Development System is 3.5.21.50 running on Windows 11. Thank you in advance for any ideas!
Last updated: 2026-03-10
Post by eschwellinger on No connection could be made because the target machine actively refused it
CODESYS Forge
talk
(Post)
if you try to login by a ssh client, does this work?
Last updated: 2026-03-10
JOG continues in WCS ( SMC_GroupJog2 )
CODESYS Forge
talk
(Thread)
JOG continues in WCS ( SMC_GroupJog2 )
Last updated: 2026-03-11
Post by mascara on JOG continues in WCS ( SMC_GroupJog2 )
CODESYS Forge
talk
(Post)
I'm using the SMC_GroupJog2 block from the SM3_Robotics library for manual movement of an AxisGroup in WCS coordinates. The observed behavior is: When pressing X+, the X-axis starts moving correctly. If I press Y+ during the movement, the block interrupts the current movement and starts a new movement in X and Y. If I release any button, all axes stop, even if another button is still pressed. Example: Pressing X+ β X moves Pressing X+ and Y+ β X stops momentarily and starts XY movement Releasing X+ while holding Y+ β all axes stop The expected behavior would be: to allow simultaneous continuous movement on multiple axes to not interrupt movement when another axis is added or removed. Is there a correct configuration of SMC_GroupJog2 to achieve this behavior, or is there another block more suitable for continuous manual jog in AxisGroup (WCS)?
Last updated: 2026-03-11
Post by mascara on CloseTargetVisu
CODESYS Forge
talk
(Post)
I need to add a button to the Visualization to close it. And create a shortcut on the Windows desktop to reopen the Visualization. This is necessary to configure, for example, a local IP address. Is this possible? What command closes the Visualization? Which program opens Visualization? System: Win10 Codesys: Control RTE V3 x64 Program: Codesys V3.5 SP20 Using only a touchscreen monitor, without keyboard and mouse.
Last updated: 2026-03-11
What is the CFC editor (page oriented) "Add page" keyboard shortcut?
CODESYS Forge
talk
(Thread)
What is the CFC editor (page oriented) "Add page" keyboard shortcut?
Last updated: 2026-03-11
Post by mtorell on Safe Editor in codesys v3.5sp21p30
CODESYS Forge
talk
(Post)
How do I negate an output signal from an OR gate. I have tried right click to no avail and I cannot find an propriate NEGATE box? I want to save the output from the block to an inverted variable.
Last updated: 2026-03-12
Safe Editor in codesys v3.5sp21p30
CODESYS Forge
talk
(Thread)
Safe Editor in codesys v3.5sp21p30
Last updated: 2026-03-12
Post by osande on Trend/trace data
CODESYS Forge
talk
(Post)
Anyone have problems with trend in lastest release - SP21 Patch5? Does not record data, stores only zeros to the sqlite database and flatliners at zero in trend/trace views. Worked in P4.
Last updated: 2026-03-12
Post by mjam04 on AM243 LaunchPad as PROFINET Device with CODESYS β RPC Aborted error when scanning devices
CODESYS Forge
talk
(Post)
Hello, I am currently trying to use the AM243 LaunchPad as a PROFINET device and connect to it using CODESYS. In my setup I am also using a Raspberry Pi running the CODESYS PROFINET Runtime, which acts as the PROFINET controller. The setup of the Profinet controller is correct, so all devices are in the same subnet. However, I encounter an issue when scanning for PROFINET devices in CODESYS. The AM243 LaunchPad appears in the scan results, but the following error is reported: RPC Aborted: 0x16C9A049 Additionally, CODESYS shows the message that the identification data is not available and the IP address should be checked. Because of this error, the controller cannot establish a connection to the device. Another observation is that I cannot ping the AM243 LaunchPad from my PC, even though I configured what should be the correct IP address. Setup: PROFINET Device: AM243 LaunchPad PROFINET Stack: Industrial Communication SDK example PROFINET Controller: Raspberry Pi running CODESYS with PROFINET Runtime Engineering PC: CODESYS IDE Network: Ethernet connection between PC, Raspberry Pi, and AM243 In the attachments there is a screenshot of the corresponding error. Did anybody had the same error? Any hints or debugging suggestions would be greatly appreciated. Thank you!
Last updated: 2026-03-13
Post by osande on Trend/trace data
CODESYS Forge
talk
(Post)
Trend ....
Last updated: 2026-03-13
Trend/trace data
CODESYS Forge
talk
(Thread)
Trend/trace data
Last updated: 2026-03-13
Post by osande on Trend/trace data
CODESYS Forge
talk
(Post)
Ok, the problem is that the trend/trace system can't read function block instance data. The variables has to be stored directly under the program calling the FBs. Thus, FB variables to be trended/traced must be connected to variables declared in the program. Seems like a bug to me!
Last updated: 2026-03-13
Post by osande on Trend/trace data
CODESYS Forge
talk
(Post)
The standard Trace works...
Last updated: 2026-03-13
UC20-M4000 Redundancy β Application is not automatically synchronized and redundancy breaks after online change
CODESYS Forge
talk
(Thread)
UC20-M4000 Redundancy β Application is not automatically synchronized and redundancy breaks after online change
Last updated: 2026-03-16
Post by mrkm-dic on UC20-M4000 Redundancy β Application is not automatically synchronized and redundancy breaks after online change
CODESYS Forge
talk
(Post)
Hello, I am currently testing redundancy using two UC20-M4000 controllers with CODESYS Control SL. The basic redundancy functionality (Active/Passive switching and failover) works, but I am experiencing problems when updating the application. Environment Controller: WeidmΓΌller UC20-M4000 OS: u-OS Runtime: CODESYS Control SL 4.12.1.0-1 Redundancy link: dedicated Ethernet connection between the two controllers Time synchronization: NTP configured, time difference between controllers is about 1β2 seconds Current behavior Application synchronization When I download a modified application to PLC1 (Active controller), the application is not automatically copied to PLC2 (Passive controller). However, when I perform a path swap, the application download to PLC2 starts automatically. My expectation was that the Passive controller would automatically receive the updated application after downloading to the Active controller. Online change When performing an online change, redundancy is lost and the controllers switch to Standalone mode. Typical log messages include: RedundancySynchronize called Redundancy failover itself works correctly. The application boot project exists on both controllers (Application.app and Application.crc). Network interfaces are up and correctly configured. Question Is this behavior expected when updating the application in a redundant UC20-M4000 setup? Should the Passive PLC automatically receive the updated application, or is manual synchronization required? Any advice or recommended configuration for stable redundancy during online change and application download would be greatly appreciated. Thank you.
Last updated: 2026-03-16
Post by bdschnapp on OPC-UA ApplicationUri / ProductUri
CODESYS Forge
talk
(Post)
Were you able to figure out if it is possible to change the Application/Product URI of your server? I am having the same problem.
Last updated: 2026-03-16
Post by bdschnapp on OPC-UA ApplicationUri / ProductUri
CODESYS Forge
talk
(Post)
From Codesys support: The format of the URN is always the same. It's always urn:<vendor>:<product>:OPCUA:Server. What I think you can influence the vendor and product (DeviceName) through settings in the runtime cfg file:</product></vendor> [SysTarget] VendorNameUnicode="T\00E\00S\00T\00" DeviceNameUnicode="t\00e\00s\00t\00" Note that these are 16-bit strings, thus the ASCII padded with nulls
Last updated: 2026-03-17
OPC-UA ApplicationUri / ProductUri
CODESYS Forge
talk
(Thread)
OPC-UA ApplicationUri / ProductUri
Last updated: 2026-03-17
Transparent wireless serial bridge for Modbus RTU β experience with LoRa/WiFi RS-485 link to CODESYS runtime
CODESYS Forge
talk
(Thread)
Transparent wireless serial bridge for Modbus RTU β experience with LoRa/WiFi RS-485 link to CODESYS runtime
Last updated: 2026-03-18
Post by dafalin-codesys on Transparent wireless serial bridge for Modbus RTU β experience with LoRa/WiFi RS-485 link to CODESYS runtime
CODESYS Forge
talk
(Post)
Last updated: 2026-03-18
EThercat Dynamic configuration
CODESYS Forge
talk
(Thread)
EThercat Dynamic configuration
Last updated: 2026-03-18
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.