Search talk: json file reader

 
<< < 1 .. 31 32 33 34 > >> (Page 33 of 34)

Post by dekelec on Codesys 2.3 & Peak PCAN CODESYS Forge talk (Post)
I use Peak USB adapter daily to download from CoDeSys 2.3 and 3.5 to IFM, EPEC and other controllers. The process: - First you need to install the appropriate driver. Link: https://www.peak-system.com/Drivers.523.0.html?&L=1 - Restart the computer - Start the CoDeSys application - Change the name of the adapter in Communication parameters, as mentioned in previous comment. Write the name exactly as written "Peak_USB", as it could also be case sensitive (defines which .dll file to use). If this doesn't work I would contact the vendor of the controller to find out the procedure. In the attachment I've added a FAQ document from IFM regarding using PCAN USB. P.S. I've noticed in your picture of communication parameters a channel via TCP/IP is mentioned. In this case a USB to CAN connection is not being used. First you should change the channel/gateway to connect via CANbus or connect using an Ethernet cable.
Last updated: 2024-07-09

Post by faceplant on CmpDynamicText unresolved references CODESYS Forge talk (Post)
Hello! I am new to codesys so I am sorry if this is not the right place to ask this question. I am using codesys V3.5 SP20 Patch 1 + (64-bit) and a Groov EPIC PLC (GRV-EPIC-PR2). I am trying to build and deploy my application to the PLC, but when I log in I get 6 errors (codesys_error.png). It seems that the errors have to do with the CmpDynamicText system library which I have as version 3.5.20.0. I have tried to add CmpDynamicText to the ComponentManager section in the PLC's CODESYSControl.cfg file as described in this forum post and still hit the same error. I noticed that the library is grayed out in the library manager, which I think might be the issue. However I don't remember if it was grayed out before I encountered this issue. Please let me know if I can provide anymore info. Thank you!!!
Last updated: 2024-07-19

Post by trusty-squire on CNC - How to manipulate SMC_GeoInfo objects CODESYS Forge talk (Post)
I have an application using CNC GCode interpolation, but I need to modify the GCode provided to the PLC based on certain parameters. I am currently attempting to modify the SMC_GeoInfo objects in the SMC_OutQueue using the code below. Note that all the other code is pretty standard and works fine, but when I add the below it errors. PROGRAM TEST VAR fbReadCncFile : SMC_ReadNCFile2; fbCncInterpreter : SMC_NCInterpreter; arrCncInterpreter : ARRAY[1..99] OF SMC_GeoInfo; pGeoInfo: POINTER TO SMC_GeoInfo; giGeoInfo: SMC_GeoInfo; // ... END_VAR // ... Some code here in order to read CNC file using SMC_ReadNCFile2 and provide to SMC_NCInterpreter pGeoInfo := SMC_GetObj(poq:=ADR(fbCncInterpreter.poqDataOut), n:=1); IF pGeoInfo <> 0 THEN giGeoInfo := pGeoInfo^; // Do some manipulation here, then update the queue at the same position MC_SetObj(poq:=ADR(fbCncInterpreter.poqDataOut) , n:=0 , pgi:=ADR(giGeoInfo) ); END_IF It throws an error when I get to the line giGeoInfo := pGeoInfo^; Error: EXCEPTION [AccessViolation] occured: App=[Sim.Device.Application], Task=[PathTask] How do I use SMC_GetObj and access the data? It creates a pointer with the value as shown in the photo, but all the dereferenced values say dereference of invalid pointer.
Last updated: 2024-07-26

Post by jmfernandes on OpenDir always in error CODESYS Forge talk (Post)
Hello I'm trying to use DirOpen to access a directory where then I can read/list the files inside. But I can't list any files because DirOpen.xError is always true. In eError the message is this: " ERROR_UNKNOWN Local library error ID (0: no error; 5101: time out)**** " I have in the file explorer the path 'C:\CodesysTest\Aluminium' and to make sure I also created in the plc a folder to 'prj/Recipes/Aluminium'. I tried using the different paths, but in both it happens the same thing.Inside the folder Aluminium there is two csv files, that I want to list. I added in the library manager CAA Files and CAA Types. I am using the example of https://content.helpme-codesys.com/en/libs/CAA%20File/Current/Examples.html#directory but not matter what I do, I can't get the list the names of the files. What am I missing?
Last updated: 2024-07-31

