Jump to content


Photo
- - - - -

Get 'Actual Data Type' of LVOOP Object

scripting 2011

  • Please log in to reply
12 replies to this topic

#1 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 13 January 2012 - 01:35 PM

[LabVIEW 2011]

Howdy

If you probe a LVOOP Object it tells you the Actual Data Type e.g. the wire maybe that of a parent, but it will display the child's name if the child ran on that wire.
Is there a way to get the Actual Data Type of an LVOOP Object at edit time from a terminal input reference / wire reference (assuming the VI has been run and the wire has been 'executed' on).
There is a datatype property for the terminal but it just returns the parent class in the above use case.
I managed to locate this control which is part of the probe (<resource>\dialog\NI.LVClass.Probe.NameStr.ctl) hoping to find the complete probe and see the code - still searching tho:

Control.png

Cheers!
-JG

#2 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Members
  • PipPipPipPipPipPip
  • 2,790 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 15 January 2012 - 07:32 AM

Use the Flatten To String primitive and take the name off the front. The details of doing this are posted somewhere on LAVA... I forget where. Try searching the OO category for "flat format".
  • Jordan Kuehn likes this

#3 drjdpowell

drjdpowell

    The 500 club

  • Premium Member
  • 776 posts
  • Location:Oxford, UK
  • Version:LabVIEW 2011
  • Since:1999

Posted 15 January 2012 - 11:35 AM

I searched and found this prior conversation.

#4 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 15 January 2012 - 02:22 PM

Use the Flatten To String primitive and take the name off the front. The details of doing this are posted somewhere on LAVA... I forget where. Try searching the OO category for "flat format".


I searched and found this prior conversation.

Thanks for your replies, but I am unsure how to use this to solve the OP:

... at edit time from a terminal input reference / wire reference

I.e. How do I tell what Class data is on the wire with an arrow...

Parent.png
...(assuming that it is run at least once and Retain Wire Values in ON) using a terminal (or wire) reference for that node?

terminal.png

Can you please provide more detail.

Cheers
-JG

#5 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,741 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 15 January 2012 - 03:50 PM

For that you need the actual value on the wire, which I'm pretty sure is not exposed through VI server (probably since before the retain values option was introduced this was considered to be dangerous, because it meant LV could not safely reuse buffers and after the option was added no one bothered to add such a property).

#6 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Members
  • PipPipPipPipPipPip
  • 2,790 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 15 January 2012 - 11:59 PM

Like this:
(VI is saved in LV 2011... should work back to 2009... back to 8.2 if you rewrite the subVI.)
Attached File  Get Name of Class of Object.vi   26.58KB   95 downloads
Screen shot 2012-01-15 at 5.57.06 PM.png
  • jgcode likes this

#7 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 16 January 2012 - 07:00 AM

Thanks for the VI AQ, but I am unsure how to use it correctly in the use case I presented.
If I pass in the Terminal's Data Type it always returns the Parent (even if a Child has run on the wire).

Here are the scripting properties I am browsing through which are available for terminal (left) to the wire (middle).
As Yair has mentioned - can it be done? What should I be using?

options.png

Cheers
-JG

#8 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,741 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 16 January 2012 - 08:21 AM

AQ, I think the problem is that you're misunderstanding what Jon wants - he wants to find the specific class on a wire in another VI, since this is supposed to be an edit-time scripting tool. For that, he needs the actual value in the wire.
  • jgcode likes this

#9 drjdpowell

drjdpowell

    The 500 club

  • Premium Member
  • 776 posts
  • Location:Oxford, UK
  • Version:LabVIEW 2011
  • Since:1999

Posted 16 January 2012 - 10:36 AM

*
POPULAR

Thanks for your replies, but I am unsure how to use this to solve the OP:

Sorry, I had mistakenly thought you were making custom probes, rather than wanting scripting access to the data retained on a wire.

I’ve never tried scripting, but just a thought: can one use scripting to connect a probe to the wire? I see from your last image that there is a probe reference that you may be able to set. If so, you could connect a custom probe and have the probe send (via a queue or whatever) the retained object on the wire back to the VI doing the scripting. Then you could use AQs code on it.

— James

Edited by drjdpowell, 16 January 2012 - 10:37 AM.

  • Yair and jgcode like this

#10 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 16 January 2012 - 02:20 PM

If so, you could connect a custom probe and have the probe send (via a queue or whatever) the retained object on the wire back to the VI doing the scripting.


Well what do you know... :)
I had looked at probes quickly before but with no luck - so I just went back in, found some nodes, converted AQ's VI to conform to a probe, tried it out and have my code 'working'.
Need to neat up the process, but I think I definitely have the tools to do it now.
Thanks everyone!

-JG

#11 drjdpowell

drjdpowell

    The 500 club

  • Premium Member
  • 776 posts
  • Location:Oxford, UK
  • Version:LabVIEW 2011
  • Since:1999

Posted 16 January 2012 - 03:09 PM

JG,
Can you add a probe to a running VI, also? What about a clone VI? (I have a use case that would be valuable, and perhaps I’ll dive in to scripting.)

— James

#12 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 16 January 2012 - 03:33 PM

JG,
Can you add a probe to a running VI, also? What about a clone VI? (I have a use case that would be valuable, and perhaps I’ll dive in to scripting.)

— James


Don't know - I am 'swimming' myself at the moment with this probe thing.
My use case is edit time - that's what I am testing at the moment.

#13 François Normandin

François Normandin

    Son of Scotland

  • JKI
  • 1,087 posts
  • Location:Oakland, CA
  • Version:LabVIEW 2013
  • Since:1999

Posted 16 January 2012 - 09:09 PM

Small modification to AQ's VI... Get the Value from the control associated with the terminal. Indeed, the datatype is always "LabVIEW Object" in this case.

Attached File  Get Name of Class of Object From Terminal Reference.vi   27.37KB   94 downloads
(LV2011)

Posted Image

François [fr??swa], CLA






Also tagged with one or more of these keywords: scripting, 2011