From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Bug] Default timeout value of Wait for Occurrence

This one kind of cheesed me off this morning. 

 

When I create a constant/control from a terminal on a primitive I have come to expect the value to be the default value.  Those tricky folks found a way to get me again.

 

Drop a Wait on Occurrence onto the BD

Right-Click on 'Create Control' or 'Create Constant' from the suggestively named 'ms timeout (-1)' terminal

The value/default is not -1, but rather 0.

 

Slightly different behavior between -1 and 0.

 

LV8.2-LV12 (at least)

0 Kudos
Message 1 of 9
(3,213 Views)

Hi Darin.K,

 

Thanks for letting us know. I have reported it to our R&D department.

 

Regards,

 

Carmen C.

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

Similarly I have an issue with how the Delete From Array function.  If I wire a 1D array of string to the input, and nothing else my output has the 1D array (with that index deleted), and then the Deleted Portion as a scalar string.

 

If I create a constant from the Length terminal, the value is 0 and the functionality of the primative changes so that now Deleted Portion output is an Array of String.

 

I don't think this is a bug, but it bothers me when NI can detect when a terminal has something connected to it, and behaves differently then when something isn't connected.  This is not functionality that I expect to see in LabVIEW because I rarly see it.

0 Kudos
Message 3 of 9
(3,169 Views)

@Hooovahh wrote:

Similarly I have an issue with how the Delete From Array function.  If I wire a 1D array of string to the input, and nothing else my output has the 1D array (with that index deleted), and then the Deleted Portion as a scalar string.

 

If I create a constant from the Length terminal, the value is 0 and the functionality of the primative changes so that now Deleted Portion output is an Array of String.


Personally, I greatly appreciate this usability enhancement. It would annoy me if I had to put an index array after every delete from array when I delete only a single element.

0 Kudos
Message 4 of 9
(3,153 Views)

@nathand wrote:

@Hooovahh wrote:

Similarly I have an issue with how the Delete From Array function.  If I wire a 1D array of string to the input, and nothing else my output has the 1D array (with that index deleted), and then the Deleted Portion as a scalar string.

 

If I create a constant from the Length terminal, the value is 0 and the functionality of the primative changes so that now Deleted Portion output is an Array of String.


Personally, I greatly appreciate this usability enhancement. It would annoy me if I had to put an index array after every delete from array when I delete only a single element.


I like the feature, I don't like the implementation.  Why can't a value of -1 be the default and that corresponds to a single scalar item being removed?  Instead of 0 be the default corresponding to delete nothing.

0 Kudos
Message 5 of 9
(3,150 Views)

@Hooovahh wrote:

I like the feature, I don't like the implementation.  Why can't a value of -1 be the default and that corresponds to a single scalar item being removed?  Instead of 0 be the default corresponding to delete nothing.


Because the value on the wire wire can vary, and it would be weird if a -1 on a non-constant wire behaved differently than the same value as a constant.

0 Kudos
Message 6 of 9
(3,147 Views)

@nathand wrote:

@Hooovahh wrote:

I like the feature, I don't like the implementation.  Why can't a value of -1 be the default and that corresponds to a single scalar item being removed?  Instead of 0 be the default corresponding to delete nothing.


Because the value on the wire wire can vary, and it would be weird if a -1 on a non-constant wire behaved differently than the same value as a constant.


Lets ignore the Length terminal (because that changes outputs from array to scalar which can't happen at runtime)  What bout the Index terminal?  If this is unwired you have it deleting from the end of the array, if you create a constant it will delete from the beginning of the array.  What is wrong with having -1 mean the end of the array, and have that be the default value on the terminal if a constant is made?

0 Kudos
Message 7 of 9
(3,137 Views)

@Hooovahh wrote:

Lets ignore the Length terminal (because that changes outputs from array to scalar which can't happen at runtime)  What bout the Index terminal?  If this is unwired you have it deleting from the end of the array, if you create a constant it will delete from the beginning of the array.  What is wrong with having -1 mean the end of the array, and have that be the default value on the terminal if a constant is made?


Veering way off-topic from the subject line at this point... my guess is there's a compiler optimization that can be made here. Deleting elements from the end of an array should be easy - just set the length shorter. If the compiler knows that's all that's necessary, it can generate a lot less code. Deleting an element from the beginning is more complicated. You could rework it the way you suggest but you'd lose the option for this optimization.

0 Kudos
Message 8 of 9
(3,128 Views)

along the same lines,

 

SR1.png

0 Kudos
Message 9 of 9
(3,050 Views)