Search talk: FREE DOWNLOAD CODESYS

 
<< < 1 .. 793 794 795 796 797 .. 799 > >> (Page 795 of 799)

Post by dwpessoa on CNC Jumps G20 - SMC_NCInterpreter and long time to process CODESYS Forge talk (Post)
I am studying and developing a Softmotion+CNC system for a machine that executes multiple pieces. The G code program is written by the machine operator and each cycle execute 1 piece. The programs are large, exceeding 1000 lines and using up to 8 axes (X, Y, Z, A, B, C, P and Q). The machine needs to run cyclically, executing N pieces (selected by the Operator)... so I tested it using Looping and counters (G36 G37 and G20) and it worked, but it takes a long time to process, and the more pieces I need, the longer the processing time and this is totally impracticable. I found this solution which was very good, and for a few cycles it works well, but for 99999 pieces of a program with 1000 lines, it doesn't work very well... Another solution I tested is to maintain the interpolator with an automatic restart, that is, I load the program without looping (without G20) and give it another start as soon as it finishes. This partially resolved it, but there is still a delay in processing SMC_NCInterpreter in each restart :(. Another solution I thought of is to manually create the SMC_GEOINFO structure and then reuse it, avoinding the Interpreter, but reading the documentation and checking the structure filled by standard blocks, I noticed that there doesn't seem to be a "JUMP" function in the structure! In other words, the SMC_NCInterpreter actually keeps copying and copying the program section for each jump (G20)... If I repeat a 10-line program 1000 times, I will have a structure with more than 10000 lines... possibly this is the cause of take so long to process. Has anyone ever had a problem like this? I believe the same thing happens with typical applications with manipulator robots using Codesys in continuous cycles, and I would like to know if there is any solution, or even if I am misinterpreting the G20 question in SMC_GEOINFO. Thanks!
Last updated: 2023-09-20

Post by ofey on EtherCAT fieldbus CODESYS Forge talk (Post)
Hi, everyone! I'm trying to set up a PLC controller and a connection to an EtherCAT slave device in Codesys. I want to create a flexible program that I can upload to multiple controllers with different remote IO connected (same program). On one plant i may have 5 AI-cards and 3 DO-cards, and on another I may have 4 AI-cards and 2 DO-cards. For not needing to maintain several different programs wih different devices defined in the program (one for each set up) I thought that using a remote IO would make it easier having a single program. That way I could refer to different memory addresses instead of predefined slots/channels and IO's, that would give me errors if there was a different IO on the plant than what the program expected. When I tried setting up the etherCAT master, I saw that I had to define the etherCAT slave devices with the different IO'cards for me to be able to refer to the memory addresses in a PRG. Exactly what I was trying to avoid. My setup is something like a program that can handle 16 separate pump controls. In a year maybe 6 plans get deployed, and depending on how large the project is, the number of pumps can vary between 4 and 16. And the managers dont want to have IO's for all 16 pumps on every cabinet, and I dont want to maintain 16 separate projects files in case of updates etc. I thought the best way to tackle this was having a single project that read/write data to the different pump IO's by remote IO (fieldbus ethercat) addresses. And the number of pump controls are activated by an external GUI. If pump 1-6 is activated by the GUI, then the PLC-program tries to read/write input/outputs from predefined addresses for the expected IO's. My test setup is a PFC200 WAGO controller and a EtherCAT fieldbus coupler (750-354) with some IO. I hope I didn't explain this too horrible, and if there is a more easy and elegant solution for this challenge I appreciate a feedback on this.
Last updated: 2024-04-08

