![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
|
S7 - Index for Array Variables in ProTool
I've started moving my Tags into Array Variables in ProTool and right at the start I got an error message when I tried to store a Variable with an index of 0. I changed the Index to 1 and was then able to save it OK.
After modifiying about 50 odd tags, I noticed that having clicked on Array Variable as the type and then choosing the Array, the Index defaulted to zero. Thinking "That's funny" i decided to try saving it again - and this time it worked! Can somebody please tell me whether Array Variables in ProTool start their Indexes from 1, or like virtually every other S/W I know, from 0. There's no mention of it in either the Help file or the ProTool manual. |
|
|
|
#2 |
|
Member
|
I might have known things were going too smoothly to be true!
While setting up my Array-Variables for the voltage indicator inputs which show whether or not the capacitors are under 50V or not, I was a bit puzzled to see that when I open up the Array element window to set the Index, the default was set to the last value which I had input for the previous variable, as in this screen-dump:
I didn't worry too much about it, just changed it and carried on. After I was finished I went back to check that everything was OK and discovered that now all the variables have the same Index - the last one I entered! This reminds a bit of the problems I had when I first started to fathom out how the Multiplex Variables work and initially was looking at them completely the wrong way round. I wonder if I'm doing something similar here? In Step7, in the Symbol Table I've created a few MDs one of which is called MPX_KONDENSATOR (MD400) and in an FB I copy the IDxx DWORD of the Indicator inputs (there are 28 capacitors in each module) to this MD400. In ProTool I've created a PLC Variable ARRAY_INDIKATOR of Type Array element. When I open this up to work on it I have two Parameters: Arrayvariable, to which I've assigned MD400 and Index, to which I'm trying to assign the individual input from 0 - 27 (I came to the conclusion that ProTool Indexes probably do also start from zero, although I've not confirmed it yet!). However, as I say after entering them all, all the variables have the same index - the last one entered! Anybody any ideas! |
|
|
|
#3 |
|
Member
|
Siemens Hotline replies at last!
Finally got the call-back from the Siemens - and had the problem solved within about ten seconds.
As I suspected I was making exactly the same mistake I made when I started trying to use the MPX-Variables and was getting my naming back to front. I suppose I should have spotted it straight away and the name "Arrayelement" did irritate me a bit as well, with the benefit of hind sight it is now obvious that each object needs to have a different name in "Arrayelement" - Net saving in variable names as compared to using MPX-Variables - nill! However I've got my saving of over 500 Tags that I need because I'm now multiplexing in the PLC, so I now only need 28 tags instead of 588. Just leaves me pondering the question, why do they offer both possibilities - Multiplexvariables and Arrayvariables - and what exactly is the difference between them? ![]() Edit: just squeezing in at the end of the edit window. It's slowly dawning on me what the difference is, although I'm not sure if I can put it into words yet! The two complement each other: First attempt at describing it - Arrayvariables allow you to access different Bits in one Variable, Multiplexvariables allow you access the (same?) Bit in different Variables. That is also why an Arrayvariable only has one entry and a Multiplexvariable has many. Anybody understood that? Last edited by RMA; August 26th, 2005 at 04:51 AM. |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| S7 - using Arrays with Multiplex Addressing in ProTool | RMA | LIVE PLC Questions And Answers | 4 | August 12th, 2005 07:39 AM |
| S7 - Multiplex Variables in ProTool again! | RMA | LIVE PLC Questions And Answers | 9 | May 3rd, 2005 10:11 AM |
| S7 - Multiplex Variables in ProTool Pro | RMA | LIVE PLC Questions And Answers | 0 | May 3rd, 2005 06:40 AM |
| S7 - Archiving variables in ProTool Pro | RMA | LIVE PLC Questions And Answers | 3 | April 15th, 2005 06:20 AM |
| S7 224 - Storing String variables in a program | ltrail | LIVE PLC Questions And Answers | 4 | November 30th, 2004 06:18 PM |