Programm in V3 geschrieben in V2.3 öffnen?
CODESYS Forge
talk
(Thread)
Programm in V3 geschrieben in V2.3 öffnen?
Last updated: 2010-09-20
Userlevel Fehlerhaft in Webvisu aber in HMI OK ?
CODESYS Forge
talk
(Thread)
Userlevel Fehlerhaft in Webvisu aber in HMI OK ?
Last updated: 2009-02-09
Device in Repository but not in add Device
CODESYS Forge
talk
(Thread)
Device in Repository but not in add Device
Last updated: 2021-09-29
Only Option in "PLC_PRG in" is Structured Text
CODESYS Forge
talk
(Thread)
Only Option in "PLC_PRG in" is Structured Text
Last updated: 2023-03-22
Bool turning on in case stament in wrong state?
CODESYS Forge
talk
(Thread)
Bool turning on in case stament in wrong state?
Last updated: 2023-12-16
CAN Tags in Writing in PLC Error.
CODESYS Forge
talk
(Thread)
CAN Tags in Writing in PLC Error.
Last updated: 2024-04-02
Opening PDF in Web Browser in Target Visu HMI
CODESYS Forge
talk
(Thread)
Opening PDF in Web Browser in Target Visu HMI
Last updated: 2024-07-11
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
Post by spiessli on Softmotion axis to CANopen Maxon IDX drive
CODESYS Forge
talk
(Post)
Just verified the behaviour. Still is the same. It should be attached here. But I also tried the DCF-file with the axis in the lab with the real drive: The MC_Power block never goes out of busy. Had not time to investigate further, though.
Last updated: 2024-01-08
Post by calviniscoding on Publish a JSON payload via MQTT Publish (using IIot Libraries)
CODESYS Forge
talk
(Post)
Are you able to dynamically change the JSON message? As in, if wsValue or iValue is linked to some real telemetry that varies over time, will the JSON message reflect these changes? I am only able to send the values that I initialize the JSON message to
Last updated: 2024-06-18
Schaltflächen in Visualisierung
CODESYS Forge
talk
(Thread)
Schaltflächen in Visualisierung
Last updated: 2023-09-05
VIDEO IN WEBVISU
CODESYS Forge
talk
(Thread)
VIDEO IN WEBVISU
Last updated: 2023-05-21
logging option in CODESYS?
CODESYS Forge
talk
(Thread)
logging option in CODESYS?
Last updated: 2020-06-29
SFC comments in program
CODESYS Forge
talk
(Thread)
SFC comments in program
Last updated: 2016-12-05
Auto Declare in SP14
CODESYS Forge
talk
(Thread)
Auto Declare in SP14
Last updated: 2019-05-14
Doubt in ADR
CODESYS Forge
talk
(Thread)
Doubt in ADR
Last updated: 2009-03-17
Systemereignisse in V3
CODESYS Forge
talk
(Thread)
Systemereignisse in V3
Last updated: 2009-01-21
Exceptions in codesys WagoPFC200
CODESYS Forge
talk
(Thread)
Exceptions in codesys WagoPFC200
Last updated: 2020-10-24
Email In CoDeSys
CODESYS Forge
talk
(Thread)
Email In CoDeSys
Last updated: 2011-08-16
Profibusdaten in Struktur lesen
CODESYS Forge
talk
(Thread)
Profibusdaten in Struktur lesen
Last updated: 2010-02-02
Enum in Visu
CODESYS Forge
talk
(Thread)
Enum in Visu
Last updated: 2017-04-13
OSCAT in english
CODESYS Forge
talk
(Thread)
OSCAT in english
Last updated: 2007-09-28
.append in ST
CODESYS Forge
talk
(Thread)
.append in ST
Last updated: 2017-03-29
Kippschalter in Visualisierung
CODESYS Forge
talk
(Thread)
Kippschalter in Visualisierung
Last updated: 2012-08-23
Variablen in excel
CODESYS Forge
talk
(Thread)
Variablen in excel
Last updated: 2012-11-10
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
.