Post by gustavocsw on MQTT memory leak problem CODESYS Forge talk (Post)
Hello everyone, I'm using the IoT Library to implement the MQTT communication with my local broker server in order to publish and subscribe at specifics topics to share and consume information about my application. But, it seems that are occurring some memory leak problem in a "high" frequency (more than 10 Hz) subscribe process. I follow the same method as in IoT Lib exemples, and at first looks perfect but my PLC was rebooting frequently and when I check its memory usage that was increasing as fast as the subscribe massage was sent. I'm using a WEG PLC410 and a WEG PLC500, and this error occurred in both of them (including in CODESYS Control Win x64). The application sends to the system a message JSON with the float payload Ex. {"data" : 0.8500}, but this happens with a INT, or BOL as well. I use the follow code in my application to find the value: //FindFirstValueByKey VARs PROGRAM JSON_VELO VAR //------Setting the JSON Subscriber to Set the Relay Value jsonDataVelo : JSON.JSONData; jsonByteArrayReaderVelo : JSON.JSONByteArrayReader; xST1okVelo : BOOL; FindFirstValueByKeyVelo : JSON.FindFirstValueByKey; jsonElementVelo : JSON.JSONElement; xDoneReaderVelo : BOOL; xDoneFindVelo : BOOL; //STRING and WSTRING for Subscribe the massage sPayloadJsonVelo : STRING := 'opa'; psPayloadJsonVelo : POINTER TO BYTE := ADR(sPayloadJsonVelo); //wsPayloadJsonRelaySet : WSTRING := "opa"; wsPayloadJsonVelo : WSTRING := STRING_TO_WSTRING('opa'); pwsPayloadJsonVelo : POINTER TO WORD := ADR(wsPayloadJsonVelo); lrVelo : LREAL; xKeepAliveVelo : BOOL; xSetVelo : BOOL; RSSet : RS; LIMPAR : STRING; //Find the msg end sFindVelo : STRING := '}'; psFindVelo : POINTER TO STRING := ADR(sFindVelo); iLenVelo : INT; iSizeVelo : INT := 12; udiContMsg : UDINT; END_VAR // FindFirstValueByKey CODE // Relay Set configuration xSetVelo := MQTT_SUBSCRIBER.RSVelo.Q1; IF xSetVelo THEN xKeepAliveVelo := TRUE; END_IF IF xKeepAliveVelo THEN udiContMsg := udiContMsg + 1; iLenVelo := TO_INT(StrLenA(psPayloadJsonVelo)); iSizeVelo := iLenVelo - TO_INT(MQTT_SUBSCRIBER.udiPayloadSizeVelo); StrDeleteA(psPayloadJsonVelo,iSizeVelo,iLenVelo); wsPayloadJsonVelo := STRING_TO_WSTRING(sPayloadJsonVelo); pwsPayloadJsonVelo := ADR(wsPayloadJsonVelo); //MQTT.ConvertUTF8toUTF16(sourceStart:= ADR(sPayloadJsonVelo), targetStart:= ADR(wsPayloadJsonVelo), dwTargetBufferSize:= TAM, bStrictConversion:= 1); //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := TRUE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := xDoneReaderVelo, wsKey := "data", diStartIndex:= 0, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); IF xDoneFindVelo THEN lrVelo := jsonElementVelo.value.lrValue; //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := FALSE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := FALSE, wsKey := "data", diStartIndex:= 1, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); xKeepAliveVelo := FALSE; GVL.xSetVeloRead := TRUE; END_IF END_IF And this to subscribe at the topic: //SUBSCRIBE VAR: //----------------- Subscribe Velocity ----------------------- MQTTSubscribeVelo : MQTT.MQTTSubscribe;//Variable MQTTSubscriber block -X - function-X wsTopicSubscribeVelo : WSTRING(1024) := "CORE/odometry/GET/data/simp"; // Topic to publish a message sSubscribeMassageVelo : STRING; udiPayloadSizeVelo : UDINT; xSDoneVelo : BOOL; xSErrorVelo : BOOL; xReceiveVelo : BOOL; eSTypeVelo : MQTT.MQTT_ERROR; eSMQTTErrorVelo : MQTT.MQTT_ERROR; RSVelo : RS; udiCont : UDINT; //SUBSCRIBE CODE: MQTTSubscribeVelo( xEnable:= MQTT_CLIENT.xConnection_Broker AND NOT xSErrorVelo AND NOT JSON_VELO.xKeepAliveVelo, pbPayload:= JSON_VELO.psPayloadJsonVelo, udiMaxPayloadSize:= SIZEOF(JSON_VELO.sPayloadJsonVelo), udiPayloadSize => udiPayloadSizeVelo, mqttClient:= MQTT_CLIENT.ClientMQTT, wsTopicFilter:=wsTopicSubscribeVelo, xDone => xSDoneVelo, xError=> xSErrorVelo, xReceived => xReceiveVelo, eMQTTError=> eSMQTTErrorVelo ); RSVelo(SET := xReceiveVelo, RESET1 := JSON_VELO.xKeepAliveVelo);
Last updated: 2024-09-09