Post by abauza on Image Pool using in other libraries CODESYS Forge talk (Post)
Hi im Albert, im developing libraries for my PLCs and i have some issues on visualization part. First of all I have done a library that have a image pool with a list of 4 gifs "ImagePoolErrors" (i've tested in other projects and it works) but the problem comes when i create another library that in the visualization part contains images from my image pool library, when i simulate a program that includes a instance of my second library object the visualization images dont show, any of them, i've checked all the references and tried some options of the image properties but without any difference. Here is the screenshots of the first library (that contains Image Pool) and the second library (that includes images of the image pool first library) and the visualization simulation (with the missing image gif issue). Any idea of what i forgotten in the process? If you need any detail of the library or of the project or you need the library file, ask me, thank on advance
Last updated: 2024-08-19

Post by salvadegianluca on List files in a directory with SysDiropen And SysDirRead CODESYS Forge talk (Post)
Good morning; I'm facing an issue that seems being caused by the library itself. I'm trying to create the list of all the files that are stored inside a psecific directory. Unluckily the first file is allways hidden. VAR CONSTANT arysEmptyArray:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING := [(iArrayMAXDimension - iArrayMinDimension)('')]; iArrayMinDimension:INT := 1; iArrayMAXDimension:INT := 99; END_VAR VAR_INPUT sDirectoryToInspect:STRING; sSearchFilter:STRING; END_VAR VAR_IN_OUT xCheckFileInsideDirectory:BOOL; END_VAR VAR arysListOfFoundFiles:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING; sNullString:STRING; iNullIndex:INT := 0; libInfoAboutThePath:DirInfo; libResultOfThePathMonitoring:CmpErrors.RTS_IEC_RESULT; libInstanceToMonitorThePath:CmpErrors.RTS_IEC_HANDLE; sEntityToSearch:STRING; dMaxEntityDimension:DINT := SIZEOF(sEntityToSearch); libFileInfo:DirInfo; sFilteredFileName:STRING; iIndexToScrollArrays:INT; END_VAR IF xCheckFileInsideDirectory THEN arysListOfFoundFiles:=arysEmptyArray; iIndexToScrollArrays:=iArrayMinDimension; libInstanceToMonitorThePath:= SysDirOpen(szDir:= sDirectoryToInspect,szDirEntry:=sNullString,diMaxDirEntry:= iNullIndex,pDirInfo:= ADR(libInfoAboutThePath),pResult:= ADR(libResultOfThePathMonitoring)); WHILE libResultOfThePathMonitoring = Errors.ERR_OK AND iIndexToScrollArrays <= iArrayMAXDimension DO sEntityToSearch:= ''; libResultOfThePathMonitoring:=SysDirRead(hDir:=libInstanceToMonitorThePath,szDirEntry:=sEntityToSearch,diMaxDirEntry:=dMaxEntityDimension,pDirInfo:=ADR(libFileInfo)); sFilteredFileName:= FUN_06_00_FindItemInString_0(sFilter:=sSearchFilter,sSource:=sEntityToSearch); IF sFilteredFileName <> '' THEN arysListOfFoundFiles[iIndexToScrollArrays]:=sFilteredFileName; iIndexToScrollArrays:=iIndexToScrollArrays + 1; END_IF IF libResultOfThePathMonitoring <> Errors.ERR_OK THEN libResultOfThePathMonitoring:= Errors.ERR_OK; END_IF END_WHILE libResultOfThePathMonitoring:=SysDirClose(hDir:= libInstanceToMonitorThePath); xCheckFileInsideDirectory:=FALSE; END_IF How is possible to solve this issue? Any known work around?
Last updated: 2024-09-17

Post by salvadegianluca on List files in a directory with SysDiropen And SysDirRead CODESYS Forge talk (Post)
Good morning; I'm facing an issue that seems being caused by the library itself. I'm trying to create the list of all the files that are stored inside a psecific directory. Unluckily the first file is allways hidden. VAR CONSTANT arysEmptyArray:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING := [(iArrayMAXDimension - iArrayMinDimension)('')]; iArrayMinDimension:INT := 1; iArrayMAXDimension:INT := 99; END_VAR VAR_INPUT sDirectoryToInspect:STRING; sSearchFilter:STRING; END_VAR VAR_IN_OUT xCheckFileInsideDirectory:BOOL; END_VAR VAR arysListOfFoundFiles:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING; sNullString:STRING; iNullIndex:INT := 0; libInfoAboutThePath:DirInfo; libResultOfThePathMonitoring:CmpErrors.RTS_IEC_RESULT; libInstanceToMonitorThePath:CmpErrors.RTS_IEC_HANDLE; sEntityToSearch:STRING; dMaxEntityDimension:DINT := SIZEOF(sEntityToSearch); libFileInfo:DirInfo; sFilteredFileName:STRING; iIndexToScrollArrays:INT; END_VAR IF xCheckFileInsideDirectory THEN arysListOfFoundFiles:=arysEmptyArray; iIndexToScrollArrays:=iArrayMinDimension; libInstanceToMonitorThePath:= SysDirOpen(szDir:= sDirectoryToInspect,szDirEntry:=sNullString,diMaxDirEntry:= iNullIndex,pDirInfo:= ADR(libInfoAboutThePath),pResult:= ADR(libResultOfThePathMonitoring)); WHILE libResultOfThePathMonitoring = Errors.ERR_OK AND iIndexToScrollArrays <= iArrayMAXDimension DO sEntityToSearch:= ''; libResultOfThePathMonitoring:=SysDirRead(hDir:=libInstanceToMonitorThePath,szDirEntry:=sEntityToSearch,diMaxDirEntry:=dMaxEntityDimension,pDirInfo:=ADR(libFileInfo)); sFilteredFileName:= FUN_06_00_FindItemInString_0(sFilter:=sSearchFilter,sSource:=sEntityToSearch); IF sFilteredFileName <> '' THEN arysListOfFoundFiles[iIndexToScrollArrays]:=sFilteredFileName; iIndexToScrollArrays:=iIndexToScrollArrays + 1; END_IF IF libResultOfThePathMonitoring <> Errors.ERR_OK THEN libResultOfThePathMonitoring:= Errors.ERR_OK; END_IF END_WHILE libResultOfThePathMonitoring:=SysDirClose(hDir:= libInstanceToMonitorThePath); xCheckFileInsideDirectory:=FALSE; END_IF How is possible to solve this issue? Any known work around?
Last updated: 2024-09-17

Post by salvadegianluca on List files in a directory with SysDiropen And SysDirRead CODESYS Forge talk (Post)
Good morning; I'm facing an issue that seems being caused by the library itself. I'm trying to create the list of all the files that are stored inside a psecific directory. Unluckily the first file is allways hidden. VAR CONSTANT arysEmptyArray:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING := [(iArrayMAXDimension - iArrayMinDimension)('')]; iArrayMinDimension:INT := 1; iArrayMAXDimension:INT := 99; END_VAR VAR_INPUT sDirectoryToInspect:STRING; sSearchFilter:STRING; END_VAR VAR_IN_OUT xCheckFileInsideDirectory:BOOL; END_VAR VAR arysListOfFoundFiles:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING; sNullString:STRING; iNullIndex:INT := 0; libInfoAboutThePath:DirInfo; libResultOfThePathMonitoring:CmpErrors.RTS_IEC_RESULT; libInstanceToMonitorThePath:CmpErrors.RTS_IEC_HANDLE; sEntityToSearch:STRING; dMaxEntityDimension:DINT := SIZEOF(sEntityToSearch); libFileInfo:DirInfo; sFilteredFileName:STRING; iIndexToScrollArrays:INT; END_VAR IF xCheckFileInsideDirectory THEN arysListOfFoundFiles:=arysEmptyArray; iIndexToScrollArrays:=iArrayMinDimension; libInstanceToMonitorThePath:= SysDirOpen(szDir:= sDirectoryToInspect,szDirEntry:=sNullString,diMaxDirEntry:= iNullIndex,pDirInfo:= ADR(libInfoAboutThePath),pResult:= ADR(libResultOfThePathMonitoring)); WHILE libResultOfThePathMonitoring = Errors.ERR_OK AND iIndexToScrollArrays <= iArrayMAXDimension DO sEntityToSearch:= ''; libResultOfThePathMonitoring:=SysDirRead(hDir:=libInstanceToMonitorThePath,szDirEntry:=sEntityToSearch,diMaxDirEntry:=dMaxEntityDimension,pDirInfo:=ADR(libFileInfo)); sFilteredFileName:= FUN_06_00_FindItemInString_0(sFilter:=sSearchFilter,sSource:=sEntityToSearch); IF sFilteredFileName <> '' THEN arysListOfFoundFiles[iIndexToScrollArrays]:=sFilteredFileName; iIndexToScrollArrays:=iIndexToScrollArrays + 1; END_IF IF libResultOfThePathMonitoring <> Errors.ERR_OK THEN libResultOfThePathMonitoring:= Errors.ERR_OK; END_IF END_WHILE libResultOfThePathMonitoring:=SysDirClose(hDir:= libInstanceToMonitorThePath); xCheckFileInsideDirectory:=FALSE; END_IF How is possible to solve this issue? Any known work around?
Last updated: 2024-09-17

Post by salvadegianluca on List files in a directory with SysDiropen And SysDirRead CODESYS Forge talk (Post)
Good morning; I'm facing an issue that seems being caused by the library itself. I'm trying to create the list of all the files that are stored inside a psecific directory. Unluckily the first file is allways hidden. VAR CONSTANT arysEmptyArray:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING := [(iArrayMAXDimension - iArrayMinDimension)('')]; iArrayMinDimension:INT := 1; iArrayMAXDimension:INT := 99; END_VAR VAR_INPUT sDirectoryToInspect:STRING; sSearchFilter:STRING; END_VAR VAR_IN_OUT xCheckFileInsideDirectory:BOOL; END_VAR VAR arysListOfFoundFiles:ARRAY[iArrayMinDimension..iArrayMAXDimension] OF STRING; sNullString:STRING; iNullIndex:INT := 0; libInfoAboutThePath:DirInfo; libResultOfThePathMonitoring:CmpErrors.RTS_IEC_RESULT; libInstanceToMonitorThePath:CmpErrors.RTS_IEC_HANDLE; sEntityToSearch:STRING; dMaxEntityDimension:DINT := SIZEOF(sEntityToSearch); libFileInfo:DirInfo; sFilteredFileName:STRING; iIndexToScrollArrays:INT; END_VAR IF xCheckFileInsideDirectory THEN arysListOfFoundFiles:=arysEmptyArray; iIndexToScrollArrays:=iArrayMinDimension; libInstanceToMonitorThePath:= SysDirOpen(szDir:= sDirectoryToInspect,szDirEntry:=sNullString,diMaxDirEntry:= iNullIndex,pDirInfo:= ADR(libInfoAboutThePath),pResult:= ADR(libResultOfThePathMonitoring)); WHILE libResultOfThePathMonitoring = Errors.ERR_OK AND iIndexToScrollArrays <= iArrayMAXDimension DO sEntityToSearch:= ''; libResultOfThePathMonitoring:=SysDirRead(hDir:=libInstanceToMonitorThePath,szDirEntry:=sEntityToSearch,diMaxDirEntry:=dMaxEntityDimension,pDirInfo:=ADR(libFileInfo)); sFilteredFileName:= FUN_06_00_FindItemInString_0(sFilter:=sSearchFilter,sSource:=sEntityToSearch); IF sFilteredFileName <> '' THEN arysListOfFoundFiles[iIndexToScrollArrays]:=sFilteredFileName; iIndexToScrollArrays:=iIndexToScrollArrays + 1; END_IF IF libResultOfThePathMonitoring <> Errors.ERR_OK THEN libResultOfThePathMonitoring:= Errors.ERR_OK; END_IF END_WHILE libResultOfThePathMonitoring:=SysDirClose(hDir:= libInstanceToMonitorThePath); xCheckFileInsideDirectory:=FALSE; END_IF How is possible to solve this issue? Any known work around?
Last updated: 2024-09-17

Post by bjarne-pagaard on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20) CODESYS Forge talk (Post)
Hi, I would like to divide a project into multiple applications - as a minimum: one handling visualization and Alarm Manager, one handling I/O and plant control logic. But how to exchange variables between the applications? What have you done to get such a solution? In versions 3.5.19 and earlier, you can have Child applications, where the children can access a GVL in the Parent application. Children apps is no longer possible in 3.5.20 - but you can have 'sibling' apps - Several apps directly under PLC Logic, that is. But how do they best communicate? The Communication Manager / Data Sources Manager is sort of possible via OPC UA, but it seems like overkill and with some limitations - for example no ARRAY OF STRUCT possible this way. If you have separate devices in your project, you can exchange data via 'CODESYS ApplicationV3', but not other applications in the same device (see attachment Datasources.png). You can do it via 'Select the project type'->'Other Project' and select the same project file, but this leads to crashing the Development system when working with the variables afterwards. It would be great to hear your thoughts / experiences on this topic - Bjarne
Last updated: 2024-09-27

