Home AMX User Forum NetLinx Studio

Netlinx Debugging

Running Build 2.2.0.84 of NetLinx Studio and since I've gone to this version I've noticed real flakiness in "Watch" while in Debug Mode. Most variables show up in the wrong module when adding from the variable list, and many won't show any information after putting them into the watch window.

For what it's worth, all my code is in modules, I don't put anything in main except DEFINE_MODULE statements.

I know this is probably a tech support issue, but wanted to see if anyone else has experienced this.

Thanks...Sonny

Comments

  • DHawthorneDHawthorne Posts: 4,584
    I've seen it many times. I think it's an artifact of the fact that debug data in the compiled file winds up in a single code block; the segmentation in your source code is artificial. There seem to be times when the debug tokens do not properly identify where the variable comes from.

    One workaround is to drag the variable directly from your source code to the watch window, eliminating the need to choose which one you are watching. Another is to simply write your code so that duplicat names don't turn up. I have been going with the latter, to me it makes it easier to track what is going on anyway.
  • sonnysonny Posts: 208
    Thanks...I didn't know about the drap and drop feature. For the most part I use unique names but that really hampers code re-use. The biggest issue though is nothing showing up in the watch window for certain variables...which are typically defined under a DEFINE_VARIABLE heading, not within a function or subroutine. Any recommendations on variable declarations?

    ...Sonny
  • DHawthorneDHawthorne Posts: 4,584
    I have noticed as well that the debugger doesn't always see variables in the DEFINE_VARIABLE section of a module, though it works fine in the base code. What I generally do is temporarily move variables involved in trouble spots to the main program, and pass them to the module as a parameter so they can be debugged. Once I have my issues sored out, I move them back. Another tactic is to make a virtual device that will parse queries in a STRING event. Then you can just ask for the current variable state via Telnet and have your event send back the value in question. That's only useful for things that don't change rapidly though.
  • One "feature" I've noticed while debuging is that sometimes certain arrays won't show their values until you enable show total length. This was verified as bug from AMX. You could try that and see if that helps things?
Sign In or Register to comment.