Post by danieldiaz on Problem with FB execution
CODESYS Forge
talk
(Post)
Hello everyone, I've been working on a system which needs an error function, with this purpose I've created a FB programmed in LD, after debugging I run the simulation. It seems that the variable linked to a coil doesn't change the value when the contacts are associated to input variables. When I use internal variables the logic works properly. I don't know if the problem is related to the variables definition or with the logic program. As you can see in the image, I1 and I2 are variables declared on the FB, the rest are input variables. If I force the eStop and Reset signals to TRUE the coil value should change, but it doesn't. However in the second network if I1 is TRUE the coil change to TRUE as it has to be. To sum up, my doubt is why that coil doesn't change its value? I would like someone to shed a light on this. Thanks!
Last updated: 2024-04-02
Post by tyronnosaurus on ReceiveWatchdog FB not working on J1939 P2P PGNs
CODESYS Forge
talk
(Post)
Hi guys. I've got a device that sends a status message over J1939 and a PLC running Codesys to receive it. This message uses a P2P PGN (as opposed to a broadcast PGN). Codesys can only read it if I mark the J1939_ECU as "Local" (see screenshot 1). The message is received correctly, that is not the problem. The problem is detecting if the message stops being received. Local ECUs have no Watchdog checkbox to detect if the message has been received in the last X seconds. In order to implement a watchdog, I've used a ReceiveWatchdog FB. The same code works well for any non-P2P message, but doesn't work for this particular P2P message I'm trying to monitor. Even if I physically disconnect the device, ReceiveWatchdog.xBusy stays True, and ReceiveWatchdog.xError never triggers due to a timeout error. Is there any caveat in the ReceiveWatchdog FB that makes it unable to monitor P2P PGNs in Local J1939_ECUs?
Last updated: 2024-07-11
Post by grant32 on RAMP_REAL FB is retaining my output value when i try to re use the FB
CODESYS Forge
talk
(Post)
Hello, I'm relatively new to PLC programming. I am trying to creat a ramp down function, I have an example here of what I am using. I can get the function to work, the issue is that the OUT (variable3) value is being held by the FB so after I use it once it no longer works. In this example i set variable3 to 100 and the rest is as seen, over the course of a minute it ramped down to 10 (as desired). But when I deenergize TEST_START, set variable3 back to 100, and then re-energize TEST_START it immediately jumps back to the previously held value 10. The reset on this block just pauses the function and holds the last OUT. In my case I will need the function to start OUT at a set value, ramp down to the IN (variable2) value, and then accept a new OUT value to ramp down next time the block is energized. Hopefully this made sense, if anyone has any advice that would be awesome!
Last updated: 2024-07-29
Post by amy123 on Alarm Manager Project Doesn't Open Successfully
CODESYS Forge
talk
(Post)
Hello, when I download AlarmManager.project from https://forge.codesys.com/prj/codesys-example/alarm-manager/home/Home/, it gives an error when I open it. If I ignore the warning and continue to open, the alarms are missing. ** Exception Text ** System.ArgumentNullException: Value cannot be null. Parameter name: first at _3S.CoDeSys.ControlsContrib.Utilities.WeakMulticastDelegate.Invoke(Object[] args) at _3S.CoDeSys.ControlsContrib.Controls.WizardControl.OnFinishClick(EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Last updated: 2024-04-04
Post by rh-pk on v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Post)
Hello Vincent, I don't have 75 channels but it works for me as described above without any problems. There is also a parameter MAX_MODBUS_CHANNELS in the library parameters for the IoDrvModbusTCP module. The default value there is 100. Perhaps you are reaching the limit there? The value can be adjusted accordingly. I assume that this value is not accepted in the input dialogue and therefore the 'fixed' limit value 10 is used.
Last updated: 2024-04-10
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 alez on CANOpen SDO to write VISIBLE STRING
CODESYS Forge
talk
(Post)
Hello, I am experiencing difficulties in configuring a CANopen device by sending SDOs. In particular I am attempting to write an Object Dictionary that has VISIBLE STRING as the Data Type. When I try to configure the sending of an SDO from Codesys to configure this parameter I am not allowed to enter a string value. In my particular case I am trying to change the Manufacturer Device Name ( Index 0x1008 ). Could it be that Codesys doesn't manage these types of variables?
Last updated: 2024-04-29
Post by culius on Official MQTT-Client: MAX_RECEIVE_BUFFER_SIZE_EXCEEDED
CODESYS Forge
talk
(Post)
Thank you very much for your reply. That helped, it is editable if the library is at root level. Unfortunately, I noticed that I am not using the MQTT client SL, but the AzureMQTTClient from the Azure IoT Hub Client SL library. At first glance, there is no parameter to increase the message size. Does anyone know how to increase this in the library or is it simply not possible here?
Last updated: 2024-06-08
Post by micik on ERR_OK not recognized
CODESYS Forge
talk
(Post)
Hello, if I try to use ERR_Ok in my code to check whether the file is open correctly or not, I get an error "Identifier ERR_OK not recognized", I can use plain 0 (zero) instead. But in general, is this a proper way to check for success of file operation since the 4th parameter is a poinmter to RTS_IEC_RESULT, and normally I would expect this to be used somehow. _hFile := SysFileOpen(_sFileName, am:=SysFile.ACCESS_MODE.AM_WRITE, ADR(_result)); IF _result <> 0 THEN udDiag := 100; RETURN;
Last updated: 2024-08-17
Post by mubeta on Some 'pathetic' errors in SoftMotion program
CODESYS Forge
talk
(Post)
Yes, this is the error the sometimes show up. What make me crazy is the fact that it happens randomly and not each times. I know very well where the problem is, in wich one program row it's located. For each actions of the state machine I have all events recorded with log on text file. it is not problematic for me to find the application point of the fault, but I need to understand why occasionally and for no apparent reason, switching the state machine and thus changing the motion FB, sends the axis into failure (but only occasionally). 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. 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).
Last updated: 2024-07-18
Post by dasch on eCockpit - unable to start simulation
CODESYS Forge
talk
(Post)
This is a known bug in e!Cockpit. See Release notes of V 1.11: 1 e!Cockpit Release Version 1.11 (2022-07) ATTENTION: If a library that uses asynchronous tasks (e.g. WagoAppConfigTool, WagoAppCloud or function modules such as Dali-Master) is dragged into the project, the simulation cannot be started. It is already sufficient to add the library to the project (an FB does not even have to be instantiated). I guess you are using one of these libraries/modules in your project. We e.G. often use PWM modules, these are also affected.
Last updated: 2023-09-05
Post by manuknecht on Detect "Cancel" Press in FileOpenSave Dialog
CODESYS Forge
talk
(Post)
When using the FileOpenSave dialog and using the Visu_FbFileListProvider FB as an In/Output I could not manage to detect the difference of pressing the "Load" button on the dialog vs. pressing the "Cancel" button. In both cases, the selected file is updated if the dialog is closed when checking using the Visu_FbFileListProvider.GetSelectedFileName() command. How can I prevent reading or writing of a file when the "Cancel" button was pressed?
Last updated: 2023-09-19
Post by timvh on Specify Input Configuration "OnDialogClosed" Action to only react to certain Dialogs
CODESYS Forge
talk
(Post)
What maybe helps is the Visu Dialog ST demo project: https://store.codesys.com/en/visu-dialog-st.html This has an application IECOpenDialog where dialogs are opened using the VU.FbOpenDialogExtended function blocks. The fbOpenConfigurationDialog call has a reference (interface) to the "close listener" FB of which it's method is automatically called when the dialog is closed. This way you can create specific function blocks for each dialog when it is closed and do what you want with the data that might have been changed.
Last updated: 2023-09-28
Post by song on How to convert a standard robot program into an excutive list when a robot runs?
CODESYS Forge
talk
(Post)
Dear Sir, I'd like to learn and try to make robot based on Codesys, is there a FB block or other ways to convert a standard robot program into an excutive list? how codesys explain the robot command instructions on HMI, just like the SMC_NCDecoder used to convert CNC program into a list of SMC_GEOINFO object. Thanks very much! Peter Yan
Last updated: 2023-11-25
Post by josephbourgeois on Tracking out product
CODESYS Forge
talk
(Post)
Hi everyone! I synchronize the operation of the tripod and the conveyor. I have a problem with the product tracking algorithm on the conveyor (PCS_1). Sometimes I need to stop tracking a product on command without completing the operation. I do this using MC_GroupStop. But when I need to start moving in WCS again (using fb movelinearabsolute), I get a tripod kinematics error - SMC_CP_INVALID_ORIENTATION (Invalid orientation (non-orthonormal matrix or non-unit quaternion, internal error)). MC_ResetGroup does not help. What could be the problem? Has anyone encountered this?
Last updated: 2024-02-05
Post by josephbourgeois on tracking out product
CODESYS Forge
talk
(Post)
Hi everyone! I synchronize the operation of the tripod and the conveyor. I have a problem with the product tracking algorithm on the conveyor (PCS_1). Sometimes I need to stop tracking a product on command without completing the operation. I do this using MC_GroupStop. But when I need to start moving in WCS again (using fb movelinearabsolute), I get a tripod kinematics error - SMC_CP_INVALID_ORIENTATION (Invalid orientation (non-orthonormal matrix or non-unit quaternion, internal error)). MC_ResetGroup does not help. What could be the problem? Has anyone encountered this?
Last updated: 2024-02-05
Post by roccom1910 on variablen inhalt in datei schreiben bei system event CmpApp.EventIDs.EVT_PrepareStop
CODESYS Forge
talk
(Post)
Hallo, ich möchte meine Variablen vor dem stoppen der CPU in eine Datei schreiben. Das schreiben der Datei dauert ca. 1 minute (sehr viele Daten). Ich habe versucht das mittels Szstemevent zu bewerkstelligen leider kreiert er nur die datei sofern nicht vorhanden. Ich vermute das die Zeit nicht ausreicht um die daten zu schreiben. Anbei mal der Entsprechende FB. Kann mir da eventuell jemand weiterhelfen?
Last updated: 2024-02-15
Post by androidzz on Json Builder problem?
CODESYS Forge
talk
(Post)
Dear reader, I am using the codesys JSON utilities SL, 1.9.0.0 library. And then specifically the FB JSONBuilder. I need to create a main object with at least 2 objects in it. The first object is no problem, but I cannot insert the second object into the main object. See attached my code and the result I get. I am assuming that I am doing something wrong with the parent index but have tried a lot and can't get it done. Kind regards, Rob
Last updated: 2024-03-11
Post by syjoo on Recipe Manager in PRG (3.05.13.XX)
CODESYS Forge
talk
(Post)
I'm using version 3.5.13. Is it possible to handle Recipe Manager in PRG in this environment? Can you give me a simple example? Although it has been confirmed that the functions work on Recipe Manager, they do not work properly when implemented through FB within a simple PRG. I would like to save the current value as a recipe or load the recipe's value as the current value. And I want to save the recipe as a file or load the recipe saved as a file. somebody help me. (TT)
Last updated: 2024-04-15
Post by gseidel on CNC - system goes to X=0 Y=0 before CNC file execution starts, how to avoid that?
CODESYS Forge
talk
(Post)
Hi peterned, the start position given in the CNC properties is only used if you use the compile mode OutQueue. With compile mode SMC_CNC_REF, you need to provide the start position in the IEC application. The function block SMC_NCInterpreter has an input piStartPosition. You can initialize it with the output of the forward kinematic transormation FB for your machine. In your case probably SMC_TRAFOF_Gantry2. Best regards, Georg
Last updated: 2024-04-30
Post by timvh on JSON
CODESYS Forge
talk
(Post)
I don't know the details of jsonArrayWriter, but the common behaviour for an xExecute input is that the FB starts on the trigger that it gets TRUE. In your case xExecute is never FALSE, so it is never triggered again to start the jsonArrayWriter. So change the condition from TRUE to a variable which you set to TRUE with the "xFirst". Then when the jsonArrayWriter is done (xDone), or has an error (xError), then set this variable to FALSE.
Last updated: 2024-05-01
Post by corriibme on Setting array values with JSON Utilities SL
CODESYS Forge
talk
(Post)
It turns out that you can build JSON structures without ever calling the JSONBuilder function block directly. Instead, create a pointer to JSON.JSONData and invoke the necessary methods on its dereference. The parent object has a parent index of -1 (and an index of 0). EVERY other item (including keys, values, empty arrays and sub-objects) created by the setX methods needs the index to increase by 1. Then use the JSONByteArrayWriter FB to generate your JSON string
Last updated: 2024-05-23
Post by mstehl on Generischer Funktionsbaustein erwartet genau '1' Anzahl von generischen Konstanten-Definitionen
CODESYS Forge
talk
(Post)
Hallo zusammen, ich bin neu hier und beschäftige mich mit Generischen Funktionsbausteinen. Ich bekomme die Fehlermeldung C0547 angezeigt und soll laut dieser eine '1' Anzahl von generischen Konstanten-Definitionen einbauen. Leider kann ich die Dokumentation zum Fehler C0547 nirgendwo finden. Der Generische FB befindet sich in einer Bibliothek. Diese habe ich Bibliotheksrepository Installiert. Wenn ich die Bibliothek nicht kompiliere und einbinde, funktioniert alles Wunderbar. Sobald ich die Bibliothek kompiliere und einbinde wird der Fehler angezeigt. Leider konnte mir der Wago-Support auch nicht weiter helfen. Gruß Michael
Last updated: 2024-07-28
Post by mstehl on Generischer Funktionsbaustein erwartet genau '1' Anzahl von generischen Konstanten-Definitionen
CODESYS Forge
talk
(Post)
Hallo zusammen, ich bin neu hier und beschäftige mich mit Generischen Funktionsbausteinen. Ich bekomme die Fehlermeldung C0547 angezeigt und soll laut dieser eine '1' Anzahl von generischen Konstanten-Definitionen einbauen. Leider kann ich die Dokumentation zum Fehler C0547 nirgendwo finden. Der Generische FB befindet sich in einer Bibliothek. Diese habe ich Bibliotheksrepository Installiert. Wenn ich die Bibliothek nicht kompiliere und einbinde, funktioniert alles Wunderbar. Sobald ich die Bibliothek kompiliere und einbinde wird der Fehler angezeigt. Leider konnte mir der Wago-Support auch nicht weiter helfen. Gruß Michael
Last updated: 2024-07-28
Post by mini-developer on Precompilation Error NBS.UDP_Peer
CODESYS Forge
talk
(Post)
Hello, I use the Library NBS from "caa net base services". After opening the Project i get 19 errors from the message window "Precompilation", most of them because it doesn't recognise a component of the FB "NBS.UD_Peer". (see photo) After compiling the Project at least 2 times, there are no errors. Is there a reason and solution for this behavior? Is there a problem with resolving the library? Thanks for any clue
Last updated: 2024-08-23
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
.