Post by kbazzett on "Sequent Microsystems" industrial automation hat raspberry pi CODESYS Forge talk (Post)
Here is a complete list of the Sequent Microsystems Pi hats that work in Codesys. https://github.com/SequentMicrosystems/SM_CODESYS/tree/main/ "For easy install download the .package file and open it on your computer, Codesys installer will know what to do with it." <- This. The Multi I/O Hat fit my needs because of the Analog I/O 4-20ma and RTD. I used a Raspberry Pi 5 and 64b install. The example project is also worth the download. With the sample project open, right click on the Raspberry Pi device and update to whatever you are using (SL, MC, 64b). Enable I2C on the PI. You can jumper the hats Analog Outputs to Inputs and see it function on the Web Visualization. Very Cool! I spent quite a bit of time trying to find this solution so hopefully this update helps others. Here is the video link on how to setup a Raspberry PI as a Codesys PLC https://youtu.be/RPoPscbo3Kc?si=Th4-n-mQ6g5fdHj8
Last updated: 2024-12-05

Post by dominggus on FileDialog - OnDialogClosed not called anymore CODESYS Forge talk (Post)
Hi, since the latest update it seems the OnDialogClosed is not called anymore?? using CODESYS SP20 Patch 3 with CODESYS Visualization 4.6.0.0 I am using LoadWriteRecipe to load a recipe file from disk (with some custom dialog settings), and I need to run a function (Recipes_LoadFromRecipeData()) afterwards which I execute when OnDialogClosed is closed with OK button. See attached screenshot and code below: *** OnDialogClosed : Recipes_OnLoadFileDialogClosed(pClientData): *** // the DialogManager is provided via the implicitly available VisuManager dialogMan := VisuElems.g_VisuManager.GetDialogManager(); IF dialogMan <> 0 AND pClientData <> 0 THEN FileOpenCloseDialog := dialogMan.GetDialog('VisuDialogs.FileOpenSave'); // gets the FileOpenSave dialog IF FileOpenCloseDialog <> 0 THEN result := FileOpenCloseDialog.GetResult(); // gets the result (OK, Cancel) of the dialog IF result = VisuElems.Visu_DialogResult.OK THEN Recipes_LoadFromRecipeData(); END_IF END_IF END_IF *** OnMouseClick: Execute ST-Code *** // override FileOpenSave Dialog settings // Visu_FbFileListProvider.Initialize(stDirectory, stFilter, stFileIn, stTitle, iRowCount, bBrowseDirectory, bTouch) VisuDialogs.g_FileListProvider.Initialize('./', '*.bunkerrecipe', '', 'Load recipe', 20, TRUE, FALSE); VisuDialogs.g_FileListProvider(); This used to work in CODESYS v3.5 SP20 Patch 1, but it seems it doesn't work anymore unfortunately? The OnDialogClosed just never seems to be called anymore....
Last updated: 2024-12-18

