LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Project Items - LVLibp class in scripting

Hello,

 

I am trying to do some scripting with lvlibp in my project, but it seems there is no way to cast LVLibp type to more specific class and list classes and members that are inside:

 

pawhan11_0-1578581877652.png

 

Similar code works for libraries.

Is there way around this?

 

 

0 Kudos
Message 1 of 9
(2,442 Views)

Which node gives an error, and what is the error?

 

If you get an array from OwnedItems[] , I'd start by listing the class names of the members.

0 Kudos
Message 2 of 9
(2,414 Views)

I want to get reference to class inside packed library.

For normal source code library it forks without problems:

 

pawhan11_0-1578586350935.png

 

But for packed library cast to Library class fails, I can not find LVLibp class to cast it correctly.

pawhan11_1-1578586565503.png

 

pawhan11_2-1578586664217.png

0 Kudos
Message 3 of 9
(2,397 Views)

But what class is it that reference? If you get the ClassName property, you know what you can to cast that reference to. A probe gives this info too, without any programming.

0 Kudos
Message 4 of 9
(2,354 Views)

wiebe@CARYA wrote:

But what class is it that reference? If you get the ClassName property, you know what you can to cast that reference to. A probe gives this info too, without any programming.


I have the same problem. The ClassName property returns LVLibp and I cannot find corresponding constant for using with To More Specific Class

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 5 of 9
(130 Views)

@_Y_ wrote:

wiebe@CARYA wrote:

But what class is it that reference? If you get the ClassName property, you know what you can to cast that reference to. A probe gives this info too, without any programming.


I have the same problem. The ClassName property returns LVLibp and I cannot find corresponding constant for using with To More Specific Class


As far as I can tell, the "LVLIbp" class is not exposed.

Only 7 class names contain the characters "Lib":

  • CallLibrary
  • LVClassLibrary
  • Library
  • LibraryData
  • StatechartLibrary
  • XControlLibrary
  • XNodeLibrary

Here is a sorted list of all class names as of LV 2023:

AbsTime
AbsTimeConstant
AbstractDiagram
AbstractDynamicDispatch
ActiveXContainer
Application
Array
ArrayConstant
ArrayToCluster
AssertStructuralTypeMismatchNode
Boolean
BooleanConstant
BuildArray
BuildClusterArray
BuildMapNode
BuildSetNode
BuildSpecification
Bundler
Bus
CIN
CallByRef
CallLibrary
CallParentNode
CaseStructure
ClassSpecifierConstant
ClosureStructureNode
Cluster
ClusterConstant
CodeWizard
ColorBox
ColorBoxConstant
ColorGraphScale
ColorRamp
ColorScale
ComboBox
ComboBoxConstant
CompanionDiagram
Comparison
CompoundArithmetic
ConditionalTunnel
ConfNode
ConnectorPane
Constant
Constructor
Control
ControlReferenceConstant
ControlTerminal
CopyConflict
CopyExpert
CopyItem
CopyOperation
Cursor
DAQChannelName
DAQChannelNameConstant
DAQmxName
DAQmxNameConstant
DSCTag
DSCTagConstant
DataValRefNum
DataValRefNumConstant
Decoration
Diagram
Digital
DigitalGraph
DigitalNumericConstant
DigitalTable
DisableStructure
DynamicDispatchSubVI
Enum
EnumConstant
EventStructure
ExpressionNode
ExternalEditorWizard
ExternalNode
FacadeVI
FeedbackNode
FileDialog
FixedConstant
FlatSequence
FlatSequenceFrame
FlatSequenceInnerTunnel
FlatSequenceOuterTunnel
FlattenString
FlattenUnflattenString
ForLoop
ForkNode
FormatScanString
Formula
FormulaParameter
Function
GObject
GPIBReadWrite
GenClassRef
GenClassRefConst
GenClassTagFlatRef
GenClassTagFlatRefConstant
GenClassTagRef
GenClassTagRefConstant
Generic
GenericSubVI
Global
GraphChart
GraphScale
GrowableFunction
IOName
IONameConstant
IVILogicalName
IVILogicalNameConstant
InPlaceArrayNode
InPlaceArraySplitNode
InPlaceBorderNode
InPlaceClusterNode
InPlaceDataValRefNode
InPlaceElementNode
InPlaceElementStructure
InPlaceMapNode
InPlaceVariantAttributeNode
InPlaceVariantNode
InRangeAndCoerce
IndexArray
InlineCNode
InnerTerminal
IntensityChart
IntensityGraph
Invoke
JoinNode
JunctionNode
Knob
LVClassLibrary
LVClassPropDefFolder
LVObjectRefNum
LVTarget
LVVariant
LabVIEWClassConstant
LabVIEWClassControl
LeftShiftRegister
Library
LibraryData
ListBox
Local
Loop
LoopTunnel
Map
MapConstant
MasterWizard
MathDiagram
MathScriptCallByRef
MathScriptNode
MathScriptNodeParameter
MethodVI
MixedCheckbox
MixedSignalGraph
MultiFrameStructure
MultiSegmentPipe
MulticolumnListbox
NamedBundler
NamedNumeric
NamedNumericConstant
NamedUnbundler
Node
Numeric
NumericConstant
NumericText
NumericWithScale
ObjectFunction
OuterTerminal
OverridableParameterTerminal
Page
PageSelector
Pane
Panel
ParameterTerminal
Path
PathConstant
Picture
Pixmap
Plot
PlugInControl
PlugInDDODummyContainer
PolymorphicSubVI
PolymorphicVI
PolymorphicVISelector
Probe
Project
ProjectFilesViewItem
ProjectItem
ProjectItemType
Property
PropertyFolder
PropertyItem
Provider
RaceStructureNode
RadioButtonsControl
ReadWriteFile
RefNum
RefNumConstant
RegionNode
RegionTunnel
RegisterForEvents
RightShiftRegister
Ring
RingConstant
RotaryColorScale
SDF Companion Diagram
SDFDiagram
ScDiagram
Scale
Scene
SceneBox
SceneClipPlane
SceneCone
SceneCylinder
SceneDrawable
SceneGeometry
SceneGraphDisplay
SceneHeightField
SceneLight
SceneMesh
SceneNode
SceneObject
SceneSphere
SceneText
SceneTexture
SceneWindow
ScriptNode
ScriptNodeParameter
Scrollbar
SelectorTunnel
Sequence
SequenceLocal
Set
SetConstant
SharedVariableDynamicOpen
SharedVariableDynamicRead
SharedVariableDynamicWrite
SharedVariableNode
SimDiagram
SimulationDCO
SimulationNode
Slide
SlideScale
Splitter
StateDiagramWizard
StateNode
StatechartLibrary
StatechartStructureNode
StaticVIReference
String
StringConstant
Structure
StubDDO
SubPanel
SubVI
SubWizard
SubsystemVI
SynchronousDataFlowDCO
SynchronousDataFlowNode
TabControl
Table
TagSet
TargetItem
TargetStructureNode
Terminal
Text
TextBaseNode
TimeFlatSequence
TimeSequenceFrame
TimedLoop
TimedSequence
TimedStructDCO
TopLevelDiagram
TreeControl
Tunnel
TypeCast
TypedRefNum
TypedRefNumConstant
Unbundler
UnitCast
VI
VIRefNum
VISAResourceName
VISAResourceNameConstant
Variable
WaveformChart
WaveformData
WaveformGraph
WhileLoop
Wire
XControlLibrary
XDataNode
XInterfaceLibrary
XNode
XNodeLibrary
XPropertyFolder
XYGraph

