bradp Posted July 22, 2008 Share Posted July 22, 2008 If I use a local variable in a script PLC or motion program can I see its value in the IDE watchwindow? Link to comment Share on other sites More sharing options...
bradp Posted July 22, 2008 Author Share Posted July 22, 2008 [quote=brad] If I use a local variable in a script PLC or motion program can I see its value in the IDE watchwindow? [/quote] There is a structure associated with each script PLC and motion program to view data for that program. Local variables are called "L" variables and they are part of the structure. If you made the following PLC Open PLC 3 L5=L5+1 Close Then the structure "Plc[3].Ldata.L[5]" will contain the value of the variable and can be used in the IDE watch window. A corresponding structure exists for motion programs "Prog[n].Ldata.L[n]" where "n" are the index numbers. If the IDE auto assignment of variable names was used then your PLC would be something like the following. Open PLC 3 local MyVar MyVar = MyVar + 1 Close In this case the intellisense in the IDE will have the structure Plc.3.MyVar which you can use in any IDE window that supports intellisense. Link to comment Share on other sites More sharing options...
DT-Europe Posted August 20, 2008 Share Posted August 20, 2008 This is not working (anymore?) with the actual firmware (23. June) and IDE (0.5(B1)). Is there another way to use it now? **************************************************** If the IDE auto assignment of variable names was used then your PLC would be something like the following. Open PLC 3 local MyVar MyVar = MyVar + 1 Close In this case the intellisense in the IDE will have the structure Plc.3.MyVar which you can use in any IDE window that supports intellisense. **************************************************** Link to comment Share on other sites More sharing options...
sbrun Posted April 2, 2010 Share Posted April 2, 2010 Really, neither : Prog[n].Ldata.L[n] or Plc.3.MyVar seems to work. Is there something else to do to see local variables ? Link to comment Share on other sites More sharing options...
Recommended Posts