Post by jst69 on Python script: Launch Codesys, Execute Script, Exit Codesys CODESYS Forge talk (Post)
Dear all: Question about scripting: I am creating a .NET program that is supposed to Open codesys, open template project, export a bunch of pou, then exit codesys. Launch works, Open project works, Export works, But how do i tell codesys to close itself? I can tell windows to terminate codesys, but i would prefer to do it properly. from __future__ import print_function import sys import System proj = projects.primary # We're interested in POU nodes: POUGuid = Guid("6f9dac99-8de1-4efc-8465-68ac443b7d08") # We collect all POU nodes in that list. pous = [] # From the parent node on, we recursively add POU nodes: def CollectPous(node): if node.type == POUGuid: pous.append(node) else: for child in node.get_children(): CollectPous(child) # Now we collect all the leaf nodes. for node in proj.get_children(): CollectPous(node) # We print everything just to know what's going on. for i in pous: print("found: ", i.type, i.guid, i.get_name()) # And now we export the files. for candidate in pous: # We create a list of objects to export: # The object itsself objects = [candidate] # And sub-objects (POUs can have actions, properties, ...) objects.extend(candidate.get_children()) # And the parent folders. parent = candidate.parent while ((not parent.is_root) and parent.is_folder): objects.append(parent) parent = parent.parent # Create an unique file name: if len(sys.argv) == 1: filename = "parent\\%s.export" % (candidate.get_name()) else: filename = "%s\\%s.export" % (sys.argv[1],candidate.get_name()) # print some user information print("exporting ", len(objects), " objects to: ", filename) # and actually export the project. proj.export_xml(objects, filename) proj.close() print ("script finished.") System.exit(0) // Dont work .NET: public static void Export(string path,string proj) { if (checkSettings()) { var p = new System.Diagnostics.Process(); p.StartInfo.FileName = Properties.Settings.Default.CSVersion +"\\CODESYS\\Common\\CODESYS.exe"; p.StartInfo.Arguments = " --Profile=" + qoute(Properties.Settings.Default.CSProfile) + " --culture=en" + " --project=" + qoute(path + "\\" + proj) + " --runscript=" + Properties.Settings.Default.LastOpenProjectPath + "\\INPUT_DATA\\SCRIPT\\Export.py" + " --scriptargs:" + qoute(path) ; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = false; p.Start(); p.StandardOutput.ReadToEnd(); p.CloseMainWindow(); p.Close(); } }
Last updated: 2024-01-16

Post by westcountryewe on ac_persistence not working when creating a Boot Application but works with a Direct Download to the PLC CODESYS Forge talk (Post)
I am using V3.5 SP18 Patch 5. I have noticed that when I Create a Boot Application from CODESYS, and upload this to my PLC via a USB stick the AC_Persistence does not work and none of my values that are in my PersistenceChannel are retained. However, if I connect direct to my PLC and I perform a direct download of my CODESYS program, my values that are in my PersistenceChannel are retained and work as they should. This makes me wonder if there are files that are missing when a Boot Application is created. I have tried taking a backup of my configuration files after performing a direct download, which gives me the plclog.zip folder, and appears to have the ac_persistence folder present within the file structure, however when I replace the plclogic.zip with the same folder that was created when I created a Boot Application, it still does not work but I wonder whether this is because the ac_persistence folder isn't stored in the correct location for reading. The .app and .crc files are embedded within the plclogic.zip folder, which obviously when uploading need to be standalone files in the root directory of the USB, so the intention there is clearly to extract the .app and .crc files and put them into the correct location within the USB. I wonder if it could be the same for the ac_persistence folder? I have tried moving it to different locations but none have worked. Has anybody else discovered a fix for this? I know the short-term solution is to do a direct download to the PLC but there are some logistical reasons why this isn't neccesarily the best solution for us.
Last updated: 2024-02-27

Post by umdee on Error when monitoring LAD programs CODESYS Forge talk (Post)
I get the following error when monitoring my program (see attached screenshots): "Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately. Value cannot be null. Parameter name: source. And the details say: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ** Exception Text ** System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.Enumerable.Any[TSource] (IEnumerable1 source, Func2 predicate) at _3S.CoDeSys.NWLEditor.NWLTextCell.OnPaintCellLayer(PaintEventArgs e) at _3S.CoDeSys.Controls.Controls.GfxEdControl.PaintCellCellLayer(PaintEventArgs e, GfxCell cell) at _3S.CoDeSys.Controls.Controls.GfxEdControl.PaintCellCellLayer(PaintEventArgs e, GfxCell cell) at _3S.CoDeSys.Controls.Controls.GfxEdControl.PaintCellCellLayer(PaintEventArgs e, GfxCell cell) at _3S.CoDeSys.Controls.Controls.GfxEdControl.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.UserControl.WndProc(Message& m) at _3S.CoDeSys.Controls.Controls.GfxEdControl.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ** Loaded Assemblies ** (3000 lines of assemblies) ** JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitdebugging="true"> </system.windows.forms></configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box The windows show red X's where the networks should be. Any advice on how to fix this? Additional Information PLC used: Wago 750-8212, Firmware FW26 Startup profile: CODESYS V3.5 SP19 Patch 5 OS version: Microsoft Windows NT 10.0.22631.0 .NET version: 4.0.30319.42000 Full Version info attached as .txt
Last updated: 2024-03-17

Post by mubeta on Some 'pathetic' errors in SoftMotion program CODESYS Forge talk (Post)
Yes, this is the error the sometimes show up. What make me crazy is the fact that it happens randomly and not each times. I know very well where the problem is, in wich one program row it's located. For each actions of the state machine I have all events recorded with log on text file. it is not problematic for me to find the application point of the fault, but I need to understand why occasionally and for no apparent reason, switching the state machine and thus changing the motion FB, sends the axis into failure (but only occasionally). For example, one case that is often problematic is the execution of the Axis Halt instruction. When, after a MoveAbosulte instruction this returns the event as 'done' and indeed the axis is in standstill, the state machine first sets the move instruction to FALSE, and the next cycle sets the Halt request to TRUE. Some of the time everything works out fine. Occasionally, however, in this exchange, the axis goes into fault, also losing the OPERATIONAL state. Meanwhile, I would like to understand why the motion FB instances must still be called even after the Execute is set to FALSE, especially in view of the fact that the next instruction is programmed to abort the previous one, with BufferMode set to 'Aborting'. All these unnecessary FB calls are an unnecessary overhead on the CPU anyway. Is there any precise rule about when to cease calling the various instances? (It should precisely be the 'done' status that says this one has finished its work).
Last updated: 2024-07-18

