LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding probe with scripting

Solved!
Go to solution

I am trying to use scripting to attach a probe to a wire. It works on a "standard" VI. I have issue when doing it has issue when doing it on a clone vi. To understand, I attached a sample project. If you open original.vi and run it with the "traverse + this VI" case enabled. The vi attaches a probe to the "index" wire. now, open "mainclone.vi" and run it. It creates a clone of original.vi and runs it. However, the probe is not executed. If you right click on the probe in the probe window and select "find wire" the block diagram of the clone opens and the "index" wire is highlighted. However, the probe has actually been attached to the "index" wire in the original.vi (the main one, not the clone one).

The same thing happens if I use the vi clone name to op[en a reference to the vi ("traverse + clone name" case)


However, if I I use "this VI" to get a reference that I then pass to the BDWin.Open property node, this time the block diagram of the clone VI opens, which allow to place probes before resuming the execution stopped at the breakpoint. So that is a work around but not a convenient one.

I also tried to bypass the traverse VI by rewriting something similar for this case; it does not work either.

I tried another property like "highlight execution". In that case also the highlight execution is turned on on the original.vi, not the clone.

It all point in the direction that the "diagram" property node (which is also used in the traverse VI)  returns a reference to the original.vi instead of clones.

Any thoughts/similar experiences?

thanks,

Pierre-Yves


0 Kudos
Message 1 of 4
(5,408 Views)
Solution
Accepted by topic author pylb

I don't think you're going to find any other workaround. Clones share the diagram of the real VI unless/until their diagram window is opened. Even then, a large amount of their code is shared with the original. Scripting to a clone is something that I recall hearing was not considered as a use case because clones are meant to be, well, clones. Since reads of the properties would all be the same value as the original and since writes close all the clones, I think all the references were designed to point to the real VI.  I don't think anyone considered scripting for debugging at all. This is the first time I've heard a request for it that I can recall. So breakpoints, probes and exec highlighting are all going to be pretty much limited to the real VI and to manual addition/subtraction.

0 Kudos
Message 2 of 4
(3,573 Views)

That's good to know.

I guess in most cases it does not matter much and the real vi can be tested before using it as a clone; except when I stupidly use named queue in a clone vi, then all the clones shared one queue until I concatenated the "VI clone name" to the name of the queue...

Anyway thanks for the answer, I still find amazing that the wire highlighted after using the "find wire" function from the probe watch window is not the same than the one the probe isa ttached to though

0 Kudos
Message 3 of 4
(3,573 Views)

thanks, that's good to know.

I guess in most cases it does not matter as the real vi can be tested before being used as a clone... except when I stupidly used named queue in it and then all clones shared teh same queue; that is until I finally realized it and concatenated the VI clone name to the queue name.

Anyway, thanks for the answer, I still find amazing that the wire highlighted when double clicking on the probe is not the one the probe is on though.

0 Kudos
Message 4 of 4
(3,573 Views)