Post by imdatatas on MC_CamIn did not work properly with SMC_FreeEncoder on SoftMotion 4.17.0.0 CODESYS Forge talk (Post)
Hello, I am facing a problem with the new Softmotion 4.17.0.0 version. Has anyone encountered a similar problem, what is the solution? I would be happy if you could share it. Problem description: -- "SMC_FreeEncoder" encoder axis is the master, -- The motor of the servo driver on the EtherCAT bus is the slave axis. -- When the MC_CamIn block executed, the InSync output is activated. However, although the master encoder axis position value changes, there is no movement in the slave servo axis! Test steps: 1-) EtherCAT servo axis installed, configured and motion test was performed with MC_Jog. No problem. 2-) Softmotion general axis pool > SMC_FreeEncoder was added and pulse amount configuration was performed. No problem. 3-) Incremental encoder actual count value was transferred to the "SMC_FreeEncoder.diEncoderPosition" variable as DINT under the ethercat task in every cycle and the encoder axis position value was observed. No problem. 4-) A simple CAM table with a 1:1 ratio was created under the project tree. (For example: Simply, when the encoder rotates 1 turn, the motor will rotate 1 turn.) 5-) The SMC_FreeEncoder axis enabled with MC_Power and brought to the StandStill state. 6-) The MC_CamTableSelect block was run with default input values ​​(all absolute) and only the Cam table name was specified. The Done output was seen successfully. No problem. 7-) The MC_CamIn block was activated with default input values ​​(absolute) and only the master encoder axis name, slave servo axis name, CamTableID input pins was specified and then "Execute" input set to TRUE. 8-) The InSync output information of the MC_CamIn block observed as TRUE. However, although the encoder axis value changed, the position value of the slave axis did not change at all, it did not move. It always remained at 0.0mm. 9-) When I repeated the same steps above, only changing the master axis to SM_Drive_Virtual instead of FreeEncoder and gave movement to the virtual axis, this time the slave axis moved successfully. However, when the same steps and operations are performed with the same IDE just downgrade SoftMotion version from 4.17.0.0 to 4.10.0.0, everything works normally and without problems as expected in MC_CamIn block with FreeEncoder master. (By the way, The used IDE version is Codesys V3.5 SP20patch3.) Best Regards Imdat
Last updated: 4 days ago

