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 davidbo on RPI can system operation like rm in a shell have an impact on a Task cycle time
CODESYS Forge
talk
(Post)
I have noticed that a rm file1.txt command on a shell has an impact on the cycle time for a TASK writing to file2.txt. Seen in the Monitor fane of the Task configuration Furthermore if a TASK makes a system call like rm, its cycle time increases of course but it seems to have an invisible impact on other TASKs too. I have a TASK for handling communication over the CANbus (SPI) where it stops sending "Heartbeats" for many seconds when another TASK does a system rm. Why is that not seen on the Monitor fane? Is even codesyscontrol paused when system calls are made? The CPU load is about 30-40%
Last updated: 2024-09-23
Post by alex-at-xana on EThercat Dynamic configuration
CODESYS Forge
talk
(Post)
Ah - forgot another question as it may be related to the PLL problem: I am executing a 4ms cycle. I do not call (from what I know) the Ethercat_MAster periodically in my program. The bus cycle task is set to the Ethercat task. I would assume that the master should send 250 frames per second. Yet, the status of the master says it transmits 500 frames per second which would indicate that the master is called twice. Any ideas there?
Last updated: 2024-09-10
Post by derpaul on Official MQTT-Client: MAX_RECEIVE_BUFFER_SIZE_EXCEEDED
CODESYS Forge
talk
(Post)
That doesn't help at all: ---- plcload PLC load average: 20% CoreID: 0 --------------------------- PLC Core load: 20% And in taskconfiguration it says that the cycle time is about 5000us with MQTT enabled FBs and about 2800us whitout
Last updated: 2023-09-27
Post by trycyclepower on Only single ehternet ip drive is communicating
CODESYS Forge
talk
(Post)
Hi all, I have two ethernet IP drives not communicating together. If I disable one, then other one starts working. ENIPScnannerIOTak cycle is setup as 20ms. Also, PLC updating variables setting is on.
Last updated: 2024-03-08
Post by tk096 on High Cycle Times for SoftMotion_PlanningTask when using AxisGroup
CODESYS Forge
talk
(Post)
Hi, you need a realtime capable plc. Codesys Control WinV3 is not realtime capable. https://content.helpme-codesys.com/en/CODESYS%20Control/_rtsl_performance_optimization_linux.html The last chapter of https://content.helpme-codesys.com/en/CODESYS%20SoftMotion/_sm_robotics_diagnosis_movement_problems.html deals with how to configure the planning task.
Last updated: 2024-03-13
Post by rmaas on Strange Behavior on Raspberry Pi
CODESYS Forge
talk
(Post)
Hello, what you are seeing is not strange behavior. The problem is that everyting is happening in the same program cycle. After the variable Stepnumber is changed from 10 to 20 for example then you want the program to wait with the next EQ until the next program cycle. Else every EQ will be be true because in every line the variable Stepnumber is increased. When the program arrives (still in the same cycle) at the line with the timer, the Stepnumber has been increased to 30 in the meantime and the timer will allway be ON because even though the variable is written to 10 in this line in the next cycle it starts with 10 and will be 30 again before reaching the timer in line 8. Not very good at explaining stuff but i hope you get the problem. See screenshot below for an example of one way you could solve this...
Last updated: 2024-06-18
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 alex-at-xana on EThercat Dynamic configuration
CODESYS Forge
talk
(Post)
BTW - I had a chat with a Beckhoff support engineer. He explained that if you use sync0 and sync1, two frames per cycle are expected.
Last updated: 2024-09-19
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 andrej on Threads and TID created by CODESYSControl Win V3
CODESYS Forge
talk
(Post)
Hi all, for a deeper understanding of the Codesys RTE - I created a simple application with 3 IEC tasks (Ta,Tb,Tc) each with different priorities, and different cycle times. The application runs on Windows 10 in the Soft PLC CODESYS Control Win V3. If my understanding is correct, the RTE i.e. the Process CodesysControlService should spawn 3 threads (Th_a,Th_b,Th_c) which are executed with the defined cycle times, the priority of the threads should reflect the priority of the task set in the Codesys IDE. Does somebody have an idea, how I could identify the respective threads in Windows? Kind regards Andrej
Last updated: 2023-10-02
Post by i-campbell on Official MQTT-Client: MAX_RECEIVE_BUFFER_SIZE_EXCEEDED
CODESYS Forge
talk
(Post)
I can't answer why it's not resetting, but from the description of g_udiMaxReceiveBufferSize, I would guess the sum of sizes of the mqtt packets received in one cycle exceeded this value. So the answer may be to increase that parameter. https://content.helpme-codesys.com/en/libs/MQTT%20Client%20SL/Current/MQTT-Client/Common/Params/MQTTParam.html https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_dlg_library_parameter.html
Last updated: 2023-09-26
Post by reinier-geers on SysFileOpen does not work after update to V3.5 SP19 Patch 5
CODESYS Forge
talk
(Post)
At 19.1 the hFile_test should be RTS_IEC_HANDLE and always open-write - close in one cycle udi_handle: RTS_IEC_HANDLE; //handle-number. Is created by SysFileOpen udi_handle:=SysFileOpen(sFileName,Sysfile.AM_WRITE_PLUS, ADR(udi_ErrorCode)); udi_RetValWrite:=SysFileWrite(udi_handle, pRemBuffer, szRemBufSize, ADR(udi_ErrorCode)); //closing file IF udi_RetValWrite < szRemBufSize THEN ui_Error:=cWriteError; END_IF//error writing data udi_ErrorCode_Close:=SysFileClose(udi_handle);
Last updated: 2024-02-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 manuknecht on High Cycle Times for SoftMotion_PlanningTask when using AxisGroup
CODESYS Forge
talk
(Post)
Hi, thanks a lot for the response. I did check all these parameters, but if the PlanningTask takes up to 60 ms, I can't increase the Buffer to such values. I contacted the Codesys support with a projectarchive. Let's see if they can help. Thanks again for your great support!
Last updated: 2024-03-22
Post by trusty-squire on Confused by dwIpoTime input for SMC_Interpolator
CODESYS Forge
talk
(Post)
OK, that makes sense. Because the FB is provided a specific interval period, it would change the target position accordingly based on the time it "thought" elapsed. If it has the wrong interval provided, it updates the target positions every cycle incorrectly so the axes will end up moving faster or slower. Thanks!
Last updated: 2024-07-22
Post by sturmghost on Visualization using methods and cyclic ST-calls
CODESYS Forge
talk
(Post)
Im looking for a way to implement ST-code into the visualization element without creating a helper POU or method in my device/application tree. Like visualization properties are evaluated at each VISU_TASK cycle I want to be able to create own ST code which interacts with the visualization interface variables. To be more specific I want to have a property which executes user defined ST-code at each VISU_TASK cycle exactly like its already possible for Input Configuration on various mouse and dialog events. Also a property for initialization (so only executed once) and a timed property would be nice. With the situation right now I'll have to create a POU function which handles the ST-code and misuse a property, like the text variable, to execute this POU function at each VISU_TASK cycle. Or does it exist and I don't know it?
Last updated: 2023-10-02
Post by tk096 on Some 'pathetic' errors in SoftMotion program
CODESYS Forge
talk
(Post)
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). In general: - Motion function blocks have to be called until they report 'Done', 'Error', 'CommandAborted' or a subsequent motion FB with BufferMode=Aborting is started in the current cycle. - Setting the Execute input to FALSE will not abort any ongoing motion of the motion function block. 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. I think the error SMC_FB_WASNT_CALLED_DURING_MOTION is only a follow-up (and misleading) error that results from the axis not being in operational state anymore (bus problems). Is there an error 'regulator or start not set' in the device log before the error 'motion generating FB wasn't called for at least one cycle'? Which error does the respective function block (Halt.ErrorId) report?
Last updated: 2024-07-22
Post by wehling-h on PI Input value
CODESYS Forge
talk
(Post)
Hi geoweil, have you tried to save changed values to remanent area or using a VAR RETAIN? After restart you have to initialize Counter with last remanent value. Depending on changes per cycle and the possibilitiy of your control unit to write remanent storage. Otherwise you need a buffering system to ensure save backup of last PI_Counter value. May you could read this Thread to get further help: https://forge.codesys.com/forge/talk/Engineering/thread/31e1c8349e/#bf48
Last updated: 2024-01-12
Post by sturmghost on Visualization using methods and cyclic ST-calls
CODESYS Forge
talk
(Post)
I found a way to do it: You can use, for example, the text variable property of any visualization element and call a function in it. Example: Write a test POU as a function (FUN), like MyTestFun which need a boolean Variable as an input value. Now write into the text variable property: MyTestFun(bBooleanValue) Thats it. The function is called at each visu_task cycle.
Last updated: 2024-01-22
Post by tk096 on Fieldbus has lost synchronicity
CODESYS Forge
talk
(Post)
Hi, a few suggestions on how to tackle the problem: - it might help to increase the cycle time of the ethercat task - increase the value of the ethercat parameter DCInSyncWindow (https://content.helpme-codesys.com/en/libs/IODrvEtherCATDriver/Current/pou-IoDrvEtherCAT/DCInSyncWindow.html) (see attached image) - enable FrameAtTaskStart (https://content.helpme-codesys.com/en/libs/IODrvEtherCATDriver/Current/pou-IoDrvEtherCAT/FrameAtTaskStart.html) in the ethercat master (see attached image) - if the drives can handle the synchronization problems, checking of the synchronization can be deactivated using SMC_Set_ETC_DCSyncSupervision (https://content.helpme-codesys.com/en/libs/SM3_Drive_ETC/Current/SMC_Set_ETC_DCSyncSupervision.html).
Last updated: 2024-04-11
Post by installwhat on Initialization of POUs (FB_Init)
CODESYS Forge
talk
(Post)
Hi I was wondering if there's a pattern I can employ to acheive what you're doing but with a "reference to" and also allowing for online changes? Someone told me that the new beckhoff keeps references safe during online changes but all the documentation I've found suggests that's not the case. The easiest thing is to use fb_init for normal vars and pointers and references can be added in the function body every cycle and this allows for method calls after so far as I can tell.
Last updated: 2024-07-29
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)
CODESYS Control for Raspberry Pi MC SL v4.4.0.0 CANopen_Manager 4.2.0.0 I did not call rm directly from my TASK-i2c, it was trough the attached python script. It is not always a problem happens, but sometimes a rm takes a long time. I reduced the amount of calls to logi2c.py but I don't understand why TASK-i2c sometimes can cause problems for TASK-CAN
Last updated: 2024-09-27
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)
CODESYS Control for Raspberry Pi MC SL v4.4.0.0 CANopen_Manager 4.2.0.0 I did not call rm directly from my TASK-i2c, it was trough the attached python script. It is not always a problem happens, but sometimes a rm takes a long time. I reduced the amount of calls to logi2c.py but I don't understand why TASK-i2c sometimes can cause problems for TASK-CAN
Last updated: 2024-09-27
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
.