4/18/2011 7:46 AM | |
Posts: 241 Rating: (7) |
Dear Darius, Thanks for initiative. I have attached my test program here. I have very strange problem in OB1, you can see my description. Latching does work with Local variable when I dont call FB71in OB1 even when I call FB70, which also calling the FB71.Is not it strange. FB70 used START variable, FB71 uses Local variable, all FC using Local variable. I am not sure what is the exact secrete about S7 Local Variable in Fb and FC? AttachmentLocalvariable.zip (273 Downloads) |
Last edited by: PowerTags at: 4/18/2011 7:47 AMattachement. |
|
4/18/2011 9:43 AM | |
Posts: 241 Rating: (7) |
Dear Darius, I know that much what you are saying.I understand what is STAT and Local memory in the FB or FC. But I have confusion over Local variable used to latch a coil. This Standard Block used in many Project previously as claimed by my friend. I only involved myself with this when see my friend is stugling over this FC/FB, when one FB [FB71 here] is bypassed logic is working when it is not bypassed it is not working. So what is that causes the problem? Please see the attachement in previous reply. [ the Program is to simulate the problem and concept] And for info. I also recomending my friend not to use Local Variable for Latching purpose and local variables are not useful once the block is executed and exited from the Block. |
4/18/2011 11:58 AM | |
Joined: 10/7/2005 Last visit: 4/24/2024 Posts: 3004 Rating: (1046)
|
Hello PowerTags When using temporary variables, remember that they are only valid within the relevant block or are only available as previous local data for other blocks called in this block.
|
Last edited by: fritz at: 4/19/2011 1:50 AMLast edited by: fritz at: 4/18/2011 12:03 PMuploaded pic Last edited by: fritz at: 4/18/2011 12:01 PMfixed typos Cheers |
|
This contribution was helpful to8 thankful Users |
6/22/2011 12:11 PM | |
Posts: 1 Rating: (0) |
Hi PowerTags, As fritz mentioned , you should not use temporary variables for Set or Reset or to latch something. Temporary variables are really temporary meaning they just work in one cycle and for the next cycle they won't keep the values! It could be really misleading in a way that they could work sometimes and not some other times. As I checked your program , in FC70 you are using temp variable (latchit) or (SetIt) to store memory which is not correct. If you want to use FC and have memory like this you need to use IN_OUT variable instead. Temporary variables are just usable for cases where you use the result in the same cycle! For example you can add to values and store it in a temp variable, temp1, and use temp1 in next network to convert it to "Real" for example. Please let me know if your need more help. Best Mostafa Samadimaleh |
Last edited by: Mostafa.Samadimaleh at: 6/22/2011 12:16 PMLast edited by: O_Moderator at: 6/22/2011 12:12 PMcontact data deleted |
|
Follow us on