Post by shooxplc on How to call the same program from library and get the vars updated. CODESYS Forge talk (Post)
Hi, I am writing to you today because I would like to create a library that would contain a program with its various subprograms, in my example "PLC_PRG" with "a", "aa", "aaa". But once the library is created as shown below: I would like to be able to drag and drop my folder as many times as I want (let's say I manage the same system multiple times). Once the drag and drop is done, we can see the second folder with the variables renamed successfully. As shown below: But my variables in CAD_1 remain the same as for CAD, so it's PLC_PRG instead of PLC_PRG_1, for example. Is there a solution to automate this? I wouldn't want to have to rename all my variables manually, considering that in the program where I want to do this, the number of variables is substantial. Lucas.
Last updated: 2023-08-23

Post by garyl on Comments in arrays and assigning RST coil's to 600 outputs CODESYS Forge talk (Post)
Hello all, im working on a project that requires me to convert an old automation direct DirectSoft PLC d2-250-1. One of the problems im encountering is that all of the comments are attached to members of the different addresses. When i convert the addresses (1777 "C" registers, 777 X registers, and 20,0000 V registers) im running into difficulties keeping the inputs/outputs correct since they are missing documentation. Is there a good way to retain the comments of the indexes in the array? Secondly, initially i was declaring the "C" and "V" addresses individually and this worked to retain the comments as to which register did what, however i ran into a problem when one rung reset (or set to 0) approximately 600 C Addresses. Since each tag is separately declared this proved to be nearly impossible without a literal wall of code that attempted to crash the program. So i converted all of the registers (C,X,Y,V) into separate structs, declared them as arrays and pointed all of the original call outs in the program to the newly defined structs. However i have now lost comments and the program is very hard to follow. Thanks for any help with this issue.
Last updated: 2023-08-31

Post by timvh on Detect "Cancel" Press in FileOpenSave Dialog CODESYS Forge talk (Post)
Maybe there is a better way, but a long time ago I created a test application that worked like this: With a button I opened the dialog and I added a "Input configuration - OnDialogClosed" "Execute ST-Code" action to this same button which called the following Function when the dialog was closed: F_OnFileDialogClosed(pClientData); Below this Function which handled the result: // This function is called from the visualization when the dialog is closed. FUNCTION F_OnFileDialogClosed : BOOL VAR_INPUT pClientData : POINTER TO VisuElems.VisuStructClientData; END_VAR VAR dialogMan : VisuElems.IDialogManager; FileOpenCloseDialog : VisuElems.IVisualisationDialog; result : VisuElems.Visu_DialogResult; _sFileName : STRING(255); END_VAR // 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 // Original code gvlFile.FileListProvider(); _sFileName := CONCAT(gvlFile.FileListProvider._stDirectory, gvlFile.FileListProvider.stFile); // do something with this file name... END_IF END_IF END_IF
Last updated: 2023-09-19

Post by sturmghost on Initialization of visualization variables and cyclic code execution CODESYS Forge talk (Post)
I'm looking for a smart and short way to implement initialization of visualization variables depending on the visualization input. For an easy example consider a rectangle which rests at XPos := 0 when the input state is false and at XPos := 50 when the input state is true. My visualization variables look like this: VAR_IN_OUT State : BOOL; END_VAR VAR XPos : INT; END_VAR I put this rectangle via a visualization frame element into another visualization and link a frame reference variable with the state to it. If the variable is true, the rectangle should rest at XPos := 50 and false at XPos := 0 at visualization init but how should I assign the 50 or 0 to the internal visualization variable XPos? I would need some init-methode for the visualization but I dont want a global init-method for such tasks. I want to do it inside of the visualization element but I can't see any solution for this? It would be good to be able to define ST-code within the visualization element which runs cyclic at each VISU_TASK task-cycle then I could just check the input state and change the XPos accordingly. Does someone have a solution?
Last updated: 2023-10-01

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 ryusoup on JSONByteArrayWriter problem? CODESYS Forge talk (Post)
Hello, I am trying to implement a FB to make JSON formatted WSTRING type message using JSON Utilities 1.9.0.0 included in the IIoT library. In my case, I want to set some objects or arrays and set values to them later. But when I wrote as the sample below, // init builder builder(pJsonData:=pJsonData, diRootObj=>diRootObj); // set the 1st key to root diKey1 := builder.SetKeyWithArray(wsKey:="key1", diParentIndex:=diRootObj, eError=>eError); // set a value to the 1st key wsValue:="value01"; builder.SetValue(Value:=wsValue, diParentIndex:=diKey1, eError=>eError); // set the 2nd key to root diKey2 := builder.SetKeyWithArray(wsKey:="key2", diParentIndex:=diRootObj, eError=>eError); // set a value to the 2nd key wsValue:="value02"; builder.SetValue(Value:=wsValue, diParentIndex:=diKey2, eError=>eError); // set a value to the 1st key again wsValue:="value03"; builder.SetValue(Value:=wsValue, diParentIndex:=diKey1, eError=>eError); // set a value to the 2nd key again wsValue:="value04"; builder.SetValue(Value:=wsValue, diParentIndex:=diKey2, eError=>eError); // write build result writer(xExecute:=TRUE, pwData:=ADR(wsResult), udiSize:=SIZEOF(wsResult), xAsyncMode:=FALSE, jsonData:=pJsonData^); the result was: { "key1": ["value01"], "key2": ["value02", "value03", "value04"] } while my expection was: { "key1": ["value01", "value03"], "key2": ["value02", "value04"] } Inspecting pJsonData^, JSONData itself seems to be ok, so I believe the issue is something caused by the writer FB. Does anyone know how to fix it? Thanks,
Last updated: 2023-10-04

Post by manuknecht on Persistence Manager does not save alphabetically first value CODESYS Forge talk (Post)
I have several libraries which contain values that should be saved on a PLC. As apparently no Persistent Variable List is available within Libraries, I use the Persistence Manager to create a Persistence Channel in the Project which imports the library. I then specify the persistence channel in the library using the {attribute 'ac_persist':='PersistenceChannel_CT'} specifier. This generally works very well and gives me exactly the properties I require. However, it came to my attention that the (alphabetially) first value from the library is not saved in the created ASCII file. When checking the content of the Persistence Channel, it shows all the variables as defined in the library. But the created file does not contain the first value and it is not restored after restart or reset. (see attached picture) I disabled Periodic Saving and set xSaveOnChange to TRUE and so the file usually updates immediately after changing one of the values. When changing the first value, it does not update which is consistent with this value not being saved. I also created a sample project and library from scratch which shows the same issue both using a Raspberry Pi and using a Linux machine. Does someone know what the reason for this could be or did someone make similar experiences? Looking forward to hearing your suggestions. Thanks in advance and best wishes Manuel
Last updated: 2023-10-17

Post by manuknecht on Persistence Manager does not save alphabetically first value CODESYS Forge talk (Post)
After some more digging I realized that I get an error on the PLC Logger saying PersistenceChannel: 150 (invalid type in data: SimpleLibrary). I suppose the issue could be found in the ConfigData, which is automatically generated and which looks like this: 1 9##83 SimpleLibrary#GVL.aMoreZeros.[1]#0#64512#15#0 <[2]#0#64520#15#0 <[3]#0#64528#15#0 <[4]#0#64536#15#0 <#0#64544#15#0 <[6]#0#64552#15#0 <<lrVar#0#64560#15#0 <strVar#0#64428#16#80 <uiDummy#0#64370#11#0 Perhaps the fact that the variable is stored within a library confused the compiler? I tried changing the PersistenceChannel parameters to xCompressTags := FALSE which changed the entry in the data file from _xCompressTags BOOL:TRUE _xCompressTags BOOL:FALSE but the actual content of the data file and also the config data did not change.
Last updated: 2023-10-17

Post by andrej on Write to File on soft PLC winV3x64 CODESYS Forge talk (Post)
Hello all, I would like to store some data in text file. I use the soft PLC Win V3x64, on Windows 10. I use the SysFile Library 3.5.17.0. If I store the file directly in the in the directory of the PLC i.e. in '/CODESYSControlWinV3x64/E1FA7ABE/PlcLogic/LogAU.txt' the file is correctly filled with the data. However, If I use an absolute path to a different directory no data is stored in the respective file. Despite the fact that the respective file exists and the Filehandler is correctly opened (see in picture _fdSysFHandle <> -1). // sFileName : STRING := 'LogAU.txt'; // STORES FILE IN ../CODESYSControlWinV3x64/../PlcLogic/LogAU.txt' sFileName : STRING := 'C/Temp/LogAU.txt'// DOES NOT WORK --------------------- // FILE DESCRIPTOR _fdSysFHandle := SysFile.SysFileOpen( szFile:= sFileName,am:= SysFile.AM_APPEND,pResult := ADR(_Result)); Does some have an idea where the problem is, resp. how I can get store a file in an arbitrary directory. Thanks a lot and kind regards Andreas
Last updated: 2023-10-24

Post by vassilis91 on EtherCat-Rexroth Drive lost connection or no? CODESYS Forge talk (Post)
Hi all, i am encounter a mystery problem with a build with rexroth drives at my work. At my company we are make a machine with two Rexroth Indradrives . The two drives are goes by ethercat protocol . To be more specific i am going from my plc to the Beckoff El1100 coupler and after to the first drive and from the first drive to the second. The second drive works with no problem but the first(motor) sometimes without any pattern start to make a mysterious noise like stop and suddenly goes on again. If i couldn't hear the noise from the motor i couldn't Imagine that this happen. After a lot of research i see that sometime i have some strange zeros from the drive to the plc? Really i am in a deadlock and I don't know how to continue. From the other side the values on the other drive(second)are stable . The problem maybe: https://youtube.com/shorts/g7PCFLUaDUI?si=eiq0F2IzhQZax2e2
Last updated: 2023-10-25

Post by riccardo on VisuElems.CurrentUserGroupId is not stable CODESYS Forge talk (Post)
GoodMorning everyone. I have a system that, in case of alarm, have to block. When the operator logs in must have to acknoledge the alarm and should operate in the system freely. To perform this I detect the logged User by (VisuElems.CurrentUserGroupID <> 0) with a similar code to the the following: PROGRAM AlarmMngt VAR alarm : BOOL:= FALSE; Ack : BOOL:= TRUE; PushBottonOpening : BOOL:= FALSE; Valve : BOOL := FALSE; Flag: BOOL := FALSE; END_VAR IF alarm AND Ack AND (NOT Flag) THEN valve := FALSE; PushBottonOpening := FALSE; Ack := FALSE flag := TRUE; ELSIF (NOT alarm) AND Ack THEN flag := FALSE; END_IF (* if the system is in alarm but there is a logged operator that acknowledge the alarm the system allows the valve opening.*) IF (VisuElems.CurrentUserGroupID <> 0) AND Ack AND Alarm AND PushBottonOpening THEN Valve := TRUE; ELSIF (VisuElems.CurrentUserGroupID = 0) AND Alarm THEN valve := FALSE; END_IF The problem I have is in the last 5 lines of the code: Even if there is a logged in user, the GroupID variable is subjected to a refresh that cyclically set for an instant it to 0 and this close the valve making difficult to the user to work Now I solved it creating a time hysteresys cycle but it is not a good solution. Someone is able to explane me why the GroupID variable is sobjected to this refresh and how to stabilize to avoiding it? Thank you in advance, Riccardo
Last updated: 2023-11-10

Post by riccardo on VisuElems.CurrentUserGroupId is not stable CODESYS Forge talk (Post)
Goodmorning TimvH, Thanks for the reply. I don't know if your solution solve my trouble yet, I am going to see the link you sent me. In the mean time I try to explane better what I need to do. I have a turbine system that get in alarm under some condition (E.g low speed of turbine) and block the itself. When the system is stoped there is no speed turbine and the system cannot start. To give to the operetor the possibility to bypass the alarms, there is an acknoledgement alarm pushbutton. This bypass must not work for everyone but only for those client that perform the login by (User Management). Furthermore, if the user perform the (manual or automatic) logout in alarm conditions, the acknowlegment must be annulled and block the system again. To do this, I need to know if an operator is logged in the page and is working to fix the problem; otherwise the syste must autoturn off again. Now I go to study your solution, if I have explaned better and you have another idea tell me please.
Last updated: 2023-11-16

Post by toffeebonbon on EL7041-0052 - does it run with EL7041 SoftMotion? CODESYS Forge talk (Post)
Good morning everyone. In my setup I am trying to use a couple of EL7041-0052 (the EL7041 variant without terminals for an encoder) to run stepper motors without feedback. When using the softmotion drivers for the EL7041 (Rev22 and Rev24, even selecting external feedback type doesn't work) the device log shows warnings for the corresponding hardware: "SDO write error 0x1 -> 0x8012:0x08 eError 0x1 AbortCode 0x6090011". 0x8012:0x08 is the register for the Feedback Type. My best guess was setting the the register value in the start parameters to zero, but the result is the same. What else can I try to get the hardware to work? I have screenshots attatched showing the running fieldbus and the log messages. EDIT: One clarification: the "device log" that shows the error is the PLC, not the ethercat terminal. The log of the terminal itself shows neither errors nor warnings. BR Robert
Last updated: 2023-11-29

Post by open on How to create a stopwatch? CODESYS Forge talk (Post)
Hi @ph0010421, I tried the program the TimeTaken is calculated when stop is triggered. I want the TimeTaken to be continuously calculated and counting when a BOOL variable is true. I tried to program this way: Declaration: PROGRAM PLC_PRG VAR bStartStop: BOOL := FALSE; // Start/Stop button bReset: BOOL := FALSE; // Reset button bRunning: BOOL := FALSE; // Flag indicating whether the stopwatch is running tStartTime: TIME; // Variable to store the start time tElapsedTime: TIME; // Variable to store the elapsed time END_VAR Implementation: // Main program logic IF bReset THEN // Reset button pressed, reset the stopwatch bRunning := FALSE; tElapsedTime := T#0s; ELSIF bStartStop THEN // Start/Stop button pressed, toggle the running state IF bRunning THEN // Stop the stopwatch bRunning := FALSE; ELSE // Start the stopwatch bRunning := TRUE; tStartTime := tElapsedTime; END_IF; END_IF // Update the elapsed time when the stopwatch is running IF bRunning THEN tElapsedTime := tElapsedTime + T#1s; // Adjust the time increment as needed END_IF However counting of the seconds is not accurate. I tried changing the main task cycle time interval to 1000ms. The counting of seconds become slower. (see attached) Please help
Last updated: 2023-12-08

Post by ph0010421 on How to create a stopwatch? CODESYS Forge talk (Post)
Do you need an 'hours-run' counter? And 1 second resolution is ok? I think you're over-thinking it. (The task time needs to be < 1second) Have a look at the LAD... Then, the time in seconds can be made into hh:mm:ss with this FUNction Declarations: FUNCTION funSecondsToStringTime: string VAR_INPUT InSeconds: UDINT; END_VAR VAR AsString: STRING; Minutes: UDINT; Hours: UDINT; Seconds: UDINT; MinutesAsString: STRING(2); HoursAsString: STRING(2); SecondsAsString: STRING(2); END_VAR and the code: Hours := InSeconds / 60 / 60; //Derive hours Minutes := (InSeconds - (Hours * 60 * 60)) / 60; //Derive minutes Seconds := InSeconds - ((Hours * 60 * 60) + (Minutes * 60));//Derive seconds HoursAsString := UDINT_TO_STRING(Hours); MinutesAsString := UDINT_TO_STRING(Minutes); SecondsAsString := UDINT_TO_STRING(Seconds); IF LEN(HoursAsString) = 1 THEN HoursAsString := CONCAT('0',HoursAsString); END_IF; IF LEN(MinutesAsString) = 1 THEN MinutesAsString := CONCAT('0',MinutesAsString); END_IF; IF LEN(SecondsAsString) = 1 THEN SecondsAsString := CONCAT('0',SecondsAsString); END_IF; AsString := CONCAT(HoursAsString, ':'); //assemble string AsString := CONCAT(AsString,MinutesAsString); AsString := CONCAT(AsString,':'); AsString := CONCAT(AsString, SecondsAsString); funSecondsToStringTime := AsString;
Last updated: 2023-12-08

Post by nz-dave on Bool turning on in case stament in wrong state? CODESYS Forge talk (Post)
I had the FB called via a for loop to call a few instances of my FB I have removed it the for loop and just called them 1 by 1. Seems to have sorted the problem. tho, i have other FB's and for loops doing the same thing but they are all fine. below is basically what was happening. var: mVibrator : ARRAY[1..GVL_Settings.Number_Of_Products] OF Main_Vibrator; end_var Controller(PRG) call: FOR v := 1 TO GVL_Settings.Number_Of_Products BY 1 DO; mVibrator[v] (); END_FOR So at state 30: the mVibrator[1].start was turning on 30: Main_Mixer.Start := TRUE; Process_State := 2; IF Main_mixer.Done THEN Main_Mixer.Start := FALSE; Control_State := 40; END_IF but its not till state 50: that it is actual in the code. 50: Main_Suction_valve.Open_Input := TRUE; mVibrator[1].Start := TRUE; Process_State := 4; IF GVL_Weigh_hopper.LoadCell_Weight = 0 THEN Main_Suction_valve.Open_Input := FALSE; mVibrator1.Start := FALSE; Control_State := 60; END_IF Thanks for your input.
Last updated: 2023-12-16

Post by andrax on Meine Gerätesammlung basierend auf TCA9548 CODESYS Forge talk (Post)
Hallo zusammen, ich programmiere öfters mal kleinere Messgeräte und Datenlogger. Je nach Einsatzzweck musste ich mir ein paar Gerätetreiber selber schreiben. Da es eine recht große Sammlung ist, stelle ich die hier einfach mal ein. Die Sammlung basiert auf den Gerätetreiber TCA9548 Multiplexer von Steffen Dreyer. Codesysversion: V3.5 SP18 Patch 4 Inhalt: -4channel Dimmer (Stefan Dreyer) -BMA456 (Andre Klien) -BME280 (Stefan Dreyer) -BMP280 (Stefan Dreyer) -EEPROM_24C512 (Stefan Dreyer) -ADS1115 (Andre Klien) -ICP10125 (Andre Klien) -PCA9555 (Stefan Dreyer) -PCA9685 (Stefan Dreyer) -PCF8575 (Stefan Dreyer) -SDP810 (Andre klien) -SSD1306 (Stefan Dreyer) -TCA9548 (Stefan Dreyer) -TSL2561 (Stefan Dreyer) Alle Gerätetreiber laufen über den Multiplexer, können aber auch ohne betrieben werden. Einschränkung: BMA456: Die Konfigurationsdaten werden erfolgreich in den Chip geschrieben, dieser meldet aber config wrong. Warum auch immer, der Sensor funktioniert und bringt hochempfindlich Beschleunigungsdaten. ADS1115: Hie habe ich nur die wichtigsten funktionen implementiert. 1-4 Kanäle, PGA, kontinuierlicher Modus, Datenrate. Alle anderen Funktionen (single-shot, komparator,alm) sind nicht implementiert. Das macht auch keinen Sinn, da diese Funktionen besser über die Steuerung realisiert werden können. Achtung beim ADS1115 ist zwingend ein Levelshifter notwendig, wenn ihr diesen mit 5V betreiben wollt. Ihr grillt sonst euren Raspi (SDA, SCL sind dann 5V) Gruß Andre
Last updated: 2023-12-18

Post by spiessli on Softmotion axis to CANopen Maxon IDX drive CODESYS Forge talk (Post)
Thanks for the advise, indeed, this was somewhat, what my intention was. I tried around again with EDSes and DCFs, anyway. It appears that the DCFs end up in a subfolder in the attach device dialog. Astonishingly, when attaching the DCF version I get a device in the device tree, where I can add a SoftMotion axis, whereas when I attach the device not in the subfolder, then I cannot. Further astonishingly, when looking in the CANopen parameters in supported profiles, "402" is listed in the case of the DCF variant, whereas in the EDS variant "0" is shown. Comparing EDS and DCF files I cannot guess, where the difference is coming from. I cannot tell either why I have always attached the EDS variant and apparantly never the DCF variant. As I am not in the lab right now, I cannot test if the connection actually is working. Thanks again, spiessli
Last updated: 2024-01-07

Post by vipul on Multicast udp CODESYS Forge talk (Post)
Hi, Good afternoon can anybody help me with UDP Multicast code. I am not able to send or recieve data when code is dumped on linux device. Below is my code. Declaration: PROGRAM udp_multicast VAR oneTimeFlag :UINT :=0; state: INT:=0; driver: UDP.UDPDriver; //port : UDP.Port;//moved to GVL src_ipAddr_ud: UDINT; src_ipAddr_st:STRING := '192.168.127.155';//'192.168.1.155';//ipms ip address dst_ipAddr_ud:UDINT; group_ipAddr_st:STRING := '239.1.5.10'; //group_ipAddr_ud:UDINT; result: SysTypes.RTS_IEC_RESULT; //result of recieve function. bind: UDINT; //result of binding. resultCreate:SysTypes.RTS_IEC_RESULT;//result of port creation. timer:BLINK; temFlag :INT:= 0; post:INT :=0; checksumFunc:checksumXor; localStringBuf:STRING[500]; chksum:BYTE; dataBuffer:POINTER TO BYTE; checksumString:ARRAY[0..5] OF BYTE; recvSize:__XINT; errorCode:UDINT; joinGroupErrorCode:UDINT; END_VAR ************8 Implementation: IF oneTimeFlag <> 1 THEN oneTimeFlag:=1; resultCreate := driver.CreatePort(ADR(GVL.port)); src_ipAddr_ud := UDP.IPSTRING_TO_UDINT(sIPAddress:= src_ipAddr_st); GVL.group_ipAddr_ud := UDP.IPSTRING_TO_UDINT(sIpAddress:= group_ipAddr_st); GVL.port.IPAddress := src_ipAddr_ud; GVl.port.ReceivePort:= GVL.src_port;//port on which messages are expected. GVl.port.SendPort := GVL.dest_port; GVl.port.OperatingSystem := 0; //0- any system GVL.port.Socket :=3; //3- socket type is multicast bind := GVL.port.Bind(udiIPAddress:=src_ipAddr_ud,); GVl.port.JoinGroup(udiGroupAddress:= GVL.group_ipAddr_ud,udiInterfaceAddress:= src_ipAddr_ud,eLogCode=>joinGroupErrorCode); END_IF timer(ENABLE:=TRUE,TIMELOW:=T#100MS,TIMEHIGH:=T#100MS); IF timer.OUT = TRUE THEN GVL.port.Send(udiIPTo:=GVL.group_ipAddr_ud,GVL.dest_port,pbyData:=ADR(GVL.writeData),diDataSize:=SIZEOF(GVL.writeData)); ELSE SysMemSet(ADR(GVL.readData[0]),0,SIZEOF(GVL.readData)); result := GVl.port.Receive(ADR(GVL.readData),diDataSize:=SIZEOF(GVL.readData),udiIPFrom=>dst_ipAddr_ud,diRecvSize=>recvSize,eLogCode=>errorCode); SysMemMove(ADR(GVL.readDataBuf[0]),ADR(GVL.readData[0]),SIZEOF(GVL.readData)); END_IF post:=LEN(GVL.readDataBuf);
Last updated: 2024-01-14

Post by edepalos on Text list from sd card CODESYS Forge talk (Post)
Hi guys, I have a textlist in my project which is working just as expected in a drop down list. I would like to move this text list to a sd card and access it from there, because I want to ease the editing of the contents of this textlist. I'm imagining a solution like the operator shuts down the plant, takes the sd card out, edits the textlist on the card with a windows machines notepad, then reinserts the card in the PLC and restarts the plant, having the new content of the textlist populating the dropdown list. I'm sorry that I'm asking you to spoonfeed me, but I did not find anything straightforward to do this... I saw in the Project>Project settings>Visualisation a relative path thingy, but I have the plant in operation and I would not like to make 100 trial and errors right now... I'm also not interested in SysLib file read commands and stuff, I would just like to access the file from the cards part, I don't want to replace its contents dynamically or such... nor I have language files or recipes... Thank You in advance! Br, Ede
Last updated: 2024-01-16

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

<< < 1 .. 793 794 795 796 797 .. 799 > >> (Page 795 of 799)

Showing results of 19954

Sort by relevance or date