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

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
149
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
144
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
140
Hi all, I am trying to convert RSLogix 5000 program to Step7. I need to bit shift left my array of double integers for tracking the product on...
Replies
2
Views
527
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
543
Back
Top Bottom