Step7 - how to initialise an array at run time?

When i tested, it i got partly filled array. Dont remember what i imput as "filler variable" might have been array of bools. If I remeber correctly help spoke only that when using bools, target must be disiviable by eight.
 
When i tested, it i got partly filled array. Dont remember what i imput as "filler variable" might have been array of bools. If I remeber correctly help spoke only that when using bools, target must be disiviable by eight.
Although I'm only using ten bools, when I created the array as a STAT Step7 automatically allocated two Bytes, so that wasn't a problem.
 
Although I'm only using ten bools, when I created the array as a STAT Step7 automatically allocated two Bytes, so that wasn't a problem.

That is always the case, as array boundary is word. So even if you have myArray[0..1] of bool, it takes space of word.

I made myArray[0..45] of bool, tried to fill it with bool, bool array and one member of bool array. None really worked. I could not even get it to work with myArray[0..7]...

Now I tried it again, using myArray[0..7] and byte as fill value and it worked. So dont know where my error was :D
 
Last edited:

Similar Topics

is there any free trial version available for step7 professional and wincc comfort v17. i searched and downloaded TRIAL Download STEP 7...
Replies
1
Views
100
Hello. I need your help. I work at STEP7. There are two CPU 317-2 PN/DP controllers (317-2EK14-0AB0), working on PROFIBUS, as Master (CPU_1) and...
Replies
6
Views
205
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
194
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
171
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
177
Back
Top Bottom