how use / convert I/O name or address from array (of strings or other)
CODESYS Forge
talk
(Thread)
how use / convert I/O name or address from array (of strings or other)
Last updated: 2023-01-05
an element of "Array of BOOL" in SFC Action name
CODESYS Forge
talk
(Thread)
an element of "Array of BOOL" in SFC Action name
Last updated: 2008-05-05
Table Control on an array using a constant for its size.
CODESYS Forge
talk
(Thread)
Table Control on an array using a constant for its size.
Last updated: 2016-01-08
BUG: Why does I get garbage values when I use CONCAT and Array with CAA File?
CODESYS Forge
talk
(Thread)
BUG: Why does I get garbage values when I use CONCAT and Array with CAA File?
Last updated: 2019-07-04
Fehler C0178 Externer Zugriff auf VAR_IN_OUT-Parameter "Array" von einem FB
CODESYS Forge
talk
(Thread)
Fehler C0178 Externer Zugriff auf VAR_IN_OUT-Parameter "Array" von einem FB
Last updated: 2023-08-01
Function block with an array of unknown size as a VAR_IN_OUT
CODESYS Forge
talk
(Thread)
Function block with an array of unknown size as a VAR_IN_OUT
Last updated: 2017-03-07
How I should define a huge size byte array in CoDeSys V3?
CODESYS Forge
talk
(Thread)
How I should define a huge size byte array in CoDeSys V3?
Last updated: 2013-08-30
How can i read data from a file into an array?
CODESYS Forge
talk
(Thread)
How can i read data from a file into an array?
Last updated: 2021-08-09
Post by peterned on Array to String
CODESYS Forge
talk
(Post)
max. string length in Codesys is 255 chars. It's not possible to cram 20,000 things in a string. If you need to send the data to another device, send the whole data[] array (as byte array, without doing anything to it) and extract the information on the other end. As each struct member has a fixed size (81 bytes, as per you declaration), this will be easy. To save some resources, consider declaring string lengths - e.g. if the max possible length for key is 10 chars, declare it key: STRING(10); and it will occupy 11 bytes instead of 81
Last updated: 2024-07-20
Post by liamb on Converting CANbus to Decimal from signed 2's complement
CODESYS Forge
talk
(Post)
I need to combine two 8 bit CANbus messages to 16 bits signed int then convert to decimal Decimal from signed 2's complement. I've been using the below code to read for new messages, combine them then assign them to a variable What is the best way to do this for from signed 2's complement? fbRxMessage351(Data := RxMessage351Data); IF fbRxMessage351.NewMessage THEN ChargeVoltage := (WORD_TO_REAL((RxMessage351Data[0]) + ((RxMessage351Data[1]) * 256))) * 0.1; END_IF
Last updated: 2024-08-16
Post by janderson on OPC UA Server limitations, large array crashes runtime
CODESYS Forge
talk
(Post)
when using an array of structs, the runtime crashes. but when using an array of LREALS, it'll do 100k at least
Last updated: 2023-08-23
Post by timvh on Array of Program
CODESYS Forge
talk
(Post)
You cannot create an array of Programs. Create a Function Block for this purpose instead of a program. You can create an array of FB instances and call each instance in a loop.
Last updated: 2024-09-03
Post by simover on TCP/IP client
CODESYS Forge
talk
(Post)
I want to send a string to a tics TCP/IP server. I got i working with the Net Base lib. for communication good with this tcis i need to by array of byte I want to include a string in the third position of the array TCIS_Send[1] :=254; //this valus is fix for evry communication TCIS_Send[2] :=80; //this valus is fix for evry communication TCIS_Send[3] := ; here I put my and my string is lik this 5806509-DRAP10#AB#3452302073 TCIS_Send[4] :=252; //this valus is fix for evry communication
Last updated: 2023-12-18
Post by timvh on Array to String
CODESYS Forge
talk
(Post)
The string_Util_Intern is not the library I referred to. With a CONCAT function (also with the string util library) a search is done for the NULL character. If you concatenate 20000 characters to one string, then the longer the string, the longer it takes to find this NULL character.
Last updated: 2024-07-24
How to use matlab to send parameters to codesys
CODESYS Forge
talk
(Thread)
How to use matlab to send parameters to codesys
Last updated: 2018-10-10
Post by apurv on Cannot pass array of constant size to a function as a reference
CODESYS Forge
talk
(Post)
Could not find the solution to this issue but I have side stepped this by creating a global variable MAX_SIZE.
Last updated: 2024-01-08
Post by kuuki on Losing focus of variable
CODESYS Forge
talk
(Post)
Hi. Does anyone know how to fix a problem with losing focus of a variable in FBD editor. Sometimes when trying to edit variable name, array index, etc. in network, editor randomly exits "text edit mode" and variable is replaced by text you were typing.
Last updated: 2024-03-26
Post by drml on Array to String
CODESYS Forge
talk
(Post)
If a size is not specified, CODESYS allocates 80 characters by default for a string. After 7 seconds, does your Json_string contain all of your 20000 key/values? Or is the result truncated to 80 characters?
Last updated: 2024-07-19
Post by mmpl on Array to String
CODESYS Forge
talk
(Post)
Hi Thank you for you reply. Yes I can concatenat longer string. I am using string_Util_Intern libraray for concat. The issue is abot plc performance. It takes 7 second. I am looking to improve time.
Last updated: 2024-07-23
Post by simotion on Pointer to Softmotion axis
CODESYS Forge
talk
(Post)
In my projet I use Softmotion. There are several Softmotion axis (type SM_Drive_Virtual). In the Global Variable List I have an array of pointers to the adress of the Axis. Axis : ARRAY[1..iMaxCntAxes] OF POINTER TO AXIS_REF_SM3 := ADR(AX01_Axis), // [1 ADR(AX02_Axis), // [2] This works, but when compiling I get the message : . [WARNING] E3D: GVL Device: PLC Logic: Application: C0564: A reference to uninitialized variable AX01_Axis is used for initialization of Axis. Accessing the uninitialized variable may result in unexpected behavior. [WARNING] E3D: GVL Device: PLC Logic: Application: C0564: A reference to uninitialized variable AX02_Axis is used for initialization of Axis. Accessing the uninitialized variable may result in unexpected behavior. Is there a way when initializing to force the hardware (softmotion axis) to first initialize and then the Global Variable List?
Last updated: 2023-10-25
Post by squale on URL jumps between different visualizations behind a reverse proxy
CODESYS Forge
talk
(Post)
Hi kevinrn, I have the same question as yours. On my side I try to make nginx work but it doesn't goes well. I think the sub_filter doesn't work int this case.
Last updated: 2024-07-26
Post by macros8 on Alarm Management - latched variable represented as Text list
CODESYS Forge
talk
(Post)
Hi, I haven´t noticed you put the comment here. I thing it´s a bit different. What I want is to have detail errors of technology in data type e.g. INT. This variable I would latch to the corresponding error msg but I would like to get it convert to text from the text list and not keep it in INT form. Example. Main error Valve Error: SubErrors 1 - Both sensors 2 - Not retracted in time 3 - Not pulled out in time In HMI Main error + latch SubErrors => "Valve Error: Both sensors" The benefit is that text lists are part of translation and can be easily manipulated. I know I can create whole string msg in PLC but then, it lose advantage of Alarm management. Thanks. M.
Last updated: 2023-11-07
Post by mondinmr on Jitter problems on imx8
CODESYS Forge
talk
(Post)
SOLVED!!! In this imx8 max_cstate=1 in kernel boot parameters is not working! We found a workaround: #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <stdint.h> int main(void) { int fd; uint32_t value = 0; fd = open("/dev/cpu_dma_latency", O_WRONLY); if (fd < 0) { perror("Error opening /dev/cpu_dma_latency"); return 1; } if (write(fd, &value, sizeof(value)) != sizeof(value)) { perror("Error writing to /dev/cpu_dma_latency"); close(fd); return 1; } while (1) { pause(); } } This simple code launched before CODESYS do the same work! Now jitter is identical as measured by cyclictest!
Last updated: 2023-10-19
Post by garmusd on Raspberry Pi 5 GPIO not working.
CODESYS Forge
talk
(Post)
Hi, Codesyscontrol 4.13.0.0 Raspberry Pi5 64bit with latest updates. Cant get working GPIO - no output and no input. SPI/I2C not tested. GPIOs B+/Pi2, Input/Output is set in the parameters, assigned variables int the Mapping. Absolutely no reaction. Do I need to configure anything else to make it work? Thanks!
Last updated: 2024-09-26
Post by timvh on Converting each character to a string into ASCII
CODESYS Forge
talk
(Post)
Nice puzzle for a Saturday afternoon :-). Here my suggestion: VAR sInput : STRING := 'R123'; byChar : BYTE; sOutput : STRING; i: INT; END_VAR sOutput := ''; IF LEN(sInput) = 0 THEN RETURN; END_IF FOR i := 0 TO LEN(sInput) - 1 DO byChar := sInput[i]; sOutput := Concat(sOutput, TO_STRING(byChar)); END_FOR
Last updated: 2024-11-09
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
.