Post by leon78 on Codesys 3.5 SP17 Patch 2 CheckBounds (POUs for Implicit Checks)
CODESYS Forge
talk
(Post)
Hello! I use CheckBounds (POUs for Implicit Checks). But I have a problem. I use an array as an VAR_IN_OUT of Function Block. If I try to monitor the array of variable length ([* ]), its does't work. The CheckBounds POU isn't called. If I use the array of fixed lenght ([lower..upper]), the CheckBounds POU is called. Why?
Last updated: 2023-11-14
Post by leon78 on Codesys 3.5 SP17 Patch 2 CheckBounds (POUs for Implicit Checks)
CODESYS Forge
talk
(Post)
Hello! I use CheckBounds (POUs for Implicit Checks). But I have a problem. I use an array as an VAR_IN_OUT of Function Block. If I try to monitor the array of variable length ([* ]), its does't work. The CheckBounds POU isn't called. If I use the array of fixed lenght ([lower..upper]), the CheckBounds POU is called. Why?
Last updated: 2023-11-14
Post by alexgooi on Init Array input on a method
CODESYS Forge
talk
(Post)
Dear Forum, I would like to initialize an array input on a method. When I do this, I get the following error: "The type of ARRAY [1..2] OF BOOL cannot have a default value in this context." I attached a picture for more clarity. Is this simply not possible or is there a different way of tackling this problem? Thank you in advance
Last updated: 2024-02-26
Post by janber on REFERENCE TO in an array
CODESYS Forge
talk
(Post)
Hi all, in the online help it written, that array of reference to data type is not possible. Ok... but if I create array of struct of reference to - everything works fine - please see the screenshots: and it works this way OK. Is it intention or error in compiler 3.5.18.20 and we should avoid it? Thanks a lot, Jan.
Last updated: 2024-10-14
Post by szotyi on Array of Program
CODESYS Forge
talk
(Post)
Hi! What is the proper and the easiest way to call programs through looping of array of programs, or pointer of program? instead of calling the programs one by one: prog1(inputX: 11); prog2(inputY: 12); prog3(inputZ: 13); similar like: VAR programsToCall : ARRAY [1..3] OF PROGRAM; END_VAR programsToCall[1] := prog1(inputX: 11); programsToCall[2] := prog2(inputY: 12); programsToCall[3] := prog3(inputZ: 13); FOR i := 1 TO 3 DO programsToCall[i] (); END_FOR Thanks.
Last updated: 2024-08-28
Post by hazarath on How extract JSONElement containing Array data
CODESYS Forge
talk
(Post)
I want to extract each element of an Array. Can someone help me with this. When I use JSONElementToString (part of JSON Utilities SL), I am seeing output as "ARRAY" instead of actual data. Here is the JSON content that I want to read : { "value1Unit": { "units": "M" }, "data": { "stepSize": 300.23, "points": [6,8] } } I would like to read each item of the element "points" i.e. 6 and 8. Here is the code I used, // Reading the content as JSON reader ( xExecute := execute , pwData := ADR ( converted_value ), jsonData := jsonDataStorage ); // Get the JSON Element jsonDataStorage.FindFirstValueByKey( wsKey := fidKeyVar, diStartIndex := searchElem, jsonElement => jsonElement ); JSON.JSONElementToString ( element := jsonElement , wsResult := valueWstring ); The content of the output of valueWstring is shown as "ARRAY" instead of the array items i.e. 6 and 8 Please can someone help me.
Last updated: 2024-07-30
Post by apurv on Cannot pass array of constant size to a function as a reference
CODESYS Forge
talk
(Post)
okay but will this pass the array by copying it or it will be a reference to original array only.
Last updated: 2024-01-09
Post by rjonker on codesys mqtt publish serialization
CODESYS Forge
talk
(Post)
pbPayload is a pointer, which it expects to point at a STRING. If you point it at an address holding a different data type, it will just assume those bytes are part of a string and likely trundle along memory until it finds a null byte (0x00) that would normally signify the end of a string PublishMessage := BOOL_TO_STRING(boolVariable);
Last updated: 2024-06-05
Post by tvm on Cannot pass array of constant size to a function as a reference
CODESYS Forge
talk
(Post)
It will be a reference, because it's a VAR_IN_OUT. it's a little weird debugging the array online. It just shows as a POINTER TO INT, and you can't actually see the array from the function side. But you can still work with it as a normal array, not a pointer.
Last updated: 2024-01-09
Post by corriibme on JSON Utilities and SetArray
CODESYS Forge
talk
(Post)
Hello @florian, Could you please help with how to set an array value? I've been trying to use the with the setKeyWithArray method which creates the key with an empty array value. But I have been unable to set items in this array? objindex:= fb_JBuilder.SetKeyWithArray("Key6", diParentIndex := diRootIndex); objindex2:= fb_JBuilder.SetValue(value:= iValue2, diParentIndex:= objindexx); //iValue: array[0..n] of int; Best regards
Last updated: 2024-05-11
Conversion BYTE to ASCII String + SysLibFileStream.lib
CODESYS Forge
talk
(Thread)
Conversion BYTE to ASCII String + SysLibFileStream.lib
Last updated: 2008-10-31
String type object length in CANopen OD?
CODESYS Forge
talk
(Thread)
String type object length in CANopen OD?
Last updated: 2010-01-09
Specific Data from the device string
CODESYS Forge
talk
(Thread)
Specific Data from the device string
Last updated: 2010-12-06
Why SA0175: Suspicious operation on string: Possible index access
CODESYS Forge
talk
(Thread)
Why SA0175: Suspicious operation on string: Possible index access
Last updated: 2023-06-01
String zusammensetzen der länger als 255 Zeichen ist?
CODESYS Forge
talk
(Thread)
String zusammensetzen der länger als 255 Zeichen ist?
Last updated: 2009-02-19
Converting Variable Symbol name in a STRING
CODESYS Forge
talk
(Thread)
Converting Variable Symbol name in a STRING
Last updated: 2008-12-09
Mathematische Formel aus einem String heraus berechnen
CODESYS Forge
talk
(Thread)
Mathematische Formel aus einem String heraus berechnen
Last updated: 2006-10-07
String to Real und in Bytes aufteilen
CODESYS Forge
talk
(Thread)
String to Real und in Bytes aufteilen
Last updated: 2007-12-05
STRING functions for more than 255 charater
CODESYS Forge
talk
(Thread)
STRING functions for more than 255 charater
Last updated: 2015-01-22
Get a instance name as string variable?
CODESYS Forge
talk
(Thread)
Get a instance name as string variable?
Last updated: 2010-02-27
Create a string by extracting value from a file
CODESYS Forge
talk
(Thread)
Create a string by extracting value from a file
Last updated: 2022-06-26
How to Convert ascii string to real value?
CODESYS Forge
talk
(Thread)
How to Convert ascii string to real value?
Last updated: 2023-02-16
Convert combo box selected items into a string
CODESYS Forge
talk
(Thread)
Convert combo box selected items into a string
Last updated: 2020-04-20
Saving UINT data collected as String data to MMC
CODESYS Forge
talk
(Thread)
Saving UINT data collected as String data to MMC
Last updated: 2007-08-17
String Constants CoDeSys => Tera Term Pro
CODESYS Forge
talk
(Thread)
String Constants CoDeSys => Tera Term Pro
Last updated: 2006-11-07
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
.