Post by steven-schalm on Github Actions CI/CD tasks - development topic CODESYS Forge talk (Post)
hello kevinrn, I've been looking for a solution to the CI/CD issue for a long time. Briefly about me... I am 32 and software architect for Codesys V3 and fullstack dev for web (VueJS, NestJS) in a small company in Erfurt (Germany). https://www.rex-at.de/. Through my web part, we already have CI/CD running well via GitLab (YAML-based configuration file (.gitlab-ci.yml), which defines which pipelines and jobs are executed when certain events occur) with everything you know. Stages for npm packages - prepare (GitVersion, npm install or whatever) - build (vite, tsc or whatever) - testing (vitest, jest or whatever) - deploy (npm packages) And similar for monorepo's or backend services (in NestJS) as DockerImages. For Codesys we have been building an OOP framework for years (~50 libraries now), which is currently managed via SVN and a specially written Svn-Watcher (in Python) gets commits and runs and builds everything together and deploys it to an FTP server and network drive. Why do we still have SVN? Because we are unfortunately still tied to the safety integration of Codesys and can therefore only go to SP15 at most with our controller/Eckelmann. But soon there will be an update and there will be no more obstacles to using Git. Hence my questions: 1. the basic idea is to run a local Windows Runner on some machine? 2. install Codesys on the machine where the runner is running? 3. powershell & python scripts are then used to execute builds (compile, build, sign libraries) & deploys? 4. can the Github action also be used in GitLab? ChatGPT has already told me that it's not the same, but it doesn't hurt to ask. Do you have any ideas on this? Greetings :D
Last updated: 2024-08-20

Post by edson-bueno on SysProcess Execute Command unable to run commands with special characters CODESYS Forge talk (Post)
Hi, I found the same issue, and I fixed with this steps: 1st go to codesys .cfg file. sudo nano CODESYSControl.cfg Then insert this: [SysProcess] BasePriority=Realtime Command=AllowAll Now we need to grant codesys root rights on Linux. Step 1: Create or edit the systemd override configuration: sudo systemctl edit codesyscontrol In the editor that opens, insert: [Service] User=root Save and exit: Press Ctrl+O to save Press Ctrl+X to exit Step 2: Reload systemd and reboot To apply the override: sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo reboot Step 3: Confirm CODESYS is running as root After reboot, open the terminal and run: ps aux | grep codesyscontrol You should see something like: root 1234 ... /opt/codesys/bin/codesyscontrol.bin ... If instead it shows admin or another user, the override was not applied correctly. Step 4: (Optional) Confirm from within CODESYS In your CODESYS project, insert this test code to run the Linux command whoami: Make sure the lib SysProcessImplementation, SysTypes, and CmpErrors is on the project. VAR sCommand : STRING := '/usr/bin/whoami'; sOutput : STRING(255); refCommand : REFERENCE TO STRING; refOutput : REFERENCE TO STRING; resultCmd : UDINT; END_VAR refCommand REF= sCommand; refOutput REF= sOutput; SysProcessExecuteCommand2( pszCommand := refCommand, pszStdOut := refOutput, udiStdOutLen := SIZEOF(sOutput), pResult := ADR(resultCmd) ); Notes & Warnings This method gives full system access to the CODESYS runtime — do not expose this system to the public network without protection. Do not use sudo in commands inside CODESYS when the runtime is already running as root. @tomas111, in case you want to read the temperatur, use this command: sCommand:STRING:='/usr/bin/vcgencmd measure_temp';
Last updated: 2025-05-20

