JeffLowe Posted April 3, 2009 Posted April 3, 2009 In Global Definitions.pmh I have a user variable defined as: [code]Ptr OutputWord1->u.user:$4.0.32; // Front Panel 1 Output[/code] My plcs use these fine and share them, but I don't understand how to add them to the watch window. Adding local variables is easy with the PLC.n. structure, but globals give me a syntax error. Thx.
Sina.Sattari Posted April 4, 2009 Posted April 4, 2009 Jeff, The global, csglobal and ptr variables can be used just by calling their name in any of the script PLCs or motion programs. However, if you want to access them through the watch window or the terminal window, you should call them with complete structure name: [code]Ptr.OutputWord1 Global.MyVar1 CSGlobal[3].MyCSVar[/code] First line will show the content of the memory pointed to by your pointer, the second one will report the value of the global variable MyVar1 and the third one shows the value of MyCSVar in coordinate system 3 (CS numbers starts from 0)
Recommended Posts