LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble specifying data type via variable proprty node

I am running LabVIEW 8.0.  I am trying to create a batch of shared variables programmatically.  The problem I have is that I don't seem to have the correct information available to specify the variable data type using the invoke property node.  The documentation I have does not seem to be in agreement with what LabVIEW actually expects for an argument. Specifically the help screen says this:

Data Type Property

Property of Variable.

Gets or sets the data type of a shared variable. The following table lists the data type values.

0 Double
1 String
2 Boolean
3 Int8
4 UInt8
5 Int16
6 Uint16
7 Int32
8 UInt32
9 Int64
10 UInt64
11 Single
12 Double Waveform
13 Int16Waveform
14 Array of Boolean
15 Array of Int8
16 Array of UInt8
17 Array of Int16
18 Array of UInt16
19 Array of Int32
20 Array of UInt32
21 Array of Int64
22 Array of UInt64
23 Array of Single
24 Array of Double
25 Double Waveform
26 Array of Int16 Waveform
27 U32BitField
28 Custom

However,  the program insists that you give it an array of 16 bit integers.  No further explanation is forthcoming.  I turned the property node around (made it a rea) and determined that the array is two elements long, but the contents are meaningless.

(I hope this table appears correctly.  I copied from the help screen.)

On a related subject, when the Type property is used to set the scope as Single Process (0) the variables are created as specified, but the icon appears in the project manager as Network Published.  This is a curious aside.

Any suggestions, hints or allegations?  Thanks in advance for your tolerance and guidance.

Quis custodiet ipsos custodes?


----------------------------------
LabVIEW 8.0.1; WinDoze XP
aut viam inveniam aut faciam
0 Kudos
Message 1 of 4
(2,508 Views)

Hi BadToad,

All of the above seems to ring a bell but I can't shake out nay ideas from my old brain. Smiley Mad

Please post some code to give me the "whack on the side of the head" that will shake those ideas loose.

Maybe after the coffee kicks in... Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,487 Views)
This is getting curiouser and curiouser.  I wrote another little program to "read" the data types of existing shared variables and tried feeding the values obtained via this technique into the property node at create time and LabVIEW just plain crashed.  I don't mean it objected. . .it shut down.  I don't find this to be desirable behavior in a development environment.  Any guidance will be appreciated.  I remain

Dumbfounded, but determined

BadToad

Quis custodiet ipsos custodes?


----------------------------------
LabVIEW 8.0.1; WinDoze XP
aut viam inveniam aut faciam
0 Kudos
Message 3 of 4
(2,476 Views)
Hi Everybody,

For future record, features related to this question are changed in 8.2+.  The new example code is available at http://zone.ni.com/devzone/cda/epd/p/id/5209.  The Data Type property has be modified to take Variant now.
Attached is the code for the 8.0 work around for this issue BadToad mentioned here.

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 4 of 4
(2,438 Views)