STEP7 Array initial values.

JesperMP

Lifetime Supporting Member + Moderator
Join Date
Feb 2003
Location
ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts
16,289
I just encountered something that I have never encountered or noticed before:

When I create an Array in a shared DB, i set the initial value.
But in reality only the 1st variable becomes the initial value. All the rest stays at zero.
This is very annoying as I then have to manually set all the other variables initial/actual values.
AND I have to repeat this every time I modify the declaration of the DB.

Anyone seen this ? Or maybe you can confirm that all the variables in an Array get the right initialisation with your version of STEP7.
I have STEP7 Pro V5.4 SP1.
 
Here is a screenshot to illustrate the "mystery":
InitalValuesMystery.GIF
 
It's always been like this as far back as I can remember. If I ever had a large array that needed initialising then I would do it with a bit of code in OB100 and then copy the online db to the offline db, then remove the code (e.g. SFC21 fill). Alternatively generate the db as source code and then do an edit/replace and then compile the source.
 
The comma feature is a sneaky one that most don't know about. I generally use the spreadsheet utility and import my DB's from excel. It's easier just to input in excel and drag and drop a range of variables.


Nick
 

Similar Topics

Hello all.... I'm still coming to terms with Siemens PLC programming after many years of only knowing AB, so be gentle - :rolleyes: I've got an...
Replies
11
Views
4,318
Hi' I am trying to make a "lookup" in an table I have created in an array. My tabel looks like this: 0,920 21,75 200,1 0,00047 0,910 24,99...
Replies
3
Views
3,697
Hey Guys.. Here's my problem. I have an array of 9 characters, a "part number". I need to compare this array to another part number that is...
Replies
10
Views
6,600
Hello, I have created a FB and in the declaration, added an array of bools as a stat and cannot figure out how to add a comment to individual...
Replies
5
Views
3,385
I've got an application where a robot is running 10 objects one after another past a camera so I need to buffer the result of the camera test...
Replies
20
Views
9,314
Back
Top Bottom