Post by tk096 on Confused by dwIpoTime input for SMC_Interpolator
CODESYS Forge
talk
(Post)
Hi, dwIpoTime should be set to the cycle time of your motion task. It defines the interpolation interval of the interpolator. E.g. in the attached screenshot, the task has a task interval of 4ms. The dwIpoTime input of the interpolator should be set to 4000.
Last updated: 2024-07-22
Post by mmpl on Array to String
CODESYS Forge
talk
(Post)
Hi Thank you for you reply. Yes I can concatenat longer string. I am using string_Util_Intern libraray for concat. The issue is abot plc performance. It takes 7 second. I am looking to improve time.
Last updated: 2024-07-23
Post by murdemon on CNC Jumps G20 - SMC_NCInterpreter and long time to process
CODESYS Forge
talk
(Post)
N10 G01 X100 Y100 F100 N20 G00 X300 Y100 F100 N30 G00 X300 Y300 F100 N40 G00 X100 Y300 F100 N50 G00 X100 Y100 F100 + $R1$ N60 G75 N70 G20 L10 N100 M30
Last updated: 2024-08-03
Post by murdemon on CNC Jumps G20 - SMC_NCInterpreter and long time to process
CODESYS Forge
talk
(Post)
Best way.. in CNC program before G20 jump, set G75. And for fbCheckVel execute if fbInterpreter.bWorking AND fbInterpreter.bLastObjectWasAdministrative; and same for Interpolator. " ..... dumm := fbInterpreter.bWorking AND fbInterpreter.bLastObjectWasAdministrative; //Check velociteses. fbCheckVel(bExecute := (fbInterpreter.bDone or) dumm, bAbort := gCNC.bCycleStop, poqDataIn := fbInterpreter.poqDataOut); "
Last updated: 2024-08-03
Post by dkugler on Calculate Time Between Two Events Using RTC
CODESYS Forge
talk
(Post)
a few seconds later with google search... https://stackoverflow.com/a/61986234 SYS_TIME is definitely an ABB AC500 specific function, included in library SysInt_AC500_V10.lib.
Last updated: 2024-08-14
Post by joelwright24 on codesys sp20 opcua not working
CODESYS Forge
talk
(Post)
I also had this problem connected CODESYS to UAExpert for the first time. In the device, I need to allow anonyomous log in. Follow steps 14 - 17 of the following tutorial: https://docs.factoryio.com/tutorials/codesys/setting-up/codesys-opc-ua-sp17/#creating-the-project
Last updated: 2024-09-11
Post by davidbo on RPI can system operation like rm in a shell have an impact on a Task cycle time
CODESYS Forge
talk
(Post)
3.5 18 SP2 I think the control is 4.2.0.0. I am not in the office before on Wednesday.
Last updated: 2024-09-23
Post by albertocamina on Login problem with FileTransfer on Raspberry Pi 5
CODESYS Forge
talk
(Post)
Dear @eschwellinger, I have been testing for some time and still i cannot find a sollution for this one. Any hint? Many thanks!:)
Last updated: 2024-09-24
Post by dangjoris on Missing function for ConfigGetParameterValueBool (SM3RaspiStepper)
CODESYS Forge
talk
(Post)
Hello, I've been trying to get the SM3RaspiStepper application working for a long time, but the function block with the function ConfigGetParameterValueBool and ConfigGetParameterValueLReal is always missing. Does anyone know how I can get them? I also added a screenshot.
Last updated: 2024-09-30
Post by totorovic on Hard shutdown: no code on device after power on
CODESYS Forge
talk
(Post)
I think that the .err file is the .app file renamed by Codesys, so it is compiled. We met this behaviour one time, it was because the runtime goes in exception due to bad Ethercat cables.
Last updated: 2024-10-03
Post by mainak on OPC UA C# client connecting to OPC UA CODESYS server
CODESYS Forge
talk
(Post)
it could be due to security settings. In codesys IDE, go to device-> change run-time security policy, and click the checkbox that says "Allow anonymous login". try if this works.
Last updated: 2024-10-19
Post by tk096 on High Cycle Times for SoftMotion_PlanningTask when using AxisGroup
CODESYS Forge
talk
(Post)
Hi, under this circumstances the performance of a Raspberry Pi 4 should be sufficient to run a Softmotion robotics application. A closer look at the project would be required. Maybe you could contact the codesys support? Usually it is recommended to run the planning task cyclically every 2ms with task priority of 0 on a dedicated core. In the task configuration you can have a look at the average and maximum execution time of the planning task. You could use the function block SMC_TuneCPKernel (https://content.helpme-codesys.com/en/libs/SM3_Robotics/Current/SM3_Robotics/POUs/AdministrativeConfiguration/Computation/SMC_TuneCPKernel.html) to define suitable values for the parameters 'fSyncBufferDuration' and 'fPlanningInterval'. However, as previously mentioned, the performance of a Raspberry Pi 4 with realtime patch should be sufficient. The 'fPlanningInterval' parameter specifies the maximum planning step width in seconds. The cycle time of the planning task should not permanently exceed this value. A higher value reduces the computational effort, but can lead to a violation or no full utilization of the set limit values for velocity, acceleration and jerk. From a starting value of 0.016 seconds, the value should be increased gradually until the performance is acceptable. The parameter 'fSyncBufferDuration' specifies the size (in seconds) of the buffer between the planning and fieldbus task. The cycle time of the planning task must not exceed this value at peak times (this will lead to the error SMC_CP_QUEUE_UNDERRUN). A higher value can compensate for peaks in the cycle time of the planning task. At the same time, however, this also increases the latency for executing interrupts and aborting movements.
Last updated: 2024-03-22
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 ewi04 on Recipe Manager - RecipeManCommands, load & write wrong values, Bug?
CODESYS Forge
talk
(Post)
Hallo, I have a strange problem with the recipe manager. ISSUE: When using RecipeManCommands not all values are loaded correctly. Saving a recipe with CreateRecipe(), ReadAndSaveRecipe() or ReadAndSaveRecipeAs() works without any problems. BUT: LoadRecipe(), WriteRecipe() or LoadFromAndWriteRecipe() do not load the data correctly. It is Interesting that we have a different error pattern with LoadRecipe() than with WriteRecipe() or LoadFromAndWriteRecipe(). LoadRecipe() does not load all data and WriteRecipe() or LoadFromAndWriteRecipe() overwrites some data or assigns it incorrectly. And it is also strange that LoadRecipe() writes the values to the PLC. Normally it doesnβt do it. It makes no difference whether the memory type is textual or binary. I have an object consisting of STRUCTs which is inserted in the recipe definition. Environment: Codesys V3.5 SP19 Patch 4 (64Bit), Recipe Management 4.2.0.0 *Add a project (reduced to the problem)
Last updated: 2023-11-15
Post by alexgooi on Function Blocks and arrays of function blocks
CODESYS Forge
talk
(Post)
Hi Jack, I think you have to look at a FB in a different way. A Function block (Class) can contain its own data. In other words don't define loose data in your GVL, but define a instance of a FB (Object) in your GVL: Example: Function_Block Basic_Class VAR_INPUT Open_Command: BOOL; END_VAR VAR_OUTPUT Opened: BOOL; END_VAR if Open_Command then Opened := TRUE; ELSE Opened := FALSE; END_IF Global Variables Objects: ARRAY[1..100] OF Basic_Class; //Here you ar defining you objects END_VAR In your code you can directly acces the data and couple it to the IO: GVL.Objects[1].Open_Command := %IX0.0; %QX0.0 := GVL.Objects[1].Opened; //To call the code itself use: GVL.Objects[1](); If you want to take this a step further you are also able to add methods and properties to the FB/Class end thereby creating a OOIP program
Last updated: 2024-02-15
Post by dhumphries on Not able to see input data coming from eip adapter on codesys
CODESYS Forge
talk
(Post)
Does the device have a green icon next to it when the PLC is running? If not you have some kind of communication problem, wireshark may be picking up some data but the scanner may not be configured correctly to receive the data. Check the T>O and O>T bytes and make sure they match on both the scanner and adapter. I've had very little success loading a .eds file and having the configuration work without some manual configuration. If you have a green icon, have you enabled the device to always update variables?
Last updated: 2024-03-02
Post by kazuhiro on Problems using MySql Library and SysProcessExecuteCommand2 together
CODESYS Forge
talk
(Post)
I use fbMsSQL_compact(FUN) of the MySQL Library to write data to the database. There is no problem when writing data using only fbMsSQL_compact(FUN). However, when I try to write data obtained using SysProcessExecuteCommand2 to the database using fbMsSQL_compact(FUN), an error message "Dest server on ip address:xxx.xxx.xxx.xxx and port:1433 is unreachable" appears and writing is not possible. From what I have researched, it seems that writing is not completed in one cycle of fbMsSQL_compact(FUN), and when SysProcessExecuteCommand2 is executed first in the second cycle, the work done in one cycle of fbMsSQL_compact(FUN) is reset. Could you please give me some advice?
Last updated: 2024-06-18
Post by kazuhiro on Problems using MySql Library and SysProcessExecuteCommand2 together
CODESYS Forge
talk
(Post)
I use fbMsSQL_compact(FUN) of the MySQL Library to write data to the database. There is no problem when writing data using only fbMsSQL_compact(FUN). However, when I try to write data obtained using SysProcessExecuteCommand2 to the database using fbMsSQL_compact(FUN), an error message "Dest server on ip address:xxx.xxx.xxx.xxx and port:1433 is unreachable" appears and writing is not possible. From what I have researched, it seems that writing is not completed in one cycle of fbMsSQL_compact(FUN), and when SysProcessExecuteCommand2 is executed first in the second cycle, the work done in one cycle of fbMsSQL_compact(FUN) is reset. Could you please give me some advice?
Last updated: 2024-06-18
Post by hazarath on How extract JSONElement containing Array data
CODESYS Forge
talk
(Post)
I want to extract each element of an Array. Can someone help me with this. When I use JSONElementToString (part of JSON Utilities SL), I am seeing output as "ARRAY" instead of actual data. Here is the JSON content that I want to read : { "value1Unit": { "units": "M" }, "data": { "stepSize": 300.23, "points": [6,8] } } I would like to read each item of the element "points" i.e. 6 and 8. Here is the code I used, // Reading the content as JSON reader ( xExecute := execute , pwData := ADR ( converted_value ), jsonData := jsonDataStorage ); // Get the JSON Element jsonDataStorage.FindFirstValueByKey( wsKey := fidKeyVar, diStartIndex := searchElem, jsonElement => jsonElement ); JSON.JSONElementToString ( element := jsonElement , wsResult := valueWstring ); The content of the output of valueWstring is shown as "ARRAY" instead of the array items i.e. 6 and 8 Please can someone help me.
Last updated: 2024-07-30
Post by damian177 on Problem with downloading OPC UA tags by Data Source Manager
CODESYS Forge
talk
(Post)
Hi, In Codesys V3.5 SP20, using Data Source Manager I am trying to connect to the OPC UA server and receive tags from it. The connection is ok, but the Codesys have a problem with downloading Tags group. The window (downloadingTags.jpg in attachement) never stop. After waiting for a while, I disconnect the connection and only the Server group remains downloaded, with OPC UA server diagnostic data (and this is read in Codesys). Of course, I tried connected via another OPC UA client : UaExpert , and everything works as it should, all tags are downloaded (Uaexpert.jpg screen). Has anyone on the forum encountered the OPC UA client configuration in Codesys? Is it possible to manually request the appropriate tags from the OPC server for reading in Codesys?
Last updated: 2024-09-03
Post by shabroz-gill on Exception when OPCUA datasource disconnects from Server
CODESYS Forge
talk
(Post)
If i loose the network and the opcua data source suddenly looses connection with the server, i get an exception and my application stops working. I am using the latest version of the communication add v4.5.2.0 Is this a known issue? This makes the datasource unusable because it is inevitable that we will loose connectivity at some point, and the datasource crashing everything due to that seems to be a deal breaker. I can provide more details is someone from codesys is reading this. You can recreate is by just shutting off the Opc server after the codesys data source is connected and reading data from it. The codesys app does not crash everytime and sometimes it is able to reconnect without crashing, so you may have to try this a few times to see the exception. Best regards
Last updated: 2024-09-16
Post by taqamert on CANopen PDO Issue with Pressure Sensor in Codesys
CODESYS Forge
talk
(Post)
Hello everyone, I am using an IFM CR0303 model PLC, which has a tilt sensor and a pressure sensor connected via CANopen. Both sensors are from the same brand (ATEK). I can read data from the tilt sensor without any issues, but I am unable to read data from the pressure sensor. I have added the EDS file in the PLC configuration and adjusted the node-ID settings. When I check with the PCAN-View application, I can see that the selected PDOs are coming through, but the data is not reaching the Codesys side. What could be the issue, and what can I try to resolve it? Can anyone help me?
Last updated: 2024-10-22
Post by ahuckphin on Issues with Modbus Slave with Raspberry Pi
CODESYS Forge
talk
(Post)
I have a DFRobot RS485 temperature & humidity sensor (SEN0438) connected to my Raspberry Pi via a USB to RS485 adapter. I am able to connect and read the sensor data when running a python code locally. However in Codesys, I encounter this error "A bus error has occurred." and "There was no response in time". Could this be because of Modbus Server Channel and Modbus Server Init configuration on my part? Admittedly I am new to Codesys. To get to this stage, I: 1. added some lines to CODESYSControl_User.cfg 2. added "Modbus_COM" in Codesys and set "Serial Port Configuration" under "General" 3. added "Modbus_Master_COM_Port" in Codesys and checked transmission mode is set to "RTU" 4. added "Modbus_Slave_COM_Port" in Codesys and checked server address is set to 1 (also set 1 in my sensor) 5. added 1 channel and 1 init for "Modbus_Slave_COM_Port" under "Modbus Server Channel" and "Modbus Server Init"
Last updated: 2024-07-10
Post by ruobian on Analog Input Delay Timer
CODESYS Forge
talk
(Post)
Hello there, I am new here and in programming. I need help with the basics. I am trying to do what I mentioned in the title. I have an analog input. So I have a real or integer data type value. I want to delay it. TON and TOF only work with bool. I think there is a function block that has two inputs, 1 for real or int and 1 for bool. And if bool is true, it will give the output as real or int. I don't know but I need something like this. Actually, it is not exactly like that. In other words, it will not show the real value at the input at the output after a certain period of time. I want it to show the real value from 2 seconds ago continuously. The purpose of doing this is to compare the real value I received with the value from 2 seconds ago and find out whether it went up or down. I am using only FBD. Please help me with this. Thanks in advance.
Last updated: 2024-08-20
Post by bruceae on Ethernet/IP Scan
CODESYS Forge
talk
(Post)
Hello, I have a robot configured as a Generic Ethernet Module under Ethernet/IP Scanner. I can not see the change of state of the outputs coming from the robot on the codesys side in real-time. (The robot has it's own internal program that would changes the values of remote outputs 0-3 off and on). Also when I send data down to the inputs of the robot it doesn't transfer over as expected. As an example I'll send to the robot's input bit 0 a value of 1. It doesn't see that value change. However, when I write that input bit 0 back to a value of 0, the robot changes state and shows a value of 1. And if I change the state of a different bit, the other bits update properly, except for the bit that I changed. Any advice would be greatly appreciated, and if anything else is needed let me know.
Last updated: 2024-09-10
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
.