11-06-2023 09:53 AM
When building an application you can "Enable Debugging", which allows the connection of the LabVIEW Debug Application feature to debug a deployed executable.
I was wondering if there was a way to detect the connection of the debugger from within the app itself?
Reason - during development phase I want my deployed app to be aware when a remote connection for debugging is established. Currently it has a frameless (borderless) User Interface which makes it impossible to reveal the block diagram (Ctrl+E doesn't work). If I connect the Debug Application tool it's because I want to debug the code, so I need to see the block diagram. I figured I could either detect the connection of the debugger and automatically show the block diagram, or change the VI properties to show the toolbar and hence allow me to select "Windows > Show Block Diagram".
11-06-2023 10:13 AM
I thought you could just right click the front panel to see the BD in a remote debug session:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHpiCAG&l=en-US
11-06-2023 10:14 AM - edited 11-06-2023 10:19 AM
That doesn't appear to work for me. I am deploying to a cRIO (Linux RT), so the app isn't a standard Windows one. I wonder if this makes a difference to that right-click behaviour? Sadly there's very little documentation on the limitations of this tool to RT targets.
11-06-2023 01:00 PM
The help says: "Determines whether the Debug Server is enabled. You can use this property only in LabVIEW-built applications or shared libraries."
I don't know if this is working the way you are looking for.
11-06-2023 04:40 PM - edited 11-06-2023 04:59 PM
Thanks - I'll do some quick testing to see if that does what I need it to, however I'm not optimistic since it's a writeable property. I wouldn't expect I could write to a variable that tells me when the debug tool is connected, therefore I expect this enables the debug feature.
11-06-2023 05:29 PM
@Thoric wrote:
Thanks - I'll do some quick testing to see if that does what I need it to, however I'm not optimistic since it's a writeable property. I wouldn't expect I could write to a variable that tells me when the debug tool is connected, therefore I expect this enables the debug feature.
Could be that you can set it, but you can also read the status.
11-07-2023 01:37 AM
Maybe accessing this URL: http://localhost:3580/dumpinfo? can give you the desired information.
See https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KvsSAE&l=it-IT for more details.
My guess is that the Connection: field of your application entry would be Open. I don't know if the article also refers to RT environments, but in my opinion it is worth checking.
11-07-2023 04:02 AM
@billko wrote:
@Thoric wrote:
Thanks - I'll do some quick testing to see if that does what I need it to, however I'm not optimistic since it's a writeable property. I wouldn't expect I could write to a variable that tells me when the debug tool is connected, therefore I expect this enables the debug feature.
Could be that you can set it, but you can also read the status.
The value was consistently True. It didn't change to reflect the status of whether the debug tool was connected or not.
11-07-2023 08:33 AM
Is it possible to identify the connection from looking at the debug port (cmd /c "netstat -ano | findstr :3580")?
I have not a second computer at hand to test and looking at localhost (0.0.0.0) does not help.
11-07-2023 08:50 AM
@UliB ha scritto:
Is it possible to identify the connection from looking at the debug port (cmd /c "netstat -ano | findstr :3580")?
I have not a second computer at hand to test and looking at localhost (0.0.0.0) does not help.
3580 is the listening port of the NI Service Locator. As I understood it, The TCP port for debugging is dynamically assigned to each debuggable application.