Post by drbuzz on Communication Error (#0) for IFM controller CODESYS Forge talk (Post)
Hi Folks, Every time I use an IFM controller I always seem to run into a problem connecting to it. I get the Communications Error (#0). So I thought I would share some tips and tricks. Once the CANfox Cable (EC2112) cable driver is installed, you can use the yellow app in the sys tray to blink the lights on the cable. Confirm the cable works in the IFM maintenance software by connecting to the controller and reading the information on it. Make sure to download an OS into the controller (the light will go from a fast blink to solid green). In Codesys V2.3, the communication settings for the CR0401 is 250kBaud by default and Node ID 127. What got me, was I needed to reboot the computer after the cable driver install. Also if your application has canbus settings in it which are changed from default, after the controller is power cycled, the new Node ID and Baud will be in effect. I made a handy guide because too much time has been wasted on this. Programming IFM CR0401 Serial/Can Programming Cable • Connect IFM EC2112 CanFox programming cable with connector adapter. • Make sure cable is linked to VM (if using VM). • Install drivers for cable if not installed. o Download from IFM EC2112 site. https://www.ifm.com/ca/en/product/EC2112 • Once Installed, reboot computer. • In system tray, there should be a yellow icon that you can open and check on programming cable. Select the cable in the list and flash the lights to confirm it is working. Maintenance Software • Install IFM Maintenance Tool Software. o Download from IFM Site. https://www.ifm.com/ca/en/download/eco100_MaintenanceTool • Open IFM Maintenance software • Select Basic System • Select CAN cable • It will tell you if you don’t have a cable connected. • Use Wizard if needed. • Read Channel Parameter on the Settings page, or get Identity in the System Information > Identity. • Default Node is 127 on a new unit. Baud is 250kBaud (bits/sec) • Controller information should populate. • Controller green light should be blinking at 5hz (meaning OK but no OS, just bootloader). • Click Software > Load. • Open the OS file. Should match Codesys version selection (for CR0401 this is version 3). o Download OS file from IFM Website. https://www.ifm.com/ca/en/product/CR0401 o It is located at the top of the download under “software for CR0401”. o Select the file and load it… this will take a minute. • Once completed the unit should now have a solid green light o Solid green means the controller has an OS but no application is running. Codesys V2.3 Application • Codesys needs to be downloaded and installed from the IFM website as it has the IFM libraries and license to use the software. o Download from the IFM CR0401 page. o https://www.ifm.com/ca/en/product/CR0401 • Create new application with the correct IFM controller or Open Codesys application. • Keep in mind that the PLC Configuration on the Resources tab can be changed for the CAN communication interface… so changes to node and baud will take effect after the first download and reboot of the controller. • Go to “Online” in the top menu and change “Communication Parameters” o The Local dropdown shows the last configuration used. All other interfaces will show below it and need to be updated when changed or used. o Confirm Node ID is 127 for the first download.  The NodeID will change to whatever the program has after (in my case 125).  Node Send Offset should be default at 1536  Node Recv Offset should be default at 1408  Can bus Baudrate should be 250 kbaud.  Yes to Motorola Byte Order  Block Transfer should be false and note used (60 is default setting).  Can Card Driver should match the systray item which is Sie_USB. • If the system populated the other one, just update and relay the communication parameters. The software will usually bring up the available cable and driver. • Go to “Online” and Login to download. o Press Yes to Download Application. I hope this helps!
Last updated: 2025-03-21

Post by bschraud on runtime received SIGABRT CODESYS Forge talk (Post)
Ich konnte den Fehler leider nicht wirklich finden. Hier mein bisheriger Fortschritt: Um nähere Informationen zu bekommen, habe ich einen strace erstellt: PID ermitteln: $ ps aux | grep codesyscontrol | grep -v grep --> 560 sudo strace -tt -f -p 560 -o /tmp/codesys_strace.log (Die Logdatei wird schnell einige hundert MB groß.) Mit grep -B 100 'si_signo=SIGABRT' /tmp/codesys_strace.log konnte ich die relevanten Einträge finden: (Die PID hat sich inzwischen wegen einem Reboot geändert) 1023 15:33:49.497136 writev(2, [{iov_base="Unexpected error 9 on netlink de"..., iov_len=45}], 1 <unfinished ...=""> .. 1023 15:33:49.498352 tgkill(545, 1023, SIGABRT <unfinished ...=""> 1023 15:33:49.498440 <... tgkill resumed> ) = 0 .. 1023 15:33:49.498730 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=545, si_uid=0}</unfinished></unfinished> Der Codesys Log zeigt zu diesem Zeitpunkt: Exception: HANDLED EXCPT <excpt>NonContinuable</excpt> in CH_COMM_CYCLE Mit sudo lsof -p 545 habe ich die Anzahl der geöffneten Dateien überprüft ohne Auffälligkeiten Mit sudo netstat -tunaep | grep codesys habe ich die offenen Netzwerkverbindungen der codesys Prozesse überprüft Hier sieht es so aus, dass codesyscontrol und codesysedge über die externen Netzwerkschnittstelle anstatt über den localhost kommunizieren: udp 0 0 172.19.11.127:1740 0.0.0.0: 0 17882 549/codesyscontrol. udp 0 0 172.19.11.255:1740 0.0.0.0: 0 17883 549/codesyscontrol. udp 0 0 172.19.11.255:1743 0.0.0.0: 0 16993 529/codesysedge.bin udp 0 0 172.19.11.127:1743 0.0.0.0: 0 16992 529/codesysedge.bin Leider kann ich keine Konfiguration mit einer anderen Schnittstelle einstellen.. Als nächstes habe ich die udp Kommunikation der beiden Prozesse aufgezeichnet: SPID des BlkDrvUdp Threads ermitteln: $ ps aux | grep codesyscontrol | grep -v grep --> 548 $ ps -T -p 548 | grep BlkDrvUdp --> 1200 Damit kann man den strace starten: sudo strace -p 1020 -f -tt -o /tmp/udp_control_trace.log -e trace=socket,connect,bind,sendto,recvfrom,close $ ps aux | grep codesysedge | grep -v grep --> 528 $ ps -T -p 528 | grep BlkDrvUdp --> 789 sudo strace -p 789 -f -tt -o /tmp/udp_edge_trace.log -e trace=socket,connect,bind,sendto,recvfrom,close Beim Aufzeichnen des Traces kamen wiederholte Fehlereinträge im codesyscontrol.log (diesmal ohne SIGABRT) nach folgendem Muster: tail -f /var/opt/codesys/codesyscontrol.log (mit UTC Zeit) 2025-04-17T11:23:43.147Z, 0x00000071, 1, 0, 0, Host : PAC4 2025-04-17T11:23:43.147Z, 0x00000071, 1, 0, 0, HTTP port : 8080 2025-04-17T11:23:43.147Z, 0x00000071, 1, 0, 0, HTTPS port : 443 2025-04-17T11:23:43.147Z, 0x00000071, 1, 0, 0, Connection type : HTTP 2025-04-17T11:23:43.147Z, 0x00000071, 1, 0, 0, ********** 2025-04-17T11:23:46.318Z, 0x00000061, 1, 0, 0, Create asymmetric key done! 2025-04-17T11:23:53.464Z, 0x00000071, 1, 404, 0, File $PlcLogic$/$visu$/favicon.ico not found on this server 2025-04-17T11:23:55.208Z, 0x0000100c, 1, 0, 0, Visu_PRG: Creating Client for Extern-ID: 2025487823 2025-04-17T11:23:55.216Z, 0x0000100c, 1, 0, 0, Visu_PRG: Creating Client successful for Extern-ID: 2025487823 Returned IEC-ID: 0 2025-04-17T11:40:43.471Z, 0x00000114, 4, 1, 0, ** ERROR: SysTaskCreate [CheckLicense0]: pthread_setname_np: Bad file descriptor Hier der dazu passende trace auszug von grep -B 100 '13:40:43' /tmp/udp_edge_trace.log: 798 13:40:42.592535 socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_ROUTE) = 9 798 13:40:42.592794 bind(9, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 0 798 13:40:42.593049 sendto(9, {{len=20, type=0x12 / NLMSG_??? /, flags=NLM_F_REQUEST|0x300, seq=1744890042, pid=0}, "\x00\x00\x00\x00"}, 20, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 20 798 13:40:42.602995 sendto(9, {{len=20, type=0x16 / NLMSG_??? /, flags=NLM_F_REQUEST|0x300, seq=1744890043, pid=0}, "\x00\x00\x00\x00"}, 20, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 20 798 13:40:42.614794 close(9) = 0 798 13:40:42.615065 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 9 798 13:40:42.615331 close(9) = 0 798 13:40:42.616159 close(9) = 0 798 13:40:42.616318 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 9 798 13:40:42.616555 close(9) = 0 798 13:40:42.617209 close(9) = 0 798 13:40:42.617355 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 9 798 13:40:42.617590 close(9) = 0 798 13:40:42.618497 close(9) = 0 798 13:40:42.618712 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 9 798 13:40:42.618995 close(9) = 0 798 13:40:42.619568 close(9) = 0 798 13:40:42.620247 close(9) = 0 798 13:40:42.620441 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 9 798 13:40:42.620690 close(9) = 0 798 13:40:42.621181 close(9) = 0 798 13:40:42.621823 close(9) = 0 798 13:40:43.520036 close(9) = 0 798 13:40:43.520406 close(9) = 0 und grep -B 100 '13:40:43' /tmp/udp_control_trace.log 1035 13:40:43.389785 socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 20 1035 13:40:43.390043 close(20) = 0 1035 13:40:43.390681 close(20) = 0 1035 13:40:43.393690 close(20) = 0 22586 13:40:43.450945 close(0) = 0 22586 13:40:43.451230 close(0) = -1 EBADF (Ungültiger Dateideskriptor) 22586 13:40:43.451689 close(20) = 0 22586 13:40:43.452104 close(1) = 0 22586 13:40:43.452481 close(21) = 0 22586 13:40:43.452679 close(2) = 0 22586 13:40:43.452860 close(2) = -1 EBADF (Ungültiger Dateideskriptor) 1009 13:40:43.454112 close(21) = 0 22586 13:40:43.454522 close(8) = 0 22586 13:40:43.455428 close(8) = 0 22586 13:40:43.455976 close(8) = 0 22586 13:40:43.456852 close(8) = 0 22587 13:40:43.463115 close(8) = 0 22587 13:40:43.464074 close(8) = 0 22587 13:40:43.464682 close(8) = 0 22587 13:40:43.465463 close(8) = 0 22587 13:40:43.468229 close(8) = 0 22587 13:40:43.468737 close(1 <unfinished ...=""> 1009 13:40:43.468805 close(20 <unfinished ...=""> 22587 13:40:43.468849 <... close resumed> ) = 0 1009 13:40:43.468896 <... close resumed> ) = 0 22587 13:40:43.468942 close(2) = 0 22587 13:40:43.469504 +++ exited with 0 +++ 22586 13:40:43.469670 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=22587, si_uid=0, si_status=0, si_utime=0, si_stime=1} --- 22586 13:40:43.470175 +++ exited with 0 +++ 1009 13:40:43.470265 close(20) = 0 546 13:40:43.470577 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=22586, si_uid=0, si_status=0, si_utime=0, si_stime=2} --- 1035 13:40:43.470913 close(20) = -1 EBADF (Ungültiger Dateideskriptor) 22588 13:40:43.480352 --- SIGRT_7 {si_signo=SIGRT_7, si_code=SI_TKILL, si_pid=546, si_uid=0} --- 22588 13:40:43.481675 --- SIGRT_6 {si_signo=SIGRT_6, si_code=SI_TKILL, si_pid=546, si_uid=0} --- 22588 13:40:43.482410 +++ exited with 0 +++</unfinished></unfinished> Die Zeile 2025-04-17T11:40:43.471Z, 0x00000114, 4, 1, 0, **** ERROR: SysTaskCreate [CheckLicense0]: pthread_setname_np: Bad file descriptor zeigt, dass der EBADF-Fehler beim Versuch auftritt, einen neuen Thread namens "CheckLicense0" zu erstellen. Die Funktion pthread_setname_np() erhält einen EBADF-Fehler. Ich weiß leider nicht, ob das eine heiße Spur ist. Parallel dazu habe ich die Aufrufe von Systemfunktionen über SysProcess_Implementation.SysProcessExecuteCommand2 auskommentiert ohne den Fehler damit abzustellen. An diesem Punkt habe ich wegen Termindruck den alten Stand der Runtime (4.11.0.0) mit der Codesys Version 3.5 SP20 wiederhergestellt und die geänderten Programme und Visualisierungen manuell getauscht mit dem Ergebnis, dass der Fehler in den letzten 2 Stunden nicht mehr aufgetreten ist. Wenn jemand das Problem kennt, wäre ich für einen Austausch dankbar. Frohe Ostern!
Last updated: 2025-04-17

Post by gilbert-mh on CAA net base TCP client cause PLC to crash - Kernel message : N0HZ_local_softirq_pending 80 CODESYS Forge talk (Post)
Hello all, I have been trying to implement a TCP client on a Festo PLC (CPX-E-CEC-M1) and it looks like it works well except that after some time (greatly varies between a few hours to more than 100h) my PLC crash. When I look into the log file the only thing I see is that before the crash happens a few kernel warnings : N0HZ_local_softirq_pending 80 and then the crash. I've looked into this warning and from what I could find on the net it seems that this is warning is triggered when the ethernet link is down. I've tried to correct this bug for quite some time and what I know is that : - The crash is caused by my TCP client, when I remove it from my code I see no crash - The crash happens more quickly the more the TCP client is used. - The time before the crash is not directly proportional to the number of communications or their size. But it looks like it is just more likely to happen if the client connect to the server at a higher frequency. - The precedent observation makes it seem unlikely that the crash is caused by some memory overflow because then the crash speed would be more proportional to the amount of data exchanged. SO from these observations, I believe that the crash could be caused by the PLC trying to connect to a server while there is some kind of issue with the ethernet link resulting in the PLC getting stuck in some indefinite state and making it crash. This still seems a bit unlikely to me because if the ethernet is down it simply shouldn't be able to contact the server and the communication would just fail which doesn't cause my PLC to crash. Has anyone encountered the same kind of problem (with the same kernel message) ? I am pretty sure the warning is not the direct cause of the crash but just an indicator that something is wrong with my PLC. Thanks in advance
Last updated: 2024-01-12

Post by dandyk on Dynamic Images CODESYS Forge talk (Post)
Hello, I have very similar problem, but it seems that your solution does not work for me. I am using TwinCAT XAE Shell v3.1.4024.55 and TwinCAT Runtime. Sorry for writing here on codesys forge, but since I found the only relevant topic here and since TwinCAT is almost the same with CODESYS in many applications, I chose to write here. I simply need to dynamically update image in visualization based on camera trigger (I am doing a machine vision application). Camera triggers an image, my program processes it (applies thresholding, draws contours etc...) and saves the processed image in the runtime location (the same one you were mentioning). This was done successfully. I need to make it work at runtime, while the program is executing and I need to refresh the image in the visualization each time camera triggers a new image and program processes it. When I create image element in the visualization and define the bitmap ID variable as STRING which contains the image ID defined in the image pool, then it displays the image in the image pool, but does not work at runtime, while the program is executing. I also used the Bitmap Version. I declared it in Global variable list as integer with initial value of 0 and wrote the variable in the bitmap version in the image element in visualization. Each time new image is saved to the runtime location, I wrote a program to increment Bitmap Version by 1. It increments and the image does not update in the visualization, unfortunately. I think that bitmap version is working correctly and deletes the cached image as it is supposed to, but the Image Pool does not update the image ID with the new image... the path to the image is always the same... only the actual image changes with the same file name. Image Pool is not dynamic and cannot refresh the image in the path to the actual one at runtime. How can I refresh the image ID in the image pool at runtime? Bitmap version only deletes cached image and reloads the image from the image ID, but the image ID has the same image, because image pool won't update at runtime. Do you know any solution to this problem?
Last updated: 2024-04-06

Post by ppix on Establishing TLS Connection with MQTT Broker using MQTT Client SL Package CODESYS Forge talk (Post)
I’m currently working on establishing a TLS connection with an MQTT broker using the MQTT Client SL package in CODESYS. While I’ve successfully established communication with the broker without TLS, I'm encountering issues when trying to enable TLS. In the 'MQTT Explorer' application, I can easily upload the server certificate (.crt), client certificate (.crt), and client key (.key). However, in CODESYS, I can’t find a way to upload my client key (.key file). Here's a summary of my current setup: Certificates: I have uploaded both the client and server certificates to the certificate store under the 'Trusted Certificates' folder in the security screen. TLS Context Initialization: Despite setting the _sCommonName as the name of my client certificate, a new self-signed certificate is created and placed within the device’s certificates. I then need to manually move this certificate to the trusted certificates folder. This results in three certificates in my trusted certs folder: client cert, server cert, and the newly created cert. _ciDefaultCertInfo : MQTT.NBS.CERT_INFO := (psInfo := ADR(_sCommonName), udiSize := TO_UDINT(LEN(_sCommonName))); // CN of the certificate (common name) _sCipherList : MQTT.NBS.CIPHER_LIST := STRUCT(psList := ADR('HIGH'), udiSize := 4); // Cipher string see https://www.openssl.org/docs/man1.1.1/man1/ciphers.html _tlsContext : MQTT.NBS.TLSContext := ( sUseCaseName := _sCommonName, // A certificate is stored in the certificate store with the use case name. You can choose any name. Here we use the common name. ePurpose := MQTT.NBS.PURPOSE.CLIENT_SIDE, // For client certificates set this to NBS.PURPOSE.CLIENT_SIDE sTLSVersion := '1.3', // The TLS version sCipherList := _sCipherList, // Set the cipher list sHostname := sHostname, // The hostname of the broker udiVerificationMode := 2, // 2 => Active Peer verification ciCertInfo := _ciDefaultCertInfo, // Set the cert info itfCertVerifer := 0); // 0 => No Verifier mqttClient : MQTT.MQTTClient := (xUseTLS:=TRUE, itfTLSContext := _tlsContext, itfAsyncProperty := _asyncProperty); Additional Details: In the client FB, I’ve set uiPort:= 8883, xUseTLS:= TRUE, and configured itfTLSContext as mentioned above. The certificates are encrypted with SHA256RSA. sHostname is the IP address of my broker. I’ve attached a copy of the client FB, which shows straight lines where variables are assigned and boxes where they are not. I am currently trying this on the only 2 compatible versions of COSDESYS with my controller (V3.5.15.20 and V3.5.18.40) My Question: How do I correctly set up this mTLS connection? What might I be missing? Any guidance or suggestions would be greatly appreciated, especially considering I’ve already successfully established a non-TLS connection with the same broker. Thank you in advance for your help!
Last updated: 2024-06-19

Post by dantheman on Connecting to SoftPLC Only Works By Turning Off Modbus Ethernet Port CODESYS Forge talk (Post)
I have an IPC with 2 ethernet ports and 1 Wi-Fi. I'm using ModbusTCP with the ethernet port named "enp2s0" connected to my remote I/O. This works fine when testing with Python and also works with CODESYS, but CODESYS is only able to scan for the Linux SoftPLC when I turn off the "enp2s0" interface. In other words, I can't get online with the IDE if I want my ModbusTCP comms to run with CODESYS. I'm using a Linux SoftPLC that has the following entry in CODESYSControl.cfg, hoping that this will allow me to connect with "enp1s0" or "wlp3s0", and leave "enp2s0" for field comms, but this seems to only make the source IP of the ModbusTCP comms to be bound to "enp2s0". That last point is the case only if I don't restart the service, but if I do restart the service after changing the config file, the source IP for the ModbusTCP comms then becomes the one for "enp1s0", which is very confusing to me: [SysSocket] Adapter.0.Name="enp2s0" Adapter.0.EnableSetIpAndMask=1 On the device list, I only have "enp2s0" given as the ethernet device that has the ModbusTCP master & slave beneath it, shown in Screenshot 1. On the IPC, I can ping the ModbusTCP client (remote I/O) from "enp2s0", and I've attached a Wireshark capture of running ModbusTCP from the CODESYS runtime as Screenshot 2, 3 & 4 (again, I can't get online when this is running, I have to turn off "enp2s0" to connect even when it's idle and I don't have an active TCP session with my Python tests). Like I explained above, the source IP is "enp1s0", even though the ethernet device on the project is "enp2s0". I was lucky to catch the red message that showed the source IP that makes sense to me (the one for "enp2s0"), but for some reason that connection was reset and I never saw that packet again. I've also tried this with Auto-reconnect both enabled & disabled, for the ModbusTCP Master device. I also have to turn off "enp1s0" and then turn it on, just so that I can have the ModbusTCP comms running from "enp2s0" (which is not intuitive in any way to me, I'd love some help understanding that phenomenon as well) in the weird manner that I've described above. I would be very appreciative if someone can help me figure out this pickle. I'd love to just connect to CODESYS through my Wi-Fi interface and leave my ethernet ports for field comms.
Last updated: 2024-08-01