0 Kudos
Message 6 of 9
(117 Views)

Hi pawhan,

 

"Owned Items[]" is a property of class "ProjectItem", so for your case, you wouldn't need to cast your refnum to a more specific class:

 

raphschru_3-1732394613554.png

 

 

... but the fact that you cannot cast it to a Library is surely an oversight from NI because you can easily get it as a Library like this:

 

raphschru_1-1732394529706.png

 

...or like this:

raphschru_2-1732394564649.png

 

 

...you can even type cast it directly and use Library properties without problem:

raphschru_4-1732395299066.png

 

So you could report this behavior as a bug to NI, because the LVLibp refnum IS a library.

 

As a side note: "LVLibp" is not a VI Server class, it is a type string as returned by property "Type String" of class "ProjectItem".

This is sometimes correlated, like VI Server class "Library" has the Type String "Library", or "LVClass" has the Type String "LVClassLibrary", but this is not the case for most items. There are way more Type Strings than classes in the Project Item hierarchy.

 

Regards,

Raphaël.

Message 7 of 9
(101 Views)

@_Y_ wrote:

wiebe@CARYA wrote:

But what class is it that reference? If you get the ClassName property, you know what you can to cast that reference to. A probe gives this info too, without any programming.


I have the same problem. The ClassName property returns LVLibp and I cannot find corresponding constant for using with To More Specific Class


That's why the dependencies (including the parent) shouldn't be compiled in the PPL when the child is packed.

0 Kudos
Message 8 of 9
(35 Views)

@paul_a_cardinale wrote:

@_Y_ wrote:

wiebe@CARYA wrote:

But what class is it that reference? If you get the ClassName property, you know what you can to cast that reference to. A probe gives this info too, without any programming.


I have the same problem. The ClassName property returns LVLibp and I cannot find corresponding constant for using with To More Specific Class


As far as I can tell, the "LVLIbp" class is not exposed.

Only 7 class names contain the characters "Lib":

  • CallLibrary
  • LVClassLibrary
  • Library
  • LibraryData
  • StatechartLibrary
  • XControlLibrary
  • XNodeLibrary

A packed library is a library.

 

wiebeCARYA_0-1732526907566.png

Not sure why you'd need this though.

0 Kudos
Message 9 of 9
(27 Views)