Post by hanoues on setting date and time on CPX-E
CODESYS Forge
talk
(Post)
Hello, Can anybody here tell me how to modify the time and date on my CPX-E? I used the code I found on CODESYS online help, but it doesn't work. What am I missing? FUNCTION current_date_time : STRING VAR stUTC_Timestamp : SysTime; //utc time // ULINT#1528280694913 stLocal_TimeStamp : SysTime; //local time but is in general equal // ULINT#1528280694913 stdNow : SysTimeDate; //local time in an object to access each number (day, month...) dtNow : DATE_AND_TIME;//DT#2018-6-6-10:24:54 todNow : TIME_OF_DAY; // TOD#10:24:54.913 datNow : DATE; // D#2018-6-6 END_VAR SysTimeRtcHighResGet(stUTC_Timestamp); // ULINT#1528273494913 SysTimeRtcConvertHighResToLocal(stUTC_Timestamp, stdNow); //convert UTC ULINT to Local SysTime // stdNow.wYear = UINT#2018 // stdNow.wMonth = UINT#6 // stdNowy.wDay = UINT#6 // stdNow.wHour = UINT#10 // stdNow.wMinute = UINT#24 // stdNow.wSecond = UINT#54 // stdNow.wMilliseconds = UINT#913 // stdNow.wDayOfWeek = UINT#3 // stdNow.wYday = UINT#157 SysTimeRtcConvertDateToHighRes(stdNow, stLocal_TimeStamp); // ULINT#1528280694913 dtNow := TO_DT(stLocal_TimeStamp / 1000 ( ms )); // DT#2018-6-6-10:24:54 todNow := TO_TOD(stLocal_TimeStamp MOD TO_ULINT(T#1D)); // TOD#10:24:54.913 datNow := TO_DATE(dtNow); // D#2018-6-6 (convert to appropriate string) current_date_time := concat('$N[', TO_STRING(dtNow)); current_date_time:= concat(current_date_time,'.'); current_date_time:= concat(current_date_time, TO_STRING(stdNow.wMilliseconds)); current_date_time:= concat(current_date_time,'] - '); RETURN;
Last updated: 2024-05-21
Post by mubeta on Some 'pathetic' errors in SoftMotion program
CODESYS Forge
talk
(Post)
Hello everyone, I have a very simple program for the process, but it's driving me crazy and I can't see the problems I'm left with: Short topological description: Dual Core Berghof controller with softmotion runtime version 3.5.19.30; Two axes with servodrive on canopen bus, clocked distributed from master; Ethercat I/O node; 2 ms ethercat task, 2 ms canopen bus cycle time; I/O objects of the canopen master and canopen drives connected to the ethercat task cycle; Problem 1: Two separate programs each manage their own axis and drive, with separate state machines. A first axis moves primarily in velocity, except having to position itself absolutely at a predetermined point at the end of the job; the second axis, on the other hand, is a paper unwinder that changes, for each job cycle, from actions in absolute, relative, and cam displacement with the master axis. Well, the state machine of both axes was written in such a way as to call running the useful FB and change it on state change in this way: CASE i_stateMachine OF 0: o_Power(Enable := TRUE, bRegulatorOn := FALSE, bDriveStart := FALSE, Axis := o_PaperUnwinderAxis); o_MoveAbs(Execute := FALSE, Axis := o_PaperUnwinderAxis); o_MoveRel(Execute := FALSE, Axis := o_PaperUnwinderAxis); o_CamSelect(Execute := FALSE, Master := o_MachineAxis, Slave := o_PaperUnwinderAxis, CamTable := cam_PaperUnwinder); o_CamIn(Execute := FALSE, Master := MachineEncoder, Slave := o_PaperUnwinderAxis); o_CamOut(Execute := FALSE, Slave := o_PaperUnwinderAxis); o_SetPosition(Execute := FALSE, Axis := o_PaperUnwinderAxis); IF ... THEN i_StateMachine := 10; END_IF; 10: o_Power( Enable := TRUE, bRegulatorOn := TRUE, bDriveStart := TRUE, Axis := o_PaperUnwinderAxis ); IF o_Power.Status THEN i_StateMachine := 20; END_IF; 20: (* Avanzamento carta *) o_MoveAbs( Execute := TRUE, Position := o_Somewhere, Velocity := 25.0, Acceleration := 3666.7, Deceleration := 3666.7, Jerk := 48000.0, Direction := MC_DIRECTION.positive, Axis := o_PaperUnwinderAxis ); IF o_MoveAbs.Done THEN o_MoveAbs(Execute := FALSE, Axis := o_PaperUnwinderAxis); i_StateMachine := 30; END_IF 30: d_HomingPosition := ...; o_SetPosition( Execute := TRUE, Position := d_HomingPosition, Mode := FALSE, Axis := o_PaperUnwinderAxis ); (* ... *) IF o_SetPosition.Done = TRUE THEN o_SetPosition(Execute := FALSE, Axis := o_PaperUnwinderAxis ); o_LogServer.Append(sMessage := '...', lscClass := LOGSERVER_CLASS.ALWAYS, sdt := o_CommonsMgrData.systime.sdtLocal); i_StateMachine := 40; END_IF; 50: ... The code above is a sketchy example of what I wanted to write. But it gives me a spot problem: in some, the state change results in a drive error, which is unrecoverable except with a reinitialization via SM3_ReinitDrive(). Things are improved a little if in the program I always run the call of all softmotion blocks in this way: o_Power(Axis := o_PaperUnwinderAxis); o_Jog(Axis := o_PaperUnwinderAxis); o_Halt(Axis := o_PaperUnwinderAxis); o_MoveAbs(Axis := o_PaperUnwinderAxis); o_MoveRel(Axis := o_PaperUnwinderAxis); o_CamIn(Master := MachineEncoder, Slave := o_PaperUnwinderAxis); o_CamOut(Slave := o_PaperUnwinderAxis); If I don't execute all the calls of all the motion FBs used, when exchanging machine state often (but not always), the axis goes into error with event id THE_FB_WASNT_CALL... Done a little diagnostics it seems that the FBs return the bDone, before they are completely terminated. I tried doing the machine state exchange not with the bDone bit of the FBs, but with the 'standstill' state of the axis. It didn't seem to change anything. Problem 2: During the use SM3_ReinitDrive() I get the erro in the log: "NetID 0: SDO read error for object 16#607C..." Assuming that the device involved it's one of the two servodrive, (no others device are present in the network), I don't found any object 0x607C in the 'possible object list in/out' of the two drive, and I don't understand where this object can be listed. So any ideas and suggestions regarding these two issues will be very, very welcome. If you need the source project, I am willing to send it.
Last updated: 2024-07-17
Post by spiessli on Softmotion axis to CANopen Maxon IDX drive
CODESYS Forge
talk
(Post)
Hi, I want to use Maxon IDX drives for some simple robotic applications. I have used Maxon's Epos for generating a DCF file to import in Codesys (attached). Then I can add the IDX motors under a CANopen manager in the device tree. Unfortunately, I cannot add a "softmotion axis" to the IDX motors. Now I am wondering, why? Without being able to attach a softmotion axis to the device in the device tree, the use of the motor is greatly reduced... spiessli
Last updated: 2024-01-05
Post by janderson on Ethercat scan for devices not picking up EL7041 as a softmotion axis
CODESYS Forge
talk
(Post)
also my ethercat bus won't run.
Last updated: 2023-09-02
Post by tk096 on Axis_Ref_SM3.perfTimers
CODESYS Forge
talk
(Post)
Hi, these variables are internal members of the axis. They measure the duration of some internal function calls.
Last updated: 2023-11-23
Post by tk096 on Pointer to Softmotion axis
CODESYS Forge
talk
(Post)
Hi, you can take a look at https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_global_init_slot.html Maybe it helps.
Last updated: 2023-11-23
Post by eschwellinger on Hydraulic Axis Controller
CODESYS Forge
talk
(Post)
I would check this example: "c:\Program Files\CODESYS 3.5.19.X\CODESYS\CODESYS SoftMotion\Examples\Tutorial\PosControl.project"
Last updated: 2023-12-09
Post by eschwellinger on Softmotion axis to CANopen Maxon IDX drive
CODESYS Forge
talk
(Post)
I would try to use the EDS file of the maxon drive.
Last updated: 2024-01-06
Post by kumareasu on Hydraulic Axis Controller
CODESYS Forge
talk
(Post)
Hope I need to softmotion package ( https://store.codesys.com/en/codesys-softmotion-axes-4.html ) for this. Please confirm.
Last updated: 2024-02-23
Post by spiessli on Softmotion axis to CANopen Maxon IDX drive
CODESYS Forge
talk
(Post)
Just verified the behaviour. Still is the same. It should be attached here. But I also tried the DCF-file with the axis in the lab with the real drive: The MC_Power block never goes out of busy. Had not time to investigate further, though.
Last updated: 2024-01-08
Post by florian on Stepper Drive with Ethercat
CODESYS Forge
talk
(Post)
Codesys has a motion libraries (SoftMotion), but you need to buy a licence keys for them to work. the most basic one is SoftMotionLight. you just have to select your drive in the device view and add a SoftMotionLight CiA402 axis. then the library is added to your project. You can use the SML_* motion FBs and configure the axis now.
Last updated: 2024-03-22
Post by installwhat on Tripod rotary coordinate is not correct with right hand rule
CODESYS Forge
talk
(Post)
https://www.instructables.com/Work-Coordinate-System/ https://www.researchgate.net/figure/The-WCS-Axis-follows-the-Right-Hand-Rule-Left-Where-the-Z-Axis-Points-Towards-the_fig1_288835535#:~:text=Hwa%20Jen%20Yap-,The%20WCS%20Axis%20follows%20the%20Right%20Hand%20Rule%20(Left)%20Where,tool%20relative%20to%20the%20WCS. https://help.autodesk.com/view/ACDMAC/2025/ENU/?guid=GUID-02A08BCD-B4E5-4068-9932-810EF3049218
Last updated: 2024-06-23
Post by tk096 on gear over gear (2 masters,1 slave) - how to do it?
CODESYS Forge
talk
(Post)
Hi, you could calculate the position/dynamics of the slave axis yourself and use one of the function blocks SMC_FollowPosition/SMC_FollowSetValues to move the slave axis. https://content.helpme-codesys.com/en/libs/SM3_Basic/Current/SM3_Basic/POUs/Movement/Direct/SMC_FollowPosition.html https://content.helpme-codesys.com/en/libs/SM3_Basic/Current/SM3_Basic/POUs/Movement/Direct/SMC_FollowSetValues.html
Last updated: 2024-08-19
Post by axilleas on SMC_Interpolator + SMC_controAxislbyPos
CODESYS Forge
talk
(Post)
dear all I am working on a very generic gantry system (virtual drives + win v3 control) reading gcode from external file. In order to stop the interpolator function from running when gaps are detected, SMC_controlAxisByPos FB has the bStopIpo output which according to the manual is connected to the Interpolator's bEmergencyStop. Lets assume that the axis are parked in position X1000 Y1000 and the initial G code movement is G00 X500 Y500. The normal behavior is to travel from the actual x1000 y1000 to G00 X500 Y500. The SMC_Interpolator always gets the X0 Y0 as the initial position, meaning that the bStopIpo is active until the axis are in X0 Y0 and the release the interpolator to set the new positions to X500 Y500. Is there a suggested method to solve this behavior? bonus question: I get a lot of bStopIpo during standard interpolation movements (not gaps). While working with virtual axis this is not a problem but when real axis are installed this will be an issue. What exactly triggers the bStopIpo output? Slow axis accelerations compare to Gcode defaults? Kind Regards
Last updated: 2024-02-05
Post by naccio on very long time building the relationship table
CODESYS Forge
talk
(Post)
I have the same problem withv codesys 3.5 sp 16 patch 6. Any idea ? Thank you Marco
Last updated: 2024-01-22
Post by yann2021 on Errors by Code Generate
CODESYS Forge
talk
(Post)
Hello, I updated to Patch 6 and can now build without any errors! Thanks!
Last updated: 2024-02-18
Post by jonasz on Discontinuity of A/B/C axis movement.
CODESYS Forge
talk
(Post)
Hi, My problem was related to the behavior of the modulo axis, but maybe you will find something useful from what I write. The solution lies in path processing. Codesys offers a G-code analysis tool. Insert a CNC object into the project. The CNC settings object will be added automatically. By inserting appropriate processing modules into the CNC settings object and parameterizing them, you can test the behavior of the axis. When the effect is satisfactory, remember to add the module from CNC settings in the correct order in the processing path. Each CNC machine case is different. You need to spend some time to get your design tailored like an Armani suit. Good luck.
Last updated: 2024-05-09
Post by esave on Stepper Drive with Ethercat
CODESYS Forge
talk
(Post)
I bought and installed SoftMotion Light now. When I try to add a SoftMotion Light Axis to my stepper drive and I go online it shows: "The license is missing or invalid". See picture What am I doing wrong? This is the right way right? First add your EtherCat XML-File from your stepper driver and then add the SoftMotion Light axis right? Thanks for your help esave
Last updated: 2024-04-25
Post by gseidel on Discontinuity of A/B/C axis movement.
CODESYS Forge
talk
(Post)
Hi jonasz, you already solved it, I'm answering here for the sake of others with a similar question. You can provide the slope of the A/B/C axis with the U/V/W word. See example 3 here: https://content.helpme-codesys.com/en/CODESYS%20SoftMotion/_sm_cnc_din66025_additional_axis.html If you don't want to change the G-Code, the function block SMC_RecomputeABCSlopes can compute the slopes automatically. https://content.helpme-codesys.com/en/libs/SM3_CNC/Current/SM_CNC_POUs/SoftMotion-CNC/SoftMotion-Function-Blocks/SMC_RecomputeABCSlopes.html Best regards, Georg
Last updated: 2024-04-30
Post by schweizer on Position und GrΓΆΓe optimal anpassen (Container.Height - Visu.Height) funktioniert nicht.
CODESYS Forge
talk
(Post)
Hello forum Does anyone have experience with optimally adjusting the position and size of the visualization elements? For us, the adjustment on the x-axis works in Codesys 3.5 SP20 with (Container.Width - Visu.Width). However, the y-axis is not affected with (Container.Height - Visu.Height). We implemented this according to the example from Codesys "Optimally adjust position and size" and had no success. Thank you very much for your help.
Last updated: 2024-07-29
Post by trusty-squire on implementing continuous movement in Codesys
CODESYS Forge
talk
(Post)
What do you mean by continuous movement? You want to continuously follow a dynamic target position? SMC_ControlAxisByPos, which is typically used with CNC Interpolators, could work for that. Instead of feeding the target position in from the Interpolator, feed in the target position from your server instead. Once you enable the FB, it will continuously move the axis to track the fSetPosition input. https://content.helpme-codesys.com/en/libs/SM3_CNC/Current/SM_CNC_POUs/SoftMotion-CNC/Direct-Axis-Control/SMC_ControlAxisByPos.html
Last updated: 2024-09-12
Post by eschwellinger on Ethercat scan for devices not picking up EL7041 as a softmotion axis
CODESYS Forge
talk
(Post)
Add existing version (with SM drive) - without scan - disable under expert settings in the slave the revision check.
Last updated: 2023-09-03
Post by arnog on Master&Slave Program in 4 Axis CNC Project
CODESYS Forge
talk
(Post)
I am also looking for the right solution. Also saw a virtual axes would be better to steer x1 and x2
Last updated: 2023-10-01
Post by imdatatas on Axis variable indicating modulo of finite setting
CODESYS Forge
talk
(Post)
You could try with "iMovementType" member of AXIS_REF_SM3 struct. https://content.helpme-codesys.com/en/libs/SM3_Basic/Current/SM3_Basic/DriveInterface/AXIS_REF/AXIS_REF_SM3.html https://content.helpme-codesys.com/en/libs/SM3_Basic/Current/SM3_Basic/DataTypes/DriveInterface/SMC_AXIS_TYPE.html
Last updated: 2023-11-25
Post by naidureginald on creating a visualization table
CODESYS Forge
talk
(Post)
hi all im trying to create a visualisation table for a axis alarms list. upon entering the data array, i recieve a message as attached. any help would be much appreciated.
Last updated: 2024-01-03
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
.