1/24/2013 9:47 AM | |
Joined: 10/7/2005 Last visit: 11/1/2024 Posts: 3025 Rating: (1055) |
Hello chriswu first of all, welcome to the Siemens Forum, let's see if we can help you: To start with, Yes, you can use P_Trigin an FC, just not the way you do it. The "Golden rule" for usage of TEMP variablesis: You must initialise them (i.e. WRITE to them before you READ fom them). If you use a TEMP variable as the memory forP_Trig, you do violate this rule. Depending on how you call the FC, it may though stillwork (I'd say unfortunately in this case as it can cause confusion) and you'll find the reasons for this explained in the thread Latching by temporary varibale inside FB or FC- recomended? The solution is to create an IN_OUT variable for the FC, assign an M or DB bit to it when you call the FC anduse it inside the FC as the memory bit for P_Trig. I hope this helps |
Cheers |
|
This contribution was helpful to4 thankful Users |
Follow us on