4/21/2013 5:37 PM | |
Joined: 3/19/2012 Last visit: 8/27/2025 Posts: 56 Rating:
|
Hello everybody: I have a problem with the initialization of an array: I'm using S7 ver. 5.5, I've a FB and inside the FB I've a multi instance FB in which I have a 2 dimension array which I want to initializate in the declaration of variables. Attached there is the souce file. The 2 dimensions array is basically a table, it has 15X5 elements, the index of the array is a multiplier of a function. example: Irel: ARRAY[0..14;0..4] So, Irel will be something like that 0,32 0,36 0,45 0,50 0,60 0,33 0,39 0,48 0,57 0,65 0,40 0,42 0,51 0,60 0,69 ... ... 12 13 14,9 20,0 25,5 The values of the elements are fixed and all the same, they wouldn't be changed. So I thought to initialize the array in the variable declaration, without writing instruction to move the value to the element of the array. But if I initialize the value in the declaration, I cannot insert that FB as a multi instance FB in another FB, because S7 reports an error. If I declare this FB in the programm, declared in the OB1 instead, S7 let me insert the FB with no errors. I tried to copy and paste the FB, renamed and open it in AWL and in the variable declaration, the column "Initial Value" reports the value I wrote, but they're listed in RED! I don't know what's wrong.... Is there a limit for the declaration of variable initialization? Thanks in advance AttachmentFB_Convert_PKE_SWD.zip (246 Downloads) |
Last edited by: Cimant at: 5/4/2013 11:16 AMLast edited by: Cimant at: 4/28/2013 11:22 AM |
|
Follow us on