LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Nullable System Int64 Property Node Value Not Writable

I'm attempting to create and then set the value of a .NET nullable System Int64 object but the property node "change to write" option is not selectable.

 

Is this a limitation, bug or design feature and are there any plans to address it?

 

Steps to Reproduce---V

Open attached VI.

View Block Diagram.

Go to method 1.

Right click on value and note that "Change to Write" is grayed out.

 

For those interested an alternative method has been provided to get around it.

0 Kudos
Message 1 of 5
(3,000 Views)

@RVines wrote:

I'm attempting to create and then set the value of a .NET nullable System Int64 object but the property node "change to write" option is not selectable.

 

Is this a limitation, bug or design feature and are there any plans to address it?

 

Steps to Reproduce---V

Open attached VI.

View Block Diagram.

Go to method 1.

Right click on value and note that "Change to Write" is grayed out.

 

For those interested an alternative method has been provided to get around it.


My guess is that this is an inconsistency across the 'support' for generic instance types in LabVIEW. 

 

Nullable types in .NET are actually instances of the Nullable<T> struct which is by definition generic. You can tell that this is the case with the '1 at the end of the class, which is how the compiler has translated and named a new class from the generic type.

 

There is no definition for a nullable type instance of Int64 in mscorlib (ie. Nullable<Int64>); this type has to be created by a compiler specifically for an assembly or dynamically at runtime in the CLR via type creation. So you have to obtained a reference to this type from somewhere (that missing control perhaps).

 

0 Kudos
Message 2 of 5
(2,988 Views)

Thanks for the background info. I originally obtained a reference to it by auto-generating a web service that I need to interface to.

 

NI, would you consider this a CAR?

0 Kudos
Message 3 of 5
(2,974 Views)

Nevermind.  I think I realize my mistake.

0 Kudos
Message 4 of 5
(2,785 Views)

Zombie poster alert.... This appears completely unrelated to the original subject.

 

An Int64 is not a TimeSpan. The error is telling you this (read the description). Also perhaps read this: https://msdn.microsoft.com/en-us/library/system.timespan.ticks(v=vs.110).aspx and https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx. It explains that a TimeSpan is an immutable object. If you want to create a TimeSpan then there are static methods of the struct to allow you to do this.

 

Perhaps you should explain whta you are trying to achieve. 

0 Kudos
Message 5 of 5
(2,778 Views)