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 kut69 on Retain / Persistent Variables in Codesys for Raspberry Pi
CODESYS Forge
talk
(Post)
Hi, I am interested in details about the .ret file in the filesystem. I have already a project where the file is used (write on demand, read by start) and I want to share it as 'default input' for test devices using the identical application. Opening the .ret file content in a hex editor (I only use a single string retain var) I asked myself what the meaning of the first 24 bytes is. It neither contains a handle to the application nor a reference to the variable. Is this maybe a timestamp? Or a CRC/checksum? Regards, Thomas
Last updated: 2025-05-19
Post by durallymax on Access Variable Visu Dialog
CODESYS Forge
talk
(Post)
Is there a way to access the variable in the called dialog? Example: Text Field element with PLC_PRG.myVar as Text variable. OnMouseClick configured to write variable with keypad pop-up. OnValueChanged configured to Execute ST RND(PLC_PRG.myVar,2); Rather than change myVar with each copy of this Text Field, is there a way to access whatever the configured text variable is? Generally try to stay away from ST in visu, but was curious regardless.
Last updated: 2024-11-14
Post by ton on How to create a stopwatch?
CODESYS Forge
talk
(Post)
Hi, i guess you want to make a hour counter. You need to store the measured value. Try to use a retain variable, but need a graceful shutdown, or save it your self. see https://forge.codesys.com/forge/talk/Runtime/thread/278e325579/ Succes.
Last updated: 2023-12-12
Post by pernockham on Is there a pragma for init/instantiation of local variables in FB (like in Methods)
CODESYS Forge
talk
(Post)
Im using a pointer as input for a FB and for convenience I like to use 'referenced' variable internally. I use this setup in methods which works because internal variables are instantiated for each call. In a FB these variables are instantiated and initiated for the first call only. Is there a pragma/attribute available that changes this behaviour to mirror a 'method'-call?
Last updated: 2024-10-31
Post by eaglealex on Length of string and Array of bytes
CODESYS Forge
talk
(Post)
Hello! I have tried read a file to the string variable. But I faced a problem - there is about 2800 bytes of information in file, but string have a limit 2393 bytes. I made two variables with same address (for automatic convertion) - string[3000] and array of bytes[1..3000]. And I noticed that array of bytes contains all information from file, but string shows only first 2393 bytes. So I have lost information. Is there really such a limitation? Or I have an error in my program and Codesys 2.3 have no limit for such kind of conversation between string and array of bytes? Thank you very much!
Last updated: 2025-04-01
Post by wbj0t on mobus tcp slave device. read/write holdings with 2 variables.
CODESYS Forge
talk
(Post)
Hi there. I have an issue to read and set time for the controller. In the issue many registers described as writable by 6/16 functions, and, in this time, also(!) readable! For example: I have time registers: min, hour, day, mon, year. By specifications it is possible check time (so I need always update these varibles in loop) and set time by writing these same registers, BUT how to set, if they will immediatle updated by current time after writing? So, I need to separate one address at two variables. I have seen option mark: Overlay of the process image by the holding and input register. I understand this so: When I READ by function 3, I will get variable that connected with the same INPUT address and when I WRITE by 6/16 this will change second variable that connected with HOLDING address. BUT, this mark doesnt work, when I write 6/16 and try to get by function 3, I will get written value instead INPUT variable. So, what to do?
Last updated: 2024-03-20
Post by wehling-h on PI Input value
CODESYS Forge
talk
(Post)
Hi geoweil, have you tried to save changed values to remanent area or using a VAR RETAIN? After restart you have to initialize Counter with last remanent value. Depending on changes per cycle and the possibilitiy of your control unit to write remanent storage. Otherwise you need a buffering system to ensure save backup of last PI_Counter value. May you could read this Thread to get further help: https://forge.codesys.com/forge/talk/Engineering/thread/31e1c8349e/#bf48
Last updated: 2024-01-12
Post by john-robinson on Limiting Memory Access of an Array to Within its Bounds
CODESYS Forge
talk
(Post)
Recently we had an issue regarding some simple code to calculate a rolling average. The code indexes from zero to 199 to properly store the current input into a circular buffer which then allows us to calculate a rolling average: VAR input_5s : REAL; outs_arr : ARRAY[0..199] OF REAL; i : USINT := 0; END_VAR ___ //this code runs every five seconds, calculating a rolling average outs_arr[i] := input_5s; i := i + 1; output := OSCAT_BASIC.ARRAY_AVG(ADR(outs_arr), SIZEOF(outs_arr)); IF i >= SIZEOF(outs_arr) THEN i := 0; END_IF There is a simple bug in this code where the index will be set to 0 when it has surpassed the length of the array in bytes (800 in this case) rather than larger than the number of reals in the array (200). The solution here is simple, replacing i >= SIZEOF(outs_arr) with i >= SIZEOF(outs_arr)/SIZEOF(outs_arr[0]). In this example when the index increased to 201 and the line outs_arr[201] := input_5s was called, codesys arbitrarily wrote to the address in memory that is where outs_arr[201] would be if the array was that long. I would like to find a way to wrap the codesys array inside of a wrapper class that checks if an input is within the bounds of an array before writing to that value. I know how I would implement that for a specific array, I could create a method or class that takes an input of an array of variable length, ie. ARRAY[*] OF REAL, but I don't know how to make this for any data type. I am wondering if anyone has ever done anything similar to this, or has any better suggestions to ensure that none of the programmers on this application accidentally create code that can arbitrarily write to other locations in memory.
Last updated: 2024-03-05
Network Variable List in Codesys 3.5 on CAN
CODESYS Forge
talk
(Thread)
Network Variable List in Codesys 3.5 on CAN
Last updated: 2023-08-05
Importing variable list from Excel into Codesys
CODESYS Forge
talk
(Thread)
Importing variable list from Excel into Codesys
Last updated: 2018-03-21
Visualization "F" Key not Reseting Variable
CODESYS Forge
talk
(Thread)
Visualization "F" Key not Reseting Variable
Last updated: 2018-01-18
Visualisierungs-Element bei Variable=FALSE unsichtbar schalten
CODESYS Forge
talk
(Thread)
Visualisierungs-Element bei Variable=FALSE unsichtbar schalten
Last updated: 2019-06-24
DT Variable in der CoDeSys Visualisierung anzeigen lassen
CODESYS Forge
talk
(Thread)
DT Variable in der CoDeSys Visualisierung anzeigen lassen
Last updated: 2016-04-28
Alarm Management - latched variable represented as Text list
CODESYS Forge
talk
(Thread)
Alarm Management - latched variable represented as Text list
Last updated: 2023-11-07
Variable indicating axis pending gearing or camming
CODESYS Forge
talk
(Thread)
Variable indicating axis pending gearing or camming
Last updated: 2023-11-28
Saving variable values on power cycle (RevPi Connect)
CODESYS Forge
talk
(Thread)
Saving variable values on power cycle (RevPi Connect)
Last updated: 2023-12-04
Adding a variable from text list into ST code
CODESYS Forge
talk
(Thread)
Adding a variable from text list into ST code
Last updated: 2023-12-07
Adding a variable from text list into ST code
CODESYS Forge
talk
(Thread)
Adding a variable from text list into ST code
Last updated: 2023-12-07
Importing variable list from Excel into Codesys
CODESYS Forge
talk
(Thread)
Importing variable list from Excel into Codesys
Last updated: 2017-04-18
kopieren einer INt Variable in einer Funktion
CODESYS Forge
talk
(Thread)
kopieren einer INt Variable in einer Funktion
Last updated: 2010-08-27
How to create Network Variable by Script
CODESYS Forge
talk
(Thread)
How to create Network Variable by Script
Last updated: 2017-12-08
Defining two variable in one rectangle box in Visualization
CODESYS Forge
talk
(Thread)
Defining two variable in one rectangle box in Visualization
Last updated: 2017-04-22
Execute a external program when variable change true/false
CODESYS Forge
talk
(Thread)
Execute a external program when variable change true/false
Last updated: 2015-06-17
bestimmen, ob eine Variable Input, Output oder Merker ist
CODESYS Forge
talk
(Thread)
bestimmen, ob eine Variable Input, Output oder Merker ist
Last updated: 2009-01-15
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
.