Post by mondinmr on Frustration-Fueled Feedback on Project File Management and Git Integration CODESYS Forge talk (Post)
In reality, other vendors are already moving towards integration with VS Code. B&R, for example, is likely the only one that could truly challenge Codesys in the market: they’ve overhauled their once-archaic environment (previously lacking ST OOP) and are now catching up significantly with Automation Studio Code, offering modern programming capabilities and native support for tools like Git and GitHub Copilot. The other big names in the market, frankly, are still light years behind. For smaller projects, typically handled by “wire strippers” (with all due respect!), a classic environment might be just fine. But once you’re dealing with thousands or even millions of lines of code—possibly organized in an OOP paradigm, spanning large teams, integrating third-party libraries, requiring version control, and performing comprehensive tests—a lightweight, responsive editor supercharged with AI-based features becomes essential. The real strength of something like VS Code lies in its vast ecosystem of extensions and integrations: from advanced Git support to automated build/test pipelines, and even AI-assisted autocompletion that already makes software development much more agile and productive. I understand that a PLC project involves more than just ST code (task setup, fieldbus configuration, libraries, etc.). However, there’s no technical reason not to at least provide ST files in a pure text format, making version control and collaboration far easier. B&R has clearly adopted this approach; I hope Codesys will accelerate its own efforts to offer a native, text-based integration and modern development tooling. Once you go beyond a certain level of complexity—dozens of configurations, OOP hierarchies, and distributed teams—you really do need “engineer-level” software tools, not just solutions targeting “wire strippers.” For large-scale automation projects, a more open and flexible approach is the only way to avoid chronic frustration. Let me emphasize that I truly love Codesys and consider the work done so far to be brilliant—I’d be sorry to see it overshadowed by others moving faster in this direction.
Last updated: 2025-02-18

<< < 1 .. 31 32 33 34 > >> (Page 33 of 34)

Showing results of 827

Sort by relevance or date