Array cleaning in beckhoff

B_BYTE

Member
Join Date
Jan 2014
Location
East
Posts
2
Hello evryone,

I have a question about cleaning an array in my programm (Beckhoff)

How can i delete the values in an array?

It must be set to 0.
 
It sounds like prefer something similar to the "Redim" statement in VB.net, which will set all values to 0 (unless you add "Preserve"). I don't think there is anything similar in PLC Structured Text. I was told that arrays cannot be dynamically dimensioned. It seems you will have to loop thru the array in a For statement and set each term to 0, which takes 3-4 lines of code.
 
This is the fastest and easiest way as you are using pointers and memory addresses:

Code:
MEMSET(ADR(ArrayVariable), 0, SIZEOF(ArrayVariable));

Good luck!
 
joan is fast way, not 61131 anyhow.
see for othe solutions www.oscat.de nice library for codesys.
the best way is to use a loop.
it is not needed as the data will be overwritten when you fill it again, the memory is still occupied. and you can better clear it after use directly.
 

Similar Topics

Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
5
Views
206
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
204
I have an array of 55 REAL values. Is there a way to multiply based on the array location ? I have 55 transfer belts that are equally spaced...
Replies
3
Views
153
Hello everyone, I'm working on a project that involves controlling an array of nozzles within a CNC environment, where the nozzles travel along a...
Replies
5
Views
178
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
429
Back
Top Bottom