What is the meaning of colored symbols leftside of each device ?
CODESYS Forge
talk
(Thread)
What is the meaning of colored symbols leftside of each device ?
Last updated: 2020-03-31
call of a method of a function block in another program
CODESYS Forge
talk
(Thread)
call of a method of a function block in another program
Last updated: 2024-06-03
call of a method of a function block in another program
CODESYS Forge
talk
(Thread)
call of a method of a function block in another program
Last updated: 2024-06-03
Post by dkugler on Webvisu client connection monitoring
CODESYS Forge
talk
(Post)
you can give this code snippet a try. It's extracted and simplyfied from my code: Install VisuElemBase lib if not installed yet. Execute in visu task: VAR pClientData : ARRAY [-1..100] OF POINTER TO VisuElemBase.VisuStructClientData; END_VAR VisuElemBase.g_ClientManager.BeginIteration(); pClientData := VisuElemBase.g_ClientManager.GetNextClient(); WHILE pClientData <> 0 DO pClientData[pClientData^.GlobalData.GlobalClientID] := pClientData; END_WHILE You have to make shure every no longer updated pointers in the array have to be deleted and no longer used by your code! Usage of this pointer access at your own risk :-) Works with SP16. From SP17 and newer there will be warnigs etc. using this solution as I remember. It will be great, if Codesys publishes a example or give a hint how to accesse this client values with the VisuUtil lib or other future-proof way!
Last updated: 2024-09-09
Post by jampid on Struct Literal
CODESYS Forge
talk
(Post)
Bonjour Davidmic, Il n'est pas possible d'associer une méthode à une fonction. Cela est possible sur les Blocs fonctions. En utilisant ta DUT MyStruct, je créé une fonction avec en entrée un tableau de structure :** FUNCTION F_F3 : REAL VAR_IN_OUT // bien définir un type IN_OUT IN_ptrINT: ARRAY[*] OF MyStruct; // la taille sera définie ultérieurement/ END_VAR VAR _di: DINT; // Index de parcours du tableau pour l'écriture dans les cases ENDVAR ============== //Programme F_F3: FOR _di := LOWER_BOUND(IN_ptrINT,1) TO UPPER_BOUND(IN_ptrINT,1) DO IN_ptrINT[_di].som:=IN_ptrINT[_di].a + IN_ptrINT[_di].b; END_FOR J'utilise ensuite cette fonction dans un POU Programme : PROGRAM Test_F_Fx VAR _aiTAB9:ARRAY[0..3] OF MyStruct := [(a := 1, b := 1.2), (a := 2, b := 2.2), (a := 3, b := 3.3), (a := 4, b := 4.4)]; END_VAR ** ==========** F_F3(IN_ptrINT:=_aiTAB9 ); Voilà l'idée pour avancer. Une autre idée, est d'utiliser les pointeurs ou les références. Bon développement!
Last updated: 2025-04-07
Post by paro on Modbus Client Request Not Processed
CODESYS Forge
talk
(Post)
Hi, works in my case if I increase the timeout! to_udint(t#100ms) -> 100 -> 100us.. FUNCTION_BLOCK MODBUS_master_example_ST VAR initDone : BOOL := FALSE; aIPAddress : ARRAY [0..3] OF BYTE := [127,0,0,1]; clientTcp: ModbusFB.ClientTcp; // buffer to read input registers aDataInputRegisters : ARRAY[0..9] OF UINT; // some client requests clientRequestReadInputRegisters: ModbusFB.ClientRequestReadInputRegisters; xExecute: BOOL; uistart: UINT := 100; udiTimeout1: UDINT; END_VAR IF NOT initDone THEN initDone := TRUE; // configure clientTcp clientTcp(aIPaddr:=aIPAddress, uiPort:=502, udiLogOptions := ModbusFB.LoggingOptions.All); // configure clientRequestReadInputRegisters clientRequestReadInputRegisters(rClient:=clientTcp, uiUnitId:=1, udiTimeout:=1000000); // 1sec END_IF // call the client FB's clientTcp(); clientRequestReadInputRegisters(rClient:=clientTcp,xExecute := xExecute AND NOT clientRequestReadInputRegisters.xBusy ,uiStartItem:=uistart, uiQuantity:=3, pData:=ADR(aDataInputRegisters[0]));
Last updated: 2024-05-30
Post by zer0g on Modbus Client Request Not Processed
CODESYS Forge
talk
(Post)
I'm using the code bellow which is based on the Codesys example: FUNCTION_BLOCK MODBUS_master_example_ST VAR initDone : BOOL := FALSE; aIPAddress : ARRAY [0..3] OF BYTE := [127,0,0,1]; clientTcp: ModbusFB.ClientTcp; // buffer to read input registers aDataInputRegisters : ARRAY[0..9] OF UINT; // some client requests clientRequestReadInputRegisters: ModbusFB.ClientRequestReadInputRegisters; xExecute: BOOL; END_VAR IF NOT initDone THEN initDone := TRUE; // configure clientTcp clientTcp(aIPaddr:=aIPAddress, uiPort:=502, udiLogOptions := ModbusFB.LoggingOptions.All); // configure clientRequestReadInputRegisters clientRequestReadInputRegisters(rClient:=clientTcp, uiUnitId:=1, udiTimeout:=TO_UDINT(T#1000MS)); END_IF // call the client FB's clientTcp(); clientRequestReadInputRegisters(rClient:=clientTcp,xExecute := xExecute AND NOT clientRequestReadInputRegisters.xBusy ,uiStartItem:=2, uiQuantity:=3, pData:=ADR(aDataInputRegisters[0])); As you can see the clientTCP is called cyclically with the same result.
Last updated: 2024-05-30
Get the numer of day
CODESYS Forge
talk
(Thread)
Get the numer of day
Last updated: 2023-09-14
Get Version of Installed Package
CODESYS Forge
talk
(Thread)
Get Version of Installed Package
Last updated: 2019-03-08
Issues of Large Ethernet IP project
CODESYS Forge
talk
(Thread)
Issues of Large Ethernet IP project
Last updated: 2022-02-01
Use of the CPLCHandlerCallback
CODESYS Forge
talk
(Thread)
Use of the CPLCHandlerCallback
Last updated: 2012-02-06
Dinamic assignement of a variable
CODESYS Forge
talk
(Thread)
Dinamic assignement of a variable
Last updated: 2016-06-28
Maintenance of the forum
CODESYS Forge
talk
(Thread)
Maintenance of the forum
Last updated: 2010-07-09
Ambiguous use of name - CO136
CODESYS Forge
talk
(Thread)
Ambiguous use of name - CO136
Last updated: 2024-07-06
What is the insights of IoDrvEtherCAT.DCInSyncWindow?
CODESYS Forge
talk
(Thread)
What is the insights of IoDrvEtherCAT.DCInSyncWindow?
Last updated: 2024-07-09
First IO address of a CAADiagDeviceDefault.
CODESYS Forge
talk
(Thread)
First IO address of a CAADiagDeviceDefault.
Last updated: 2024-08-22
First IO address of a CAADiagDeviceDefault.
CODESYS Forge
talk
(Thread)
First IO address of a CAADiagDeviceDefault.
Last updated: 2024-08-22
Question about the hairaichy of UaExpert
CODESYS Forge
talk
(Thread)
Question about the hairaichy of UaExpert
Last updated: 2024-09-12
CAN Open Manager - varible of SYNC
CODESYS Forge
talk
(Thread)
CAN Open Manager - varible of SYNC
Last updated: 2024-10-26
CAN Open Manager - varible of SYNC
CODESYS Forge
talk
(Thread)
CAN Open Manager - varible of SYNC
Last updated: 2024-11-05
CODESYS 3.5 dicovery of PLC modules
CODESYS Forge
talk
(Thread)
CODESYS 3.5 dicovery of PLC modules
Last updated: 2024-12-11
Name Validation of Visualization objects
CODESYS Forge
talk
(Thread)
Name Validation of Visualization objects
Last updated: 2025-01-10
Download libraries of old versions
CODESYS Forge
talk
(Thread)
Download libraries of old versions
Last updated: 2025-02-11
Something of strange in the trace
CODESYS Forge
talk
(Thread)
Something of strange in the trace
Last updated: 2025-05-16
Something of strange in the trace
CODESYS Forge
talk
(Thread)
Something of strange in the trace
Last updated: 2025-05-16
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.