LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting the connection of Debug Application tool

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".

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 11
(1,247 Views)

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

Message 2 of 11
(1,236 Views)

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.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 11
(1,233 Views)

Debug Server.png

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.

Message 4 of 11
(1,162 Views)

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.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 11
(1,129 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 11
(1,112 Views)

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.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 7 of 11
(1,088 Views)

@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.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 8 of 11
(1,069 Views)

Is it possible to identify the connection from looking at the debug port (cmd /c "netstat -ano | findstr :3580")?

netstat port 3580.png

I have not a second computer at hand to test and looking at localhost (0.0.0.0) does not help.

0 Kudos
Message 9 of 11
(1,013 Views)

@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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 10 of 11
(1,009 Views)