Post by usacodesysuser on How to connect serial devices ?
CODESYS Forge
talk
(Post)
@eschwellinger do you have any examples of using a USB barcode scanner? I have read through the forums here and I am unable to find how to get the barcode data to populate in a text field without having to first click into the text field to activate it. Is there a library that allows you to access the barcode data? I am really new to this in general any help is greatly appreciated, hopefully you have a pretty clear example
Last updated: 2024-01-06
Post by apurv on Cannot pass array of constant size to a function as a reference
CODESYS Forge
talk
(Post)
I have a Array of constant size defined like this Var Constant MAX_SIZE :UINT := 10; End_var VAR array : ARRAY[0..MAX_SIZE] OF INT; END_VAR Now I want to pass this array to a function by reference, Function fun : INT VAR_IN_OUT CONSTANT MAX_SIZE : UINT; END_VAR VAR_INPUT array : REFERENCE TO ARRAY[0..MAX_SIZE] OF INT; END_VAR but when I run this it gives strange Errors Error : Cannot Convert type 'ARRAY [0..MAX_SIZE] OF INT' to type 'ARRAY[0..MAX_SIZE] OF INT'
Last updated: 2024-01-07
Post by eschwellinger on Edge Gateway online, but PLC is not online
CODESYS Forge
talk
(Post)
we need some logfiles from the edge gateway /etc/Gateway.cfg [CmpLog] CmpEdgeGateway.Filter=0xFFFFFFFF Logger.0.Name=/tmp/codesysedge.log Logger.0.Filter=0x0000000F Logger.0.Enable=1 Logger.0.MaxEntries=100000 Logger.0.MaxFileSize=5000000 Logger.0.MaxFiles=1 Logger.0.Backend.0.ClassId=0x00000104 ;writes logger messages in a file Logger.0.Type=0x314 ;Set the timestamp to RTC and does the scan via Automation Server show the plc?
Last updated: 2024-01-09
Post by felipemsgarcia on Edge Gateway online, but PLC is not online
CODESYS Forge
talk
(Post)
Hello, I couldn't figure what/where the issue was, so I deleted everything from automation server and reinstalled the edge gateway and did the process again. It worked for about a month and then it stopped working again. It presents the same symptom, edge gateway is online but I can't connect to the PLC. Any idea of what could be the issue? Thank you!
Last updated: 2024-01-09
Post by felipemsgarcia on Edge Gateway online, but PLC is not online
CODESYS Forge
talk
(Post)
Hi Edwin, The PLC is already in the automation server so nothing happens when I scan the network, however the PLC show offline (not connected). Please see logs below. [CmpLog] Logger.0.Name=codesysedge.log Logger.0.Filter=0x0000000F Logger.0.Enable=1 Logger.0.MaxEntries=100000 Logger.0.MaxFileSize=1000000 Logger.0.MaxFiles=1 Logger.0.Backend.0.ClassId=0x00000104 ;writes logger messages in a file Logger.0.Type=0x314 ;Set the timestamp to RTC Thank you!
Last updated: 2024-01-09
Post by sturmghost on Visualization using methods and cyclic ST-calls
CODESYS Forge
talk
(Post)
I found a way to do it: You can use, for example, the text variable property of any visualization element and call a function in it. Example: Write a test POU as a function (FUN), like MyTestFun which need a boolean Variable as an input value. Now write into the text variable property: MyTestFun(bBooleanValue) Thats it. The function is called at each visu_task cycle.
Last updated: 2024-01-22
Post by jaspergain on Access to the path *** is denied
CODESYS Forge
talk
(Post)
Hello, Recently I upgraded to 3.5.19.50 and have been having errors/issues when doing a download/online change. The message as seen in the attachment pops up. The file in the path is different every time. However when I login again afterwards all works fine. This issue does not happen on older versions. Any clue what the issue could be? I did an reinstall/repair but the issue reappeared again... Thanks in advance!
Last updated: 2024-01-25
Post by wiresplus on INT_TO_WORD function not working
CODESYS Forge
talk
(Post)
Hello, I need to take an INT input, and convert it to a WORD value. VAR DRV2Speed : WORD; //IO card takes a WORD where 16000 = full 10V output (equivalent to 50Hz) PumpFillSpeed : INT; //Users enter a value between 0 and 50 END_VAR IF <conditions> THEN DRV2Speed :=INT_TO_WORD((PumpFillSpeed/50)*16000); END_IF </conditions> According to me this should work - but it stays at 0, no matter what. What am I doing wrong?
Last updated: 2024-01-26
Post by wiresplus on Cannot get INT_TO_TIME working
CODESYS Forge
talk
(Post)
Hello, I have a simple TON timer. It is watching prime loss for a pump. The operator can set the delay via the HMI, it is an integer (seconds) As the TON uses milliseconds, we then multiply the entry by 1000 to get seconds. Seems simple, but... VAR PrimeTimer : TON; primetime : INT; END_VAR PrimeTimer(in:=State>0 AND FlowRate<MinimumFlow,pt:=INT_TO_TIME(primetime *1000)); For an entered 15 seconds (VAR primetime:=15;) the timer reads 49d17h2m26s760ms !!!! What am I doing wrong?
Last updated: 2024-01-26
Post by ojz0r on INT_TO_WORD function not working
CODESYS Forge
talk
(Post)
That calculation will not work the way you expect it to. If PumpFillSpeed is limitied to 0-50 then the only whole number would be 50/50 = 1 everything else is 0.0-0.9999... and since you are using word and integer only 50 would work since there is no representation for mantissa in integer values. Declare a temporary real variable and do the calculation and then do a REAL_TO_WORD in the DRV2Speed assignment.
Last updated: 2024-01-26
Post by melle17 on Steuerung einer Geschirrspülmaschine
CODESYS Forge
talk
(Post)
Hallo, ich muss im Rahmen einer Hausarbeit die Steuerung einer Geschirrspülmaschine erarbeiten. Leider bin ich mit dem Programm noch nicht so vertraut und habe Probleme bei meinem Zeitschalter und finde leider selber das Problem nicht. Deswegen zu meiner Frage ob mir jemand helfen könnte. Und zwar kommt das meine Variablen nicht deklariert sind und ich finde aber nicht wieso. Die zwei Screenshots zeigen nochmal den Zeitschalter und das Programm wo der Zeitschalter eingesetzt wird. Vielen Dank im Voraus.
Last updated: 2024-01-30
Post by jinlee on How do you get the CURRENT ClientData?
CODESYS Forge
talk
(Post)
Hi there, I wonder how to use this CURRENTCLIENTID. However, what I am trying to do is to use PLC_PRG.aIndexVisu[CURRENTCLIENTID]. to switch the frame within the mainpage without affecting the other screen same as the first question of this post. However, I failed to do it. Can you tell me how to do it ? Or can you advise me on this issue
Last updated: 2024-02-07
Post by matthew on New Ladder Diagram conversion does not work due to missing features
CODESYS Forge
talk
(Post)
Hi @eschwellinger, I have been trying out v1.0 of the new ladder and have a few questions. I have warnings Expression or part of it has no effect I can't get rid of them, what do they exactly mean? Using the ST_Block, is there a way when online to open the ST_Block and view the running code? Thanks!
Last updated: 2024-02-09
Post by andrax on Prüfen ob Datei existiert wenn nicht neu erstellen
CODESYS Forge
talk
(Post)
Hi, ich ich möchte prüfen ob eine Datei existiert. Wenn diese nicht existiert, soll eine erstellt werden und dort hinein geschrieben werden. Die Datei wird im Programmlauf mehrfach geöffnet und Daten hinein geschrieben. Ich will hier die Funktion File.MODE.MAPPENDPLUS benutzen, das funktioniert aber nicht. fopen.xDone bleibt false. Hier der Code: fopen.sFileName:=sFileName; fopen.eFileMode:=File.MODE.MAPPENDPLUS; // Neu erstellen und anhängen fopen.xExclusive:=TRUE; fopen( xExecute:=TRUE); IF fopen.xDone THEN hFile:=fopen.hFile; sStringToWrite:=''; writeIndex:=0; SchrittDatenlog:=60; END_IF Wo liegt mein Fehler?
Last updated: 2024-02-11
Post by nmcc on Toggling Visualizations using HMI Physical Buttons
CODESYS Forge
talk
(Post)
Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,
Last updated: 2024-02-13
Post by nmcc on Toggling Visualizations using HMI Physical Buttons
CODESYS Forge
talk
(Post)
Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,
Last updated: 2024-02-13
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 timl on BacNet Server
CODESYS Forge
talk
(Post)
Hallo, für einen BacNet2 Server lassen sich mit zwei Ethernet Schnittstellen auch zwei Bacnet 2 IP Datalinks anlegen. Einen Datalink nutze ich für den UDP Port 47808 und einen für den UDP Port 47809. Dadurch ist der Server aus beiden Netzwerken erreichbar, was so gewollt ist. Allerdings verbindet er die beiden Netze auch miteinander, was zu Kommunikationsproblemen führt, da in beiden Netzwerken bereits gleiche Device ID's vergeben sind und diese sich dann doppeln. Lässt sich diese Verbindung der beiden Netze abschalten? Gruß Tim
Last updated: 2024-02-20
Post by dhumphries on Control for Linux SL on Ubuntu Core
CODESYS Forge
talk
(Post)
Try using a password instead of a public key to log into the controller. I have a video showing how to do this on a default installation of Ubuntu server, it should work the same for Ubuntu Core. https://youtu.be/rj0dOhgnGjs?si=352PmveEP7JXZnO- I sign in to the controller at about 6:40 in the video. I have never tried to remove the public key and revert to signing in using a password, but it looks pretty straightforward https://askubuntu.com/questions/745423/how-to-turn-off-password-less-login-for-ssh
Last updated: 2024-02-28
Post by bschraud on Zielsystem stimmt nicht mit dem verbundenen Gerät überein
CODESYS Forge
talk
(Post)
Der Eintrag in /etc/CODESYSControl.Usr.cfg war schon vorhanden. Bisher habe ich das Gerät Pi MC SL verwendet. Laut H. Zenker ist das die "Produktionsversion“ der Raspberry-Laufzeitumgebung. Gibt es kein MC SL Runtime Package mehr? Ist dieses in der Standardinstallation nicht mehr vorhanden und muss manuell installiert werden? Beim Wechsel auf Pi 64 kann ich nicht mehr kompilieren wegen folgender Fehlermeldung: "cmperrors interfaces, 3.5.5.0 (system): C0338: Die Bibliothek 'cmperrors interfaces, 3.5.5.0 (system)' wird nur in 32-Bit-Applikationen unterstützt" Vielen Dank für die Hilfe
Last updated: 2024-03-11
Post by niallel on How to change bHiresMode
CODESYS Forge
talk
(Post)
Hi, I'm trying to get Scaling working on my axis. An increment produces 36.6mm of movement, so I want to put the units in application as 36.6. However the docs say that I need to change bHiresMode as it doesn't show me the option for Precision in the User Interface. I'm thinking that I need to change the precision so I can enter decimal places. How can I do this, or is my thinking wrong? Thanks,
Last updated: 2024-03-11
Post by aniket-b on Multiple function blocks are not executing at the same time in ladder logic
CODESYS Forge
talk
(Post)
I have two ethernet Ip drives and created Function Blocks for different motions tasks. I am using same FB for both the drives. When I try to execute the relative move start command on FB for both the drives it is not working. However, if I add 1ms second delay between the execution of each drive it is working. Also when I change the rung order it is working for the first drive in the rung. what could be the wrong here?
Last updated: 2024-03-12
Post by k4zz on Continuous Build Server
CODESYS Forge
talk
(Post)
Hallo Martin, Thank you so much for the Code example. It works really fine for .porject Types. However, I encountered a challenge when attempting to apply it to .library Types. I also tried the option to "Perform static analysis automatically after compilation" # get Project values myProject = projects.primary # Creates an active application app = myProject.active_application # build Application and run static code analysis app.generate_code() Could you please offer any insights into why this might be occurring?
Last updated: 2024-03-15
Post by mp9876 on Device User Logon
CODESYS Forge
talk
(Post)
Just adding some info regarding the issue above. Logged onto the project using dev3og5 user (see screenshots); appeared to be ok although when attempting to logon to the device message says 'currently not authorized to perform this operation on the device' (screenshot). If user dev3og5 has same permissions as Owner user; why would it not be authorized. I am at a loss; any assistance would greatly be appreciated. Thank you Mike
Last updated: 2024-03-16
Post by k4zz on Statisch Code Analyse ausführen via Python
CODESYS Forge
talk
(Post)
Derzeit arbeite ich daran, statische Codeanalyse in unsere (CI/CD)-Pipeline zu integrieren. Konkret habe ich die statische Codeanalyse erfolgreich für .project-Typen durchgeführt, und sie funktioniert einwandfrei. Allerdings habe ich Schwierigkeiten bei der Ausführung derselben für .library-Typen festgestellt. Hierbei habe ich zwei Methoden ausprobiert: system.commands["staticanalysis", "run"].execute() # get Project values myProject = projects.primary # Creates an active application app = myProject.active_application # build Application and run static code analysis app.generate_code()
Last updated: 2024-03-18
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
.