Search talk: real to array

 
<< < 1 .. 7 8 9 10 11 .. 219 > >> (Page 9 of 219)

Real Data Type Range limitation CODESYS Forge talk (Thread)
Real Data Type Range limitation
Last updated: 2010-03-26

Reading REAL values; PROFINET communication CODESYS Forge talk (Thread)
Reading REAL values; PROFINET communication
Last updated: 2019-04-24

Real-Zahl mit einer Kommastelle darstellen CODESYS Forge talk (Thread)
Real-Zahl mit einer Kommastelle darstellen
Last updated: 2010-11-21

Real activate with bool CODESYS Forge talk (Thread)
Real activate with bool
Last updated: 2011-12-02

Post by alessandro on SysMemCmp SysMemCpy CODESYS Forge talk (Post)
VAR Data1:ARRAY[1..10] OF SINT ; Data2:ARRAY[1..10] OF SINT ; Data3:ARRAY[1..10] OF SINT ; Data4:ARRAY[1..10] OF SINT ; ex_1 : BOOL ; ex_2 : BOOL ; enable : BOOL :=0 ; END_VAR // PROGRAM // The scope of this example is compare and copy the values of two ARRAY only if some value is different using SysMemCmp and SysMemCpy. // In this 2 example we don't use a FOR cicle for do this, and pBuffer1 and pBuffer2 is just a pointer to ARRAY. See details in Library util.SysMem of Codesys // The compare funcion util.SysMem.SysMemCmp is bidirectional if Data1 chanege respect Data2 ex_1 go to 1 and if Data2 change respect Data1 also // but the copy function util.SysMem.SysMemCpy work only from source ARRAY pSrc:=ADR(Data1) to destination ARRAY pDest:=ADR(Data2) // Example 1 Full ARRAY compare and copy // This compare 2 different equal ARRAY and if there is some difference ex_1 go to 1 and if you give enable he copy Data1 in Data2 ex_1 := TO_BOOL(util.SysMem.SysMemCmp(pBuffer1:=ADR(Data1), pBuffer2:=ADR(Data2), udiCount:=SIZEOF(Data1))); IF ex_1 AND enable THEN util.SysMem.SysMemCpy(pDest:=ADR(Data2), pSrc:=ADR(Data1), udiCount:=SIZEOF(Data1)); END_IF // Example 2 Only selected area of the ARRAY compare and copy // This compare 2 different equal ARRAY starting from position number [3] for 4 byte in this case start at position [3] and finish at position number [6] // and if there is some difference only in area [3..6] of the ARRAY ex_2 go to 1 if you give enalbe he copy Data3[3..6] in Data4[3..6] // if something change in other array position[0..2] or [7..10] are ingnored ex_2 := TO_BOOL(util.SysMem.SysMemCmp(pBuffer1:=ADR(Data3[3]), pBuffer2:=ADR(Data4[3]), udiCount:=4)); IF ex_2 AND enable THEN util.SysMem.SysMemCpy(pDest:=ADR(Data4[3]), pSrc:=ADR(Data3[3]), udiCount:=4); END_IF // Attention udiCount input is intended in <byte> in the example 1 I pass to udiCount:=SIZEOF(Data1) for compare and copy the intere ARRAY and // SIZEOF pass the size of intere ARRAY in byte to the function input, in this 2 examples I used variable type SINT each one occupie 1 byte and one position in the ARRAY // and in the example 2 I pass udiCount:=4 for compare and copy only 4 position of Data3/4[3..6] if you want to extend this example and use it for an ARRAY OF WORD // remember that each WORD will occupe 2 byte (16 bit) and you will have to pass udiCount:=SIZEOF(Data1) if you need to compare intere ARRAY example 1 // but need udiCount:=(42) for the example 2 because need to compare and copy 4 word each occupie 2 byte (16 bit). // For REAL (32 bit) need udiCount:=SIZEOF(44) for LREAL or (64 bit) need udiCount:=SIZEOF(416) // a good rule is calculate the dimension of the ARRAY in byte without empty space at the end, multiple of data type number for variable bigger then 8 bit // Example : If you want to create an ARRAY for 5 REAL (32 bit) each occupie 4 byte the correct size is ARRAY[0..19] OF REAL 54=20 position. // NOTE : In the example the position of compare function util.SysMem.SysMemCmp is first and the copy function util.SysMem.SysMemCpy inside the IF is after // in one cycle of the program the two array is compared and if there is some difference and enable are copied. // If you move util.SysMem.SysMemCmp after the IF cycle he will copare the ARRAY in the current cycle but the copy of the value will do in the next cycle.</byte>
Last updated: 2025-10-24

2D array , data move from a column to another column CODESYS Forge talk (Thread)
2D array , data move from a column to another column
Last updated: 2011-03-23

How to read SD card data and store in array CODESYS Forge talk (Thread)
How to read SD card data and store in array
Last updated: 2012-11-26

Passing an I/O Array to a Function or Function Block CODESYS Forge talk (Thread)
Passing an I/O Array to a Function or Function Block
Last updated: 2015-05-07

Visualization - writing to an array using a variable for the index CODESYS Forge talk (Thread)
Visualization - writing to an array using a variable for the index
Last updated: 2019-01-18

Extract 4 bytes from array of bytes to save in decimal value (int?) CODESYS Forge talk (Thread)
Extract 4 bytes from array of bytes to save in decimal value (int?)
Last updated: 2022-01-11

Cannot pass array of constant size to a function as a reference CODESYS Forge talk (Thread)
Cannot pass array of constant size to a function as a reference
Last updated: 2024-01-09

Post by sangram on Convert Array Of DINT To STRING CODESYS Forge talk (Post)
Last updated: 2023-12-03

Is it possible to link an array of bits to an alarm group to show a lot of alarms at once? CODESYS Forge talk (Thread)
Is it possible to link an array of bits to an alarm group to show a lot of alarms at once?
Last updated: 2021-07-08

How do I pass a array throught a function and return an array - Pointers CODESYS Forge talk (Thread)
How do I pass a array throught a function and return an array - Pointers
Last updated: 2018-04-16

Initialize an array of structures with a content of an array CODESYS Forge talk (Thread)
Initialize an array of structures with a content of an array
Last updated: 2020-05-18

Sorting array of any-sized structure CODESYS Forge talk (Thread)
Sorting array of any-sized structure
Last updated: 2023-08-18

Oscat Basic - Array sort function CODESYS Forge talk (Thread)
Oscat Basic - Array sort function
Last updated: 2021-06-25

combo box array - not working? CODESYS Forge talk (Thread)
combo box array - not working?
Last updated: 2016-06-22

Funktion - Pointer auf variables Array CODESYS Forge talk (Thread)
Funktion - Pointer auf variables Array
Last updated: 2017-09-26

Vergleich von Array- und Struktur-Variablen? CODESYS Forge talk (Thread)
Vergleich von Array- und Struktur-Variablen?
Last updated: 2007-05-18

How extract JSONElement containing Array data CODESYS Forge talk (Thread)
How extract JSONElement containing Array data
Last updated: 2024-07-30

Reverse bytes in an array CODESYS Forge talk (Thread)
Reverse bytes in an array
Last updated: 2024-08-22

Reverse bytes in an array CODESYS Forge talk (Thread)
Reverse bytes in an array
Last updated: 2024-08-22

string as array of bytes CODESYS Forge talk (Thread)
string as array of bytes
Last updated: 2021-11-30

FEHLER: Falscher Index fΓΌr Array! CODESYS Forge talk (Thread)
FEHLER: Falscher Index fΓΌr Array!
Last updated: 2007-08-06

<< < 1 .. 7 8 9 10 11 .. 219 > >> (Page 9 of 219)

Showing results of 5470

Sort by relevance or date