Search talk: variable declare keyword

 
<< < 1 .. 12 13 14 15 16 .. 30 > >> (Page 14 of 30)

Post by shamcke on Array with generic constant as persistent variable CODESYS Forge talk (Post)
Hello, I have written a function block that uses a generic constant for the upper bound of an array. I wanted to have this array in the persistent memory area, thus I constructed my FB as follows: FUNCTION_BLOCK FbWithGenericArrayLength VAR_GENERIC CONSTANT uiArrayLength : UINT := 10; END_VAR VAR PERSISTENT arr : ARRAY[1..uiArrayLength] OF INT; END_VAR In my PLC_PRG I declare an instance of said FB PROGRAM PLC_PRG VAR myFb : FbWithGenericArrayLength<10>; END_VAR This compiles just fine. When I let CODESYS fill my persistent list, it adds duplicate entries {attribute 'qualified_only'} VAR_GLOBAL PERSISTENT RETAIN // Generated instance path of persistent variable PLC_PRG.myFb.arr: ARRAY [1..uiArrayLength] OF INT; // Generated instance path of persistent variable PLC_PRG.myFb.arr: ARRAY [1..uiArrayLength] OF INT; END_VAR so I manually delete the duplicate. When i now compile, I get errors ------ Build started: Application: Device.Sim.Device.Application ------- Typify code... [ERROR] Sandbox_FW31: PersistentVars [Device: PLC Logic: Application](Line 4): C0161: Border 'uiArrayLength' of array is no constant value [ERROR] Sandbox_FW31: PersistentVars [Device: PLC Logic: Application](Line 4): Type of mapped variable is not equal to original type Compile complete -- 2 errors, 0 warnings Build complete -- 2 errors, 0 warnings : No download possible Is is simply not possible to use a generic constant for the persistent array? Thanks in advance. Edit: It seems I can manually replace the uiArrayLength in the persisten list by the value 10 I used as the generic constant for this particular instance.
Last updated: 2026-05-29

C0244: No VAR_PERSISTENT list is part of the application to enter instance path for variable CODESYS Forge talk (Thread)
C0244: No VAR_PERSISTENT list is part of the application to enter instance path for variable
Last updated: 2024-07-17

Global variable access by Programms and Modbus Devices (attach device to bus) CODESYS Forge talk (Thread)
Global variable access by Programms and Modbus Devices (attach device to bus)
Last updated: 2024-07-18

How to manage variable types larger than 64 bits - Ethernet/IP CODESYS Forge talk (Thread)
How to manage variable types larger than 64 bits - Ethernet/IP
Last updated: 2024-09-23

how to extract the name of an FB to a variable CODESYS Forge talk (Thread)
how to extract the name of an FB to a variable
Last updated: 2024-10-01

Post by nz-dave on Variable Length Array - Cannot mix variable and fixed length dimensions? CODESYS Forge talk (Post)
VAR CONSTANT size : INT := 10; END_VAR My_Array : ARRAY[1..SIZE , 1..5] OF REAL;
Last updated: 2025-05-26

Making a Visu Element normally invisible and visible if variable is true CODESYS Forge talk (Thread)
Making a Visu Element normally invisible and visible if variable is true
Last updated: 2025-06-06

one variable signed to modbus tcp server device and modbus serial device CODESYS Forge talk (Thread)
one variable signed to modbus tcp server device and modbus serial device
Last updated: 2025-07-17

Assign a value to a variable that is defined in a string CODESYS Forge talk (Thread)
Assign a value to a variable that is defined in a string
Last updated: 2023-02-13

Dynamic variable declaration in a Function Block after the call of FB_Init CODESYS Forge talk (Thread)
Dynamic variable declaration in a Function Block after the call of FB_Init
Last updated: 2016-12-30

how to get a list of the cross reference of one variable CODESYS Forge talk (Thread)
how to get a list of the cross reference of one variable
Last updated: 2018-01-17

How to access the value of a variable held in the previous cycle in ST? CODESYS Forge talk (Thread)
How to access the value of a variable held in the previous cycle in ST?
Last updated: 2021-09-01

Persistent Retain Variable in Codesys - After download and restart the Device undiscoverable CODESYS Forge talk (Thread)
Persistent Retain Variable in Codesys - After download and restart the Device undiscoverable
Last updated: 2022-11-22

WAGO PLC GOES IN ERROR WHILE BOOTING BECAUSE OF PERSISTENT VARIABLE CODESYS Forge talk (Thread)
WAGO PLC GOES IN ERROR WHILE BOOTING BECAUSE OF PERSISTENT VARIABLE
Last updated: 2019-11-22

Reading value of whole struct variable at online mode by script CODESYS Forge talk (Thread)
Reading value of whole struct variable at online mode by script
Last updated: 2020-04-05

Can't add 0.0x to an real variable with no larger than 1048576 ????? CODESYS Forge talk (Thread)
Can't add 0.0x to an real variable with no larger than 1048576 ?????
Last updated: 2018-10-08

Showing nothing instead the %f in case another variable is empty CODESYS Forge talk (Thread)
Showing nothing instead the %f in case another variable is empty
Last updated: 2022-05-19

Access to a GVL and seraching for a variable inside of it (Pyhton) CODESYS Forge talk (Thread)
Access to a GVL and seraching for a variable inside of it (Pyhton)
Last updated: 2022-07-25

Could I change the Visualization page showed by changing a variable? CODESYS Forge talk (Thread)
Could I change the Visualization page showed by changing a variable?
Last updated: 2022-04-04

How to release the memory of a variable in Codesys 2.3 CODESYS Forge talk (Thread)
How to release the memory of a variable in Codesys 2.3
Last updated: 2021-06-06

how to switch language by a variable NOT by mouse event? CODESYS Forge talk (Thread)
how to switch language by a variable NOT by mouse event?
Last updated: 2012-11-25

How to turn on a large number of outputs with 1 variable CODESYS Forge talk (Thread)
How to turn on a large number of outputs with 1 variable
Last updated: 2015-09-07

How to get the clock on the computer to be variable in my pr CODESYS Forge talk (Thread)
How to get the clock on the computer to be variable in my pr
Last updated: 2010-12-08

Problems with multiple variable names when connecting to Simumatik through OPCUA (ControlWin3) CODESYS Forge talk (Thread)
Problems with multiple variable names when connecting to Simumatik through OPCUA (ControlWin3)
Last updated: 2021-05-04

Monitor millisecond timestamps of the codesys variable in Zenon Energy Edition CODESYS Forge talk (Thread)
Monitor millisecond timestamps of the codesys variable in Zenon Energy Edition
Last updated: 2023-05-31

<< < 1 .. 12 13 14 15 16 .. 30 > >> (Page 14 of 30)

Showing results of 743

Sort by relevance or date