LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data of unknown origin

I tried to program something involving data being updated only in the TRUE case of a CASE structure, and remaining the same otherwise. I tried to avoid local variables, having had problems in the past with locals updating one iteration later than I needed and expected. I (mistakenly) thought I had the program set up so that after processing data in the TRUE case, the program would go out of the CASE structure, so that the constant values in the FALSE case were irrelevant, but to be sure I would notice if the constant values went out, I set them to -1. I connected a single number constant to all three tunnels. Seeing that I had two times in milliseconds, ranging from a few hundred to a few thousand, and one radius, ranging from 5 to perhaps 150, negative numbers should have been a sure sign of the program going to the FALSE case and passing out the constant values.

Then I found that the times I got were always 4294967295. I put some probes in, and found that outside the CASE structure, I always got that number for the two times, but inside the CASE structure, the two possible sources for the data were either a sensible time up to a few thousand. or the -1. It doesn't look like I got a weird value from the number constant, because the third wire which takes data from that very same source does show the -1. It looks like I get a number which does not come from one of the two possible data sources inside the CASE structure. I copied that part of the program and made it a separate VI, which I attach,

My experience has been that when something happens that should be impossible, it is generally a really stupid mistake on my part. Can someone tell me what it is? Until I know, I can't trust any computation I do in LabView, so I would like to know what happened, even though in the program I need for my experiment, I circumvented the problem by using local variables after all.

Thanks

Robert Biegler
0 Kudos
Message 1 of 3
(2,074 Views)
After a quick look, there are 2 point to comment:
The value is 429496... is OK becuase you wired a -1 to a U32 indicator. Change to I32 if want to get -1.
The for loop executee 2 times. That forces the second time to write -1 to U32, so you can not see the right value.
Wire a 1 to the for loop and values will be OK.
Hope it helps
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
Message 2 of 3
(2,070 Views)
Thanks. I spent hours even finding where the problem was, and when looking for the cause, I never thought to check the format.

The 2 in the FOR loop is just to reproduce the way the main program treats this bit. As for the 32-bit integer turning into a 32-bit word, that is also what is happening in the main program, only there it happens one step later, when the wire leaves the CASE structure.

Is such a format change soemthing I have to check by default?

Thanks again.

Robert Biegler
0 Kudos
Message 3 of 3
(2,067 Views)