Jump to content

Accessing Breakpoints and Wire Values in Preallocated Clone VIs (LabVIEW Scripting)


ManuBzh

Recommended Posts

Posted

## Accessing Breakpoints and Wire Values in Preallocated Clone VIs (LabVIEW Scripting)

Hello,

As part of automating certain debugging workflows, I’m looking to programmatically:

- Place breakpoints on SubVIs, or  
- Read values flowing through wires (yes, I’m aware this involves using private properties — if anyone knows from which version of LabVIEW these became accessible, I’d be glad to know!).

This is trivial when working with **non-reentrant VIs** via the `Diagram` property.

However, things get complicated with **reentrant VIs** (specifically *preallocated clones*):  
Accessing the `Diagram` property on such a clone returns the **top-level VI’s diagram reference**, not the actual clone's diagram.  
As a result, I can’t access the relevant references for SubVIs or wires within that clone instance.

### Why I believe it’s still possible:

- The **Breakpoint Manager** correctly detects and removes breakpoints on objects *inside* clone diagrams.  
  👉 This implies it has access to these internals and may be able to **set** breakpoints programmatically too — which is exactly what I’d like to do.

- The **Probe Watch Window** can read values from wires within clone diagrams.  
  👉 Again, this confirms some internal visibility and access.

I’m fully aware this might involve using **undocumented or unsupported LabVIEW features** (e.g., hidden `.ini` keys, private scripting APIs, or heap introspection).

---

If anyone has insights, experience, or any direction to offer, I’d greatly appreciate your help!

Thanks in advance!

Posted (edited)

There was this thing about getting the VI ref of the actual clone instance; I remember that in the past I asked about that (it must be somewhere here on Lava), and besides, there is this nice Vi commander tool (forgot its name, windows only) which obviously uses it. Once I have a moment of time I'll look for it and report.

ETA: 

, of course!

Edited by ensegre
ref to Task Manager
Posted

You're talking about VI ref ? If you do an open VI Reference using the Clone name, you get the clone ref, don't you ?
Here, I need The clone diagram reference...
But any help is appreciated, let me know what you find !

 

Posted

I assumed that if you obtain externally the clone VI ref and just pass it to the VI Block Diagram property you get the clone block diagram ref, but I haven't really tried it. Isn't that the case? If so, sorry for misleading you...

b.png

Posted

 

It's the Top Level Diagram reference... no the clone diagram reference (if ever this has sense)

(If you look at the exact name on the property node linked to your diagram ref, you'll see : TopLvDiag )

 

Posted

I thought it had to be read as in "the *top level node* of the BD of that particular instance", not as "the BD of the Top (prototype) VI", but haven't really tried... How do you get the values running onto a wire, btw, for my education?

Posted (edited)
35 minutes ago, ManuBzh said:

 

It's the Top Level Diagram reference... no the clone diagram reference (if ever this has sense)

(If you look at the exact name on the property node linked to your diagram ref, you'll see : TopLvDiag )

 

Top Level here almost certainly doesn't mean the diagram of the template VI. Instead LabVIEW distinguishes between a Top Level diagram which is basically the entire diagram window of a VI and sub diagrams such as each individual frame inside a case structure but also the diagram space inside a loop structure for instance.

The tricky part may be that the diagram itself may indeed only exist once and remains the same even for clone VIs. The actual relevant part is the data space which is separate for each active clone (when you have shared clones) and unique for each clone (when you have pre-allocated clones).

Edited by Rolf Kalbermatter
  • Like 1
Posted
10 minutes ago, Rolf Kalbermatter said:

The tricky part may be that the diagram itself may indeed only exist once and remains the same even for clone VIs.

Yes, I agree with this (That's what I saw after in the heap). There's only one diagram for all, but you can set breakpoints or probe on each instance "diagram",(it's only images ?) However, it would be enough for me to be able to do the same : programmaticvally put BP or read wires values on them.

I don't really know where to go now clone DS... if ever I can do something (But I think yes).

 

Posted (edited)
On 4/9/2025 at 11:10 AM, ManuBzh said:

Read values flowing through wires (yes, I’m aware this involves using private properties — if anyone knows from which version of LabVIEW these became accessible, I’d be glad to know!).

Since you asked, here are my findings:

  • LV23 - can create the attached snippet (don't know if it works), and save it for LV14 (also attached). All the pulldown menues show relevant properties
  • LV21 and LV 19 - open the saved for LV14, show a correct image, but the first property node lacks the "Block Diagram" entry in the pulldown; further properties have no menu ETA - and show the relevant pulldown menues when "Show VI scripting" is checked.
  • LV14 - the first property node menu *has* a "Block Diagram" entry, but the further properties don't match LV23

 

w.png

w14.png

W14.vi W23.vi

Edited by ensegre
correction - LV19 and 21 support the backsaved
  • Like 1
Posted
12 hours ago, ensegre said:

LV21 and LV 19 - open the saved for LV14, show a correct image, but the first property node lacks the "Block Diagram" entry in the pulldown; further properties have no menu

Thank you ensegre !
Very strange that diagram property does not appear in LV2019/2021 ! it's the basis for scripting...

Posted (edited)
2 hours ago, ManuBzh said:

Thank you ensegre !
Very strange that diagram property does not appear in LV2019/2021 ! it's the basis for scripting...

I can create it without problems in LabVIEW 2018 and 2020! So it is either that Scripting is not enabled in that LabVIEW installation or a bug in backsaving some of the scripting nodes to earlier LabVIEW versions. And I'm pretty sure that the Diagram property (called Block Diagram in the menu) is available since at least 2009 or thereabout. I can check this evening. My computer at work only has LabVIEW versions back to 2018 installed.

Edited by Rolf Kalbermatter
  • Like 1
Posted (edited)

Rolf is correct, I forgot to enable scripting in the LV19 I used to check :oops:

OTOH, in LV14 "Block diagram" is indeed present but is an array of I6 rather than a ref. I can't guess what was its intended use back then, maybe it was just an uncooked feature.

Edited by ensegre
Posted (edited)

Yes, Diagram property exists, and as a reference, since at least 8.5, I've checked.

Edit : and ...

I put here a simple VI containing the following code.

image.jpeg.c34ec37dfb4fc0e3dd69835ace5b3a23.jpeg

It's saved in LV2015 version, if someone can tell me with which version it won't be broken...

 

Thanks !

value of wire classe reference.vi

Edited by ManuBzh
Posted (edited)

This is the situation in 14 and 19 here. In 14 Wire has some interesting properties in 14, but not Value. Note that e.g. Attach Probe is accessed as a property in 14 and a Method in 19; and BD is an array of integers in 14.

w14.png

w19.png

Edited by ensegre

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.