Post by mubeta on Some 'pathetic' errors in SoftMotion program
CODESYS Forge
talk
(Post)
Thank you for your interest. Your answers are in line with what I knew, so at least it comforts me that I did not misinterpret the situation. However, I don't have an exact match as, for this project over the past few days I have: 1) I have gone back to leaving the various FBs of the motion always called, all of them, and in the state machine I use a boolean to activate the various useful Execute. (But in the future I want to go back and try the programming technique with which I wanted to develop this project); 2) For the occasional error: SMC_FB_WASNT_CALLED_DURING_MOTION perhaps it was due to the fact that I had set the Ethercat bus synchronism only at the CAN master level, but not at the level of individual drives. I have now also activated it for the individual drives and it does indeed seem to have been resolved, but having also adopted the programming technique mentioned in point 1), I cannot say whether this was the solution to the problem, or instead the previous point. 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’? I can't answer that right now. By now the machine is running and I am no longer there, at this one. Also, I seem to remember that the 'fbeFBerror' drive structure (5-element array), does not cycle, BUT ONCE THE 5 EVENTS AFTER SWITCHING ON, IT DOES NOT UPDATE ANYMORE (but that's another issue), so diagnostics were not easy.
Last updated: 2024-07-24
Post by mborchert on PFC100 Error "Bus not running"
CODESYS Forge
talk
(Post)
Hello, i currently want to use a wago 750-8102 with the "codesys control for pfc100" runtime. I want to add the devices connected to the internal pfc100 bus via the "search devices" tab. This was reccommended in the following thread: https://forge.codesys.com/forge/talk/Deutsch/thread/7701332199/ But whenever i try to search for devices codesys just doesnt find anything and i cant close the "search devices" window. Has anyone got an idea what the problem might be? I already tried adding the devices connected to the pfc100 manually but the bus just doesn´t start. best regards Moritz
Last updated: 2024-06-17
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 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 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 srouse on PFC200BUS not running
CODESYS Forge
talk
(Post)
I started a project in codesys for a WAGO 750-8212 PLC and I am working on getting online with the controller. I can log in to the controller and I can see and control all of the fieldbus couplers that I have. I am unable to get the internal bus working. It just says that the bus is not running and when I scan or devices nothing shows up. Am I missing something important in my device tree?
Last updated: 2024-07-10
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 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 mondinmr on Direct Pointers in IOMapping for EtherCAT with IoDrvEthercatLib.ETCSlave_Dia
CODESYS Forge
talk
(Post)
Using SDO, I can read the EtherCAT mappings and offsets from various registers like 0x1c12, 0x1c13, etc. When I obtain registers mapped in the PDOs and various offsets, I could technically access directly to the statusword, controlword, etc., if they are mapped. I have noticed that on IoDrvEthercatLib.ETCSlave_Diag I can find pointers to the input and output buffers. However, although the input buffer can be easily read by referring to what has been obtained from the SDOs, it is not possible to write to the output buffer, as it is overwritten in each cycle by the data from the IOMapping task. Is there a way, knowing an instance of IoDrvEthercatLib.ETCSlave_Diag, to obtain the pointer to the first data in the IOMapping? The offsets are identical to those of the PDOs, but obviously the data is a copy. For me, the cleanest thing would be to access the pointers on IOMapping, for DS402a devices to retrieve the key data and point them to internal references. I need to know this as, having developed our own motion library, I would like to simplify the initial setup by eliminating unnecessary and nonsensical mappings that can lead users to unnecessary errors. In the current version that we have been using for years, we have to map everything manually. I would like to pass only the slave reference to the FB_init constructors and eliminate the mapping.
Last updated: 2024-02-12
Post by rossanoparis on RevPi CONNECT+, CODESYS, EtherCAT master "Filedbus lost synchronicity"
CODESYS Forge
talk
(Post)
Hello @rmaas I assume, you've already verified and tuned everything regarding the EtherCAT network. In my case the problem was due to a wrong core assignement. I suggest to not use the core #0 for your EtherCAT task. The OS realtime patch, which is present on RevPi OS, uses the core #0 for its porpouses and it mustn't be used by any other task which requires realtime and deterministic features. regards Rossano
Last updated: 2024-04-11
Post by hbuitrago on CmpIecTask-program loaded exception
CODESYS Forge
talk
(Post)
I'm facing an error that show on the codesys and the PLC that dont let either the PLC run or access it using the remote software, Error: program loaded exception Log: exception position:IP=0x0xfffffffe (no IEC context could be retrieved) component: CmpIecTask exception [accessviolation] ocurred: APP=[application], Task=[Task] POU changed, that inhibits an online change, Plase let me know if there is a solution for this issue, Best regards,
Last updated: 2024-09-06
Post by janderson on Ethercat scan for devices not picking up EL7041 as a softmotion axis
CODESYS Forge
talk
(Post)
I have a beckhoff EL7041-1000 rev 21 in my ethercat bus but it wont correctly create a softmotion axis unless i manually insert the device. scan for devices gives me an el7041-1000 without an SM3 axis.
Last updated: 2023-09-02
Post by conny-nm on onewire bus master stop working after 4.8.0.0 upgrade
CODESYS Forge
talk
(Post)
Habe ein ähniches Problem Ethercat läuft nur mit RT 4.8.0.0 nicht aber Onewire. Füge ich ForceFile läuft Onewire, nicht Ethercat. Bei IecFilePath.3 läuft Ethercat nicht aber Onewire
Last updated: 2023-09-20
Post by augmue on onewire bus master stop working after 4.8.0.0 upgrade
CODESYS Forge
talk
(Post)
ich lese alle 4 Sekunden einen Sensor DS18B20 aus Datei im Verzeichniss /mnt/1wire mit USB-Adapter und owfs [SysFile] IecFilePath.3=/mnt/1wire
Last updated: 2023-09-20
Post by conny-nm on onewire bus master stop working after 4.8.0.0 upgrade
CODESYS Forge
talk
(Post)
Danke für die Hilfe habe ich übersehen. Habe zwischenzeitlich ein neues Betriebssystem aufgespielt und jetzt wieder meinen alten Fehler das die Runtime nur ca. 20 Sekund läuft.
Last updated: 2023-09-21
Post by lostcontrol on Remote Ethernet/ip Adapter communication with scanner running on codesys
CODESYS Forge
talk
(Post)
is the bus running.? what type of values/IO is the adaptor providing? do you have a map of the data layout? are you actually looking at the right offset?
Last updated: 2023-12-16
Post by elektron785 on CAN-Bus in Demo-Version
CODESYS Forge
talk
(Post)
Ja, Gerätebaum ist grün/orange (siehe Bild). IO-Variablen sind gemappt und im Programm verwendet. Ich habe mal noch ein paar Bilder zum Status angehangen.
Last updated: 2024-02-07
Post by davidbo on Does CODESYS use its own native driver for I2c?
CODESYS Forge
talk
(Post)
CODESYS Control for Raspberry Pi MC Does CODESYS use its own native driver for I2c? I have a python script communicating with a device simultaneously with a CODESYS doing the same. The bus is not saturated. But I get many read errors
Last updated: 2024-02-13
Post by elektron785 on CAN-Bus in Demo-Version
CODESYS Forge
talk
(Post)
Es funktioniert nun. Ich hatte die SYNC-Erzeugung im CANOpen-Manager vergessen. Mit dessen Aktivierung empfange ich die Daten in der Soft-SPS. Vielen Dank für die Hilfe bis hierhin :) Btw: Die PDO's waren standardmäßig als Übertragungstyp zyklisch-synchron eingestellt.
Last updated: 2024-02-14
Post by davelewis104 on J1939 SA
CODESYS Forge
talk
(Post)
I am curious if there is a function block or function that will allow me to monitor the J1939 CANBus and pull out all of the SAs that are on a particular bus, without having to have them loaded in the J1939 manager?
Last updated: 2024-04-30
Post by eschwellinger on Ethercat bus on Beckhoff CX with Codesys for Linux
CODESYS Forge
talk
(Post)
yes I think you need to build the kernel drivers for the CCAT driver for the backplane ETC networkcard https://github.com/Beckhoff/CCAT/
Last updated: 2024-05-13
Post by timvh on displaying all incoming CAN bus messages
CODESYS Forge
talk
(Post)
Create a (global) array of Messages: aMessage : ARRAY[0..NR_OF_MESSAGES-1] OF CAN.RxMESSAGE; Then add each received message to the array. IF UserVarGlobal.g_countMsg_RPMset < NR_OF_MESSAGES THEN aMessage[UserVarGlobal.g_countMsg_RPMset] := Message; UserVarGlobal.g_countMsg_RPMset := UserVarGlobal.g_countMsg_RPMset + 1; END_IF
Last updated: 2024-07-22
Post by i-campbell on Official MQTT-Client: MAX_RECEIVE_BUFFER_SIZE_EXCEEDED
CODESYS Forge
talk
(Post)
256MB for the protocol yes, but the default value for this library parameter limits the library to 6kB per task scan.
Last updated: 2023-09-27
Post by open on How to create a stopwatch?
CODESYS Forge
talk
(Post)
Thanks everyone for your input, I am using persistent variables to retain the timer value after machine shutdown, and main task to be as low as possible for the seconds TON to be accurate.
Last updated: 2023-12-14
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
.