LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'replace array subset'

Hi,
 
I'm using LV 6.1 to program my applications. Today, I discoverd something strange in my vi. My program is using the "replace array subset" vi to replace two values in a previously initialized sequence. This was working fine until today. The "replace array subset" vi didn't do its job anymore. It didn't do anything. I fixed this by just running my vi with the array initialized with other values (like 999.9 instead of 0.0), which then worked (the two 999.9 values where then replaced by the correct values)  and when I then put the old code back (initialization with 0.0), it still worked. So, at the end nothing changed but the "replace array subset" vi did its job again !
 
Another very strange thing about the "replace array subset vi" is that when you replace this vi with itself (by right clicking it --> replace --> array--> replace array subset), the input terminals are switched !!! you can simply reproduce this by opening a new blank vi, put the "replace array subset" vi on the diagram, connect a value to the index terminal (like 0), connect a value to the element terminal (like 0.0) and then replace the "replace array subset" with itself. You'll see that the index and element terminals are switched !!!
 
Does anyone know what causes this? Is this a bug in labview 6.1?
 
thanks,
 
best regards,
Marino
0 Kudos
Message 1 of 4
(3,177 Views)

Marino,

Can you post a simpler VI demoing what you're trying to do.  The only thing I can think of is whether or not the array was initialized -- an uninitialized array will have 0s but they're greyed out... as you probably are aware of.

Regarding the replacing of the 'replace array subset,' the behaviour is reproducible in 7.1.1 and 8.0.  I guess it can be argued whether or not it's a bug, and why would someone want to do that.. but it certainly is annoying!

-Khalid

 

Message 2 of 4
(3,161 Views)
Hi,
 
first, thanks for your reply.
 
The vi is to complex to post (it's a vi that drives measurement equipment, DUT's,...) but the problem simply comes down to the small example that I posted. The posted vi works but what I have in my vi is the about the same but here, the "replace array subset" doesn't work (it is not reproduceable). I can reproduce it on my PC because the version that has the problem is still checked in in source safe. When I get it for VSS and run it, I have the problem. When I simply do the following things, it is solved:
description of the vi:
In my first sequence, I initialise my array of 2 elements to 0.0 (you can see this because they are not grayed out). Then, a few sequences later, I want to replace the first element with 2.0 and the second with 20.0 but it doesn't do that.
"solution":
When I simple change something to the initialization (like, initialize is with 999.9 instead of 0.0 of give it a length of 3 instead of 2), it works. When I then put the original code back (initialization of the array with a length of 2 and values 0.0) it still works and continues to work. I never saw that before.
 
I encoutered the 'bug' of replacing the "replace array subset" vi with itself by accident when I was looking for my problem (I was guessing what was going on so I just tried some things...). I was thinking that maybe when I "renewed" the vi that was causing the problem, it could work but then I saw that the two terminals just switched.
 
Hope this gives you a better Idea,
 
best regards,
Marino
0 Kudos
Message 3 of 4
(3,134 Views)
Hello Marino,

I found no problem with your example.
And I made changes, so it works without locals. Maybe you have some race conditions in your code, they appear faster you can think of...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(3,128 Views)