Post by faceplant on Comparison via CLI is broken
CODESYS Forge
talk
(Post)
Hello! I am trying to compare 2 projects via the --compare CLI option. In the docs for the --compare option, it describes the usage as .\CODESYS.exe --compare "project path 1" "project path 2". I store my projects in WSL2 on my windows machine. Since CODESYS is happy to open those projects via a path like \\wsl.localhost\home\project.project. So, to compare, I use the command .\CODESYS.exe --compare "\\wsl.localhost\home\prog1.project" "\\wsl.localhost\home\prog2.project". This results in CODESYS just opening the project and starting, not comparing the two projects. No errors are thrown, and I know the paths are correct since I can open both independently in CODESYS, and I can compare them manually through the CODESYS UI. I have also tried moving my projects to the Windows 11 OS and still have the same issue. CODESYS opens the project and does not actually compare them. I am using CODESYS profile v3.5 sp20 patch 1. What is the correct way to compare 2 projects using the --compare CLI option?
Last updated: 2024-12-18
Post by mubeta on Strange problem with the āMC_SetPositionā function
CODESYS Forge
talk
(Post)
CoDeSys 3.5.19.7 Target Berghof MX6 In a simple SoftMotion programme with two stepperless modular axes from CMZ, one is simply controlled in speed, but a spot must perform a positioning. I use the function MC_SetPosition() both to reference the axis at power-up and also to correct the actual position to a fixed machine reference detected with proximity. The function has only one instance and I actually use a booelan variable to control the āExecuteā input. Well, I cannot correctly change the axis position on the fly if it is running at high speed. The servomotor works in a speed range between 0°/s and 720°/s, (gearbox output with a 1:6 ratio). As long as the servomotor is operating at speeds below about 400 °/s, the function is able to correct the position correctly even when forcing values far apart, but at high speeds, from 400 °/s upwards, the correction no longer takes place. For example, trying to correct the position of 280° into 300° with absolute mode, the axis that is moving at speed actually shifts the position by a few degrees, not the expected 20. I don't understand why with the servo drive running slowly the position shift occurs correctly, while increasing in speed it no longer works.
Last updated: 2025-01-09
Post by bertcom on STRING conversions to DWORD
CODESYS Forge
talk
(Post)
Good afternoon. I want to communicate with a Domino Industrial Printer using its Codenet protocol. The printer wants a series of Hexadecimal characters with no spaces or '00' characters. Because of that i chose the option to make the prefix and subfix for my code in a string. I have variable data in another string. With a complete program of a lot of CONCAT functions i eventually get the format of code that the printer accepts ( tested it with the hercules tool). Hercules String : 1B4F513030311B7532626C61636B04 The problem is : Codesys adds automatically 'code' to the code to show it is a string. Codesys string : '1B4F513030311B7532626C61636B04' The printer does not understand this. My idea is to convert the string datatype to an LWORD. I have no idea how to do this. I random types in STRING_TO_DWORD, as return i get 0. That didn't worked. Also on internet the explenations around string converting in codesys are very limited. If there in anyone who can explain me how to do it, i would appreciate it a lot ! Thank you!
Last updated: 2025-01-29
Post by timvh on STRING conversions to DWORD
CODESYS Forge
talk
(Post)
I guess that the printer expects to receive an array of byte values. So where it is described that it expects to receive: Hercules String : 1B4F513030311B7532626C61636B04 it actually expects to receive an array of bytes with the values 1B,4F,51,30,30, etc. So what you can do is create an array of bytes and assign the byte value to each item in the array: VAR abyToSend : ARRAY[0..99] OF BYTE; END_VAR abyToSend[0] := 16#1B; // ASCII Escape character, hexadecimal representation uses 16# as prefix abyToSend[1] := 16#4F; // ASCII 'O' abyToSend[2] := 16#51; // ASCII 'Q' abyToSend[3] := 16#30; // ASCII '0' // you can do the rest yourself // maybe could be created a lot smarter, but gives you an indication how to handle this. Then with the serial communication (or TCP/IP?) you can send a message with the reference to the array (abyToSend) and the number of bytes to send (15 bytes for the string you gave as example).
Last updated: 2025-02-02
Post by george32 on TCP Server
CODESYS Forge
talk
(Post)
Thank you for your advice Rinie, I have tried to follow this example but found one problem.When I disconnect with Hercules the system does not acknowledge the lost of its connection this could result in critical errors. Because of this error I am trying to implement the Syssocket library. With this library I am having a problem which I could not solve. I have the following code: ip_adres : STRING :='0.0.0.0'; port : WORD := 5000; iStep : INT := 1; // Socket information Socket_handler : SysSocket_Interfaces.RTS_IEC_HANDLE; Socket_handler_result : SysSocket_Interfaces.RTS_IEC_RESULT; Socket_adress : SysSocket_Interfaces.SOCKADDRESS; Addres_Convert : SysSocket_Implementation.RTS_IEC_RESULT; // Bind information Bind_handler : SysSocket_Interfaces.RTS_IEC_RESULT; // Listener Information Listener_handler : SysSocket_Interfaces.RTS_IEC_RESULT; Addres_Convert := SysSocket_Implementation.SysSockInetAddr(szIPAddress:= ip_adres,pInAddr:= ADR(Socket_adress.sin_addr)); Socket_adress.sin_family:= SysSocket_Interfaces.SOCKET_AF_INET; Socket_adress.sin_port := SysSocket_Implementation.SysSockHtons(usHost:= port); CASE iStep OF 1: // Create Socket Socket_handler :=SysSockCreate( iAddressFamily :=SysSocket_Interfaces.SOCKET_AF_INET, diType:=SysSocket_Interfaces.SOCKET_STREAM, diProtocol:=SysSocket_Interfaces.SOCKET_IPPROTO_TCP, pResult:=ADR(Socket_handler_result)); IF Socket_handler = SysSocket_Interfaces.RTS_INVALID_HANDLE THEN iStep := 1; ELSE iStep := 2; END_IF 2: Bind_handler := SysSocket_Implementation.SysSockBind( hSocket:=Socket_handler, pSockAddr :=ADR(Socket_adress), diSockAddrSize:=SIZEOF(Socket_adress) ); 3: Listener_handler := SysSocket_Implementation.SysSockListen( hSocket :=Socket_handler, diMaxConnections :=1); END_CASE When I am trying to get this working, the SysSockBind function gives a value of 16#207 which means adress already in use. I find this weird because of the IP-adress of 0.0.0.0. I think I am converting the Ip-adress in the wrong way, but the code does not give a error arround this. So therefore I cannot find the solution to this problem. I hope someone could help me with this problem. Thanks in advance George
Last updated: 2025-02-20
Post by atcprojectteam on Modbus Function Code 15, writing multiple coils
CODESYS Forge
talk
(Post)
Hi all, I am using an RSTI-EP I/O card along with the EPXMBE101 Modbus/TCP network adapter. I have a Control Standard L license. I successfully connected to the I/O card via Modbus and can read inputs without any issues. However, when I try to write to the digital output modules using function code 15, I am unable to make any changes. Hereās what I have done so far: I created a small project using Structured Text. I set up Modbus channels (as shown in the attached image) and mapped the pins. When I use cyclic mode, the connection results in an error. However, when I use the rising edge, the connection works, but I donāt see any changes on the I/O card. For the output module, I assigned one bit to high. After that, I ran CODESYS Control Win V3. (Should I be running the PLC as well?) I built the program, but I am not receiving any response from the I/O card. Could you please advise on what might be causing this issue?
Last updated: 2025-02-26
Post by atcprojectteam on Modbus Function Code 15, writing multiple coils
CODESYS Forge
talk
(Post)
Hi all, I am using an RSTI-EP I/O card along with the EPXMBE101 Modbus/TCP network adapter. I have a Control Standard L license. I successfully connected to the I/O card via Modbus and can read inputs without any issues. However, when I try to write to the digital output modules using function code 15, I am unable to make any changes. Hereās what I have done so far: I created a small project using Structured Text. I set up Modbus channels (as shown in the attached image) and mapped the pins. When I use cyclic mode, the connection results in an error. However, when I use the rising edge, the connection works, but I donāt see any changes on the I/O card. For the output module, I assigned one bit to high. After that, I ran CODESYS Control Win V3. (Should I be running the PLC as well?) I built the program, but I am not receiving any response from the I/O card. Could you please advise on what might be causing this issue?
Last updated: 2025-02-26
Post by fabiodasilveira on PLC Shell commands via ST Code
CODESYS Forge
talk
(Post)
Hello Everybody, I have created a project for an Eaton XC303 that sends lots of data to a router via UDP. It works fine. However, when there is more than one product connected to the router, then it is necessary to change the IP address of the Ethernet port 0, from e.g. 192.168.2.11 to 192.168.2.12 (second product). It is easily done via PLC Shell (setipaddr 0 192.168.2.12), but the people in production is struggling with the PLC Shell commands and I would like to create a Visualization page that will hide that. I used the instruction: eChangeIPResult:= SysSockSetIPAddress(strEthernetPort, strIPAddress); and it works, until the PLC resets. I already read some posts and it appears that I need to stop the Ethernet 0 port and Reconfigure it, but I am really struggling to find the right way to do it. Any help will be much appreciated.
Last updated: 2025-02-28
Post by ojz0r on Assignment Efficiency - Repetitive Assignment vs IF statement
CODESYS Forge
talk
(Post)
Its important that you know the difference between the two. Example 1: Coils[0] := Coils[0] OR (Buttons[0] AND Sensors[0] > 6); In this case the statements will be evaluated every scan and result in either true or false for Coils[0]. Example 2: IF NOT Coils[0] AND Buttons[0] AND (Sensors[0] > 6) THEN Coils[0] := TRUE; END_IF In this example Coils[0] will latch the result in a true evaluation, if you want it to behave the same way as example 1 then you need to do it like example 3 below: IF NOT Coils[0] AND Buttons[0] AND (Sensors[0] > 6) THEN Coils[0] := TRUE; ELSE Coils[0] := FALSE; END_IF However back to the real question. There is no problem using either example 1 or example 3, if im not requiring a latch i usually go with example 1 as it is more compact.
Last updated: 2025-03-07
Post by egau on Enable and Disable Project IO programmatically
CODESYS Forge
talk
(Post)
Hi @eschwellinger, I tried this with Modbus COM slaves. I was able to disable them (slave becomes greyed out in the device tree), but the DED.Reconfigure "eError" output shows "NOT_SUPPORTED". After this, when I tried to re-enable the slave, it did not work (device stayed greyed out in the device tree), and the DED.Reconfigure "eError" output also showed "NOT_SUPPORTED". Is there something to do about this, or the device just doesn't support reconfiguration? P.S: I tried this running locally on my computer (not in simulation mode). So of course I was not physically connected to the devices. I have two similar projects, but one of them doesn't have the Modbus_COM devices. I know I can "Exclude from build" the devices for that project, but I would really prefer not to do this if possible. I would prefer to dynamically toggle a configuration variable that would enable or disable the slaves.
Last updated: 2025-03-14
Post by peterkcontrols on Codesys Network driver install for Codesys Control RTE x64
CODESYS Forge
talk
(Post)
Hello I am trying to download my project onto my Codesys Control RTE x64 soft PLC. and I have had an issue when downloading. [FATAL ERROR] Unresolved reference: 'SYSETHERNETADAPTEROPEN' [FATAL ERROR] Unresolved reference: 'SYSETHERNETADAPTERCLOSE' [FATAL ERROR] Unresolved reference: 'GETNUMBEROFADAPTERS' [FATAL ERROR] Unresolved reference: 'GETADAPTERINFO' [FATAL ERROR] Unresolved reference: 'SYSETHERNETIPFRAMERECEIVE' [FATAL ERROR] Unresolved reference: 'SYSETHERNETETHFRAMESEND' [FATAL ERROR] Unresolved reference: 'SYSETHERNETETHFRAMERECEIVE' [FATAL ERROR] Unresolved reference: 'SYSETHERNETIPFRAMESEND' [FATAL ERROR] Unresolved reference: 'SYSETHERNETFRAMERELEASE' Looking on the forum I have found other people had to install the network driver, which I have done following this youtube video by codesysGroup: https://youtu.be/10oj4wABaKc?si=664l83JXUGQSDlAe I have added the network driver, please see attached image. I have checked my BIOS to make sure my secure boot status is disabled, see attached image. when I go to component manager, the drop down menu doesnt have the new network adapter, see attached image. I have not yet purchased or installed any licenses is that what I am missing? What other reason is there that I can't download to the runtime. Thanks
Last updated: 2025-03-18
Post by pernockham on Persistence Manager: Config File not found?
CODESYS Forge
talk
(Post)
Back in november I paused this, but wanted to reattempt using the persistent manager, the behavior is still the same. Most "login attempts" s are stopped with the message "One or more errors occurred" but I have no idea what that error might be. The only clue is this message is presented while the lower left status box says "Generating code...: relocation pou". For clarification. Build/Generate code is successful, no errors. Error appears when I try to download/login (physical or simulation) to a device. I did manage to login (in simulation mode) at one point, but then the error message "PersistenceChannel: Config file not found!". And no persistence files were created. I have done device-tree/reset-orgin also clean/clean all etc. Removed/re-inserted persistance manager. Behaviour is just the same. Removing Persistence Manage and everything is working OK. Is there possibly more info somewhere about the "One or more errors occured"-message?
Last updated: 2025-03-20
Post by macman on Codesys 3.5 OPC UA Client to Kepware OPC UA Server
CODESYS Forge
talk
(Post)
Hi, I have problem with connecting Wago PLC WAGO 750-8212/0025-0002 configured as OPC UA client to Kepware OPC UA Server. I am using Codesys 3.5.19.70. What I did so far. To the Codesys project I added object Data Source Manager and configured connection OPC UA like below: pic 1 Then I can browse the OPC server tags in āVariablesā tab after prior trust on the server side of the client certificate created in the āCommunicationā tab: pic 2 Additionally second certificate has been created in Codesys for runtime process in āSecurity screenā as well as the server certificate was approved here: pic 3 But when I compiled project, downloaded it to PLC and go to RUN I canāt read selected in āVariablesā tab, OPC Server tags. I am getting such error (ID: 7001): pic 4 All two PLC certificates has been trusted in OPC server (Kepware) side: pic 5 and Kepware server configuration look like this: pic 6 I can easily connect using third party OPC UA client UaExpert to Kepware server without problem. In attachment I added also log from Kepware OPC UA server. pic # - this specifies the number of a concrete graphic from one of the collective in attachment
Last updated: 2025-04-02
Post by nz-dave on MC_HOMING
CODESYS Forge
talk
(Post)
Hi Just new to motion and i am building my own 3axis cnc cutter using servo drives. i have every thing working quite well apart from mc_home. when executed (r_trig) it stops immediately and i get fb_wasnt_called_during_motion. if i execute the mc_home fb with a toggle it just runs and runs for a while then errors out. what im unsure of is the way mc_home works. from what i understand it changes the drive mode to 6 (homing) and should then run of the drive homing settings. once origin sensor is made then homing would stop and mc_home.done is true. and the position on the fb is where i what the new home position (zero) to be? or do i feed mc_readposition to that input? so i would think its the settings in the drive that aren't quite right. but i believe they are all correct. has any one got any info to steer me in the right direction? Cheers
Last updated: 2025-04-04
Post by mondinmr on Unexpected behavior in cyclic encoder read method during INT overflow (wrap-around)
CODESYS Forge
talk
(Post)
Hi everyone, Iām investigating a potential issue with a cyclic method we use for reading incremental encoders in our libraries. Iāve come across two implementations that, at first glance, appear to perform the same operation: motionUnit.vlPositionActualValue is UINT due strange encoder type. Version A METHOD PROTECTED cyclicReadField VAR_INST actPosFieldOld: INT; rI: INT; delta: INT; END_VAR rI := TO_INT(motionUnit.vlPositionActualValue); delta := rI - actPosFieldOld; m_actPosRaw := m_actPosRaw + TO_LREAL(delta); actPosFieldOld := rI; IF settings.velocityFeebackMapped THEN m_actVelRaw := TO_LREAL(motionUnit.velocityActualValue); END_IF Version B METHOD PROTECTED cyclicReadField VAR_INST actPosFieldOld: INT; END_VAR m_actPosRaw := m_actPosRaw + TO_LREAL(TO_INT(motionUnit.vlPositionActualValue) - actPosFieldOld); actPosFieldOld := TO_INT(motionUnit.vlPositionActualValue); IF settings.velocityFeebackMapped THEN m_actVelRaw := TO_LREAL(motionUnit.velocityActualValue); END_IF Both use INT and the same delta logic, so they seem equivalent. However, when an overflow (wrap-around) occurs, version A continues correctly as expected, while version B unexpectedly resets to -32768 without a clear reason. Has anyone experienced similar behavior or can shed light on what might be happening here? It almost seems as if the cast to LREAL is being applied before the calculation ā but that would be illogical and potentially very dangerous in many situations! Thanks!
Last updated: 2025-05-13
Post by abuckie on i2c master not running
CODESYS Forge
talk
(Post)
Hello, I am trying to create an Ethernet/IP device that can read analog signals, do some basic logic on it and then hand communicate the results to an Ethernet/IP master. I am using the Raspberry Pi to experiment with this as I would ultimately like to drive a display as well. I have loaded up the runtime on the Pi and got the digital I/O working. I have an ADS1115 ADC to I2C board and I can't get it to work, I get a message telling me the i2c master is not running and I am not sure where to start with this. Is there a manual for running CODESYS on the Pi or something like that I am missing? I found this post and opening the project in CODESYS V3.5 SP21 it seems like tons of this wouldn't convert properly https://forge.codesys.com/forge/talk/Runtime/thread/f1400b71b6/ I have added in the library and device manually and copied the structured text program but lost at what to do if the core functionality of the master is not running. I appreciate any help, thanks.
Last updated: 2025-05-19
Post by kuegerls on Programmatically clearing or syncing Data Source Manager cache?
CODESYS Forge
talk
(Post)
Hi everyone, is there a way to programmatically clear the cache of the Data Source Manager in CODESYS so that variable values are re-synchronized from the OPC UA server (Symbol Configuration with OPCUA features)? Alternatively, is it possible to trigger a manual synchronization of data source variables from within the application code at runtime? Hereās the situation: A variable is first written by the OPC UA client to the server in one state of a state machine and changes to another state ā so the initial communication works. Later, the server changes the variable value, but the client does not receive or reflect the updated value, unless the variable is actively written again. Iām looking for a way to force the client (data source manager) to re-read or refresh the variable state from the server, possibly by clearing the internal cache or triggering a sync. Any ideas or suggestions would be greatly appreciated! Thanks!
Last updated: 2025-05-23
Post by shaunvdm on Canbus Slave SDO Read from Object
CODESYS Forge
talk
(Post)
Busy testing a solution to use Canbus Slave to replace a physical device and convert to Ethercat device but keep the Canbus Master in place. Master needs to Read SDO object 5FA2. In the Master PLC if i send the SDO with 8 bytes in message IE: 60B 40 A2 5F 00 00 00 00 00 i get my expected 58B 43 A2 5F 00 00 68 36 02 containing data back. Problem is if we issue a 4 byte command can send 60B 40 A2 5F. Surely the canbus slave should respond with a 58B 43 A2 5F 00 00 68 36 02 but it comes back as 80 A2 5F 00 00 00 00 08 - meaning this OBJECT does not exist. Is there a setting in the canbus slave driver for Canbus to allow the 4 byte command to read the SDO OBJECTS ?
Last updated: 2025-05-27
Post by laurits on Max lines of code, codesys CNC ?
CODESYS Forge
talk
(Post)
Hi, okay here's the project, it's a modified version of "CNC Example 10: Programming Dynamic CNC Paths", no need for G Code text file (i have also tried with G code text file, same problem) in "PROGRAM PLC_PRG" you can set bStart to true, and the program should start running, go to "PROGRAM CNC" and you can see axis moving. lrXpos := IoConfig_Globals.XAixs.fSetPosition; lrYpos := IoConfig_Globals.YAxis.fSetPosition; Now you can can change the number of movements in the the "PROGRAM PLC_PRG" From this number of movements in "program PLC_PRG" BUF : ARRAY[0..32010] OF SMC_GEOINFO; xp : ARRAY[1..32000] OF REAL; yp : ARRAY[1..32000] OF REAL; to this number to this number of movements BUF : ARRAY[0..132010] OF SMC_GEOINFO; xp : ARRAY[1..132000] OF REAL; yp : ARRAY[1..132000] OF REAL; Now if you start the program again you should see an error in the "sMC_Interpolator: SM3_CNC.SMC_Interpolator;" function block Let me know if you can not get it running.
Last updated: 2025-06-03
Post by sbhaskarla on WebVisu File Transfer Error
CODESYS Forge
talk
(Post)
Iām encountering an issue when downloading CSV files via the WebVisu button input config -> file-transfer option: ⢠Custom directory: /plcdata/csv_logs/filename.csv o Error: Error 4 ā Error during file transfer ⢠Sandbox directory: /var/opt/codesys/PlcLogic/plcdata/csv_logs/filename.csv o Result: Download succeeds without error. Actions taken so far: 1. Added /plcdata/csv_logs to codesyscontrol.cfg (see attached). 2. Enabled file-transfer services in codesyscontrol_user.cfg (see attached). 3. Confirmed that the PLC writes CSV files correctly to /plcdata/csv_logs/. Despite these settings, WebVisu still returns Error when accessing the custom path 1. Using the placeholder file path '$$CSVLOGS$$/filename.csv' and it returns Error 6. 2. Using the literal path /plcdata/csv_logs/filename.csv and it returns Error 4 Could someone please help me determine what additional configuration or troubleshooting steps are required to serve files from /plcdata/csv_logs/? Please find screenshots attached for better understanding and I have also attached the config files
Last updated: 2025-06-13
Post by acc00 on Redundancy Codesys Runtime, Synchronization
CODESYS Forge
talk
(Post)
Hi, Iām currently testing the Codesys Redundancy application with 2 Raspberry Pi, with the idea is of using in my project 2 Wago PFC200 and 1 Ethercat Master with 2 Remote IO. After I configure the redundancy, and one Pi is Active and the other is Passive, if I disconnect the Ethernet cable of the Active, the Passive become Standalone, which is good, but the problem is the following: -When I recover the Ethernet connection, both stay Standalone. They will NOT Sync until I do it manually in the Codesys environment. How to make the synchronization automatically? -If both Pi/PLC stays Standalone, who is managing the IO? (Ethercat and Serial) I have done a test with an Modbus Slave, where I am sending a counter that increase every second. And I see that when both PLC are standalone, they both keep an active connection with the Slave, and both write values. This does not seem good, since according to this in my project both PLC would try to control the IO at the same time. Note: The Codesys have an option (greyed out, not possible to select) which says āAuto Syncā. What is the purpose, and why Iām not able to select it? I'm using Codesys Control for Rapsberry Pi 64SL Runtime in my test environment (2xRaspberry Pi 4), with the idea of using Codesys Control PFC 200 Runtime in my project (2xWago PFC200 and 1 Ethercat Master with 2x Wago 750-354 Ethercat Fieldbus Coupler). Using the last Codesys 3.5 version (SP19 PAtch 5). I'd appreciate a lot any help on this questions!
Last updated: 2024-01-22
Post by micik on Using Codesys example problems
CODESYS Forge
talk
(Post)
Hello to all, I'm totally new to Codesys, but I do have some PLC programming experience, mosty with Siemens TIA and STEP7. I have just installed Codesys 3.5. sp19 and I have downloaded example with Ethernet Rockwell 1734AENT. The example can be found here: https://forge.codesys.com/prj/codesys-example/rockwell-1734-c/home/Home/ After opening, I had to manually update devices (Device, Ethernet, IP Scanner, EthernetIP adapter). However, when trying to build the project, I get the following errors: [WARNING] CODESYS_EtherNetIP_Rockwell1734AENT: Library Manager [Device: PLC Logic: Application]: C0100: Library System_VisuElemXYChart has not been added to the Library Manager, or no valid license could be found [WARNING] CODESYS_EtherNetIP_Rockwell1734AENT: Library Manager [Device: PLC Logic: Application]: C0100: Library system_visuinputs has not been added to the Library Manager, or no valid license could be found [ERROR] iodrvethernetip, 4.4.1.0 (3s - smart software solutions gmbh): ServiceCycle [IoDrvEtherNetIP]: C0040: Function 'ProcessUpdateConfigurationQueue' requires exactly '1' inputs [ERROR] iodrvethernetip, 4.4.1.0 (3s - smart software solutions gmbh): IoDrvStartBusCycle [IoDrvEtherNetIP]: C0040: Function 'GenerateRandomUINT' requires exactly '2' inputs [ERROR] iodrvethernetip, 4.4.1.0 (3s - smart software solutions gmbh): Cyclic [GenericServiceUnConnected]: C0040: Function 'GenerateRandomUINT' requires exactly '2' inputs [ERROR] cip object, 4.4.1.0 (3s - smart software solutions gmbh): ForwardOpenService [ConnectionManager]: C0040: Function 'GetAssemblies' requires exactly '3' inputs [ERROR] iodrvethernetipadapter, 4.4.0.0 (3s - smart software solutions gmbh): ServiceCycle [IoDrvEtherNetIPAdapter]: C0040: Function 'GenerateRandomUINT' requires exactly '2' inputs [ERROR] iodrvethernetip, 4.4.1.0 (3s - smart software solutions gmbh): SetupStructuredIOMapping [RemoteAdapter]: C0040: Function 'MallocData' requires exactly '1' inputs [ERROR] iodrvethernetip, 4.4.1.0 (3s - smart software solutions gmbh): SetupStructuredIOMapping [RemoteAdapter]: C0040: Function 'MallocData' requires exactly '1' inputs Compile complete -- 7 errors, 13 warnings Build complete -- 7 errors, 13 warnings : no download possible! What could be the reason for this errors and how to rectify them? Thank you!
Last updated: 2024-02-01
Post by mp9876 on Device logon problem following fresh install
CODESYS Forge
talk
(Post)
All screenshots are enclosed in MS Word document. NOTE; 4 questions features at the end. Any assistance would be greatly appreciated! Hi everyone, I am still having device logon problem following a fresh install Here are the STEPS I went through following a FRESH CODESYS Win 64 3.5.19.60 install on a different computer. āGateway not configured properlyā when attempting to REFRESH from the Users and Groups. Then did Gateway manage and confirmed it was ok: This message popped out as it was a fresh install: YES then: Initially went with Administrator twice (user & password) but it did not like it. No device is responding to ā¦: Continued by setting a new user Pressed OK and obtained the following message: Stopped and Restarted PLC at that point: Obtained the following: Attempted to login a 2nd time without success. Then I scanned the network to see if matching device can be detected: Only way to get it detected was to remove the tick in the āHide non-matching devicesā¦ā Attempted a WINK but got a return like this one: REFRESH either @ Users and Groups or @ Access Rights returns: Then created user āmpā at Project level ang logged in: Understandably device user mp9876 was not valid for the Project. Device information A few questions comes to my mind following these connection attempts: 1- Gateway not configured properly message pops out because of a non-compatible device ? 2- Why would the device not be compatible ? 3- Any way to make the device compatible ? 4- Any ideas on how to get this connectivity problem to the device solved ?
Last updated: 2024-03-17
Post by duvanmoreno24 on Modbus writing on value change
CODESYS Forge
talk
(Post)
Hi all, I want to know if someone has an idea of how I can write on value change in Modbus Codesys. I have a Wago PLC and I was used to work with E-cockpit which it was quite easy to do that without the necessity to trigger any value when there was a change in the variable ( I will put how easy is ). how you can see just changing the trigger in "On value Change" will do that channel writing automatically when It detects a change in those arrays. On the other hand, in Codesys if I enable the rising edge in Codesys It ask me to put a bool variable and if triggers is going to write that value. That is making me that I have to create a function or a logic to detect the change, the problem I have is that doing that is very tedious. I first approach I got it was to create a Function who returns a bool when the value change, but I tried to keep the old value but what is happening is that in Functions all the data is erased every cycle so I can not keep any Old value. so in the Main program the trigger is going to be TRUE all the time due, the old value is cero every cycle. The second approach I got it was using a function Block (POU_1) and it works but I dont want to instance that function for every Channel or value that I want to check if the value change, Basically if I have 200 values to write trhough modbus I have to create 200 instances of that function which I think it is not practicall at all. It should be a better way to implement this as e-Cockpit from Wago Does. However, I haven't been able to know how.
Last updated: 2024-03-26
Post by wildcard on Modbus Client Request Not Processed
CODESYS Forge
talk
(Post)
Hi, does anyone has a solution for this issue. I've the same problem. I've implemented a very simple client based on the Modbus Examples and connected the soft PLC to a Modbus Simulator. PROGRAM ModbusClient VAR initDone : BOOL := FALSE; errorID : ModbusFB.Error; client : ModbusFB.ClientTCP; timeout : UDINT := 500000; replyTimeout : UDINT := 200000; aUINT : ARRAY [0..8] OF UINT; clientRequestReadHoldingRegisters : ModbusFB.ClientRequestReadHoldingRegisters; clientRequestsCnt : UINT := 0; clientRequestsProcessCnt : UINT := 0; ipAddress : ARRAY[0..3] OF BYTE := [10,54,0,72]; END_VAR IF NOT initDone THEN initDone := TRUE; client(aIPaddr:=ipAddress, udiLogOptions:=ModbusFB.LoggingOptions.All); client(xConnect:=TRUE, ); clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout); clientRequestReadHoldingRegisters.xExecute := TRUE; clientRequestsCnt := 0; END_IF clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout, xExecute := TRUE); IF clientRequestReadHoldingRegisters.xError THEN clientRequestsCnt := clientRequestsCnt +1 ; errorID := clientRequestReadHoldingRegisters.eErrorID; END_IF clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout, xExecute := NOT clientRequestReadHoldingRegisters.xExecute); When the system is running I do get the following on the logs: 2024-05-13T10:18:07.443Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= Client.RequestProcessed ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2070 state=Error 2024-05-13T10:18:07.443Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2070 change state Error -> None timestamp=63843421226 2024-05-13T10:18:08.444Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2071 change state None -> Init timestamp=63844421420 2024-05-13T10:18:09.444Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2071 change state Init -> Error timestamp=63845421675 But the errorID is jumping between OK and RequestNotProcessed. Any help is very appreciated which gives me a hint what I'm doing wrong. Thanks
Last updated: 2024-05-13
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
.