LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing values by reference to a graph seems to be not working... help, I'm losing my mind! ;)

I'm bordering on psychosis now.
Grr..

I'm trying to pass an array to a waveform graph by reference. The array is an array of I16 data.

I have verified that the data in question is correct, and when viewed view probe (RIGHT before going into the property node, mind you) it is something like:

2048
2053
2066
...

However, when you look at the front panel it's totally different. Turning on Autoscale Y and looking at the data showed that instead it was displaying:

-1024 2048 0 0 (two other numbers) (two other numbers) 0 0 (etc.)

I imagine that it is some sort of typecasting problem, but I cannot figure it out.

I note that the word "value" on
the property node is Orange, indicating that it is writing a DBL. I had the Refnum Control include data type, but even so, it appears Orange.

The Waveform Graph itself was of type DBL. I never changed it, but in the main program, I did wire an I16 value to it, which SEEMED to change the Graph to type I16. Is there a more rigorous way of changing a Waveform Graph's data type. (This could be the problem)

I'll attach the front panel with the sub-vi in question. Please help or I may explode.

-Dobbs
0 Kudos
Message 1 of 5
(3,161 Views)
Here are the files:
0 Kudos
Message 2 of 5
(3,161 Views)
The control references to your waveform graph are strict. That is why the value property is a numeric instead of a variant. You created them when your wf graph was of type dbl, and then you changed your wf graph to type I32. The original refences are not to the specific object class that you control is a member of. And your reference is being coerced as it enters your subVIs.

Anyway, to fix your problem, change all of the control refnums on your subVI front panels to the one in the attached file.

Good luck,

Jim
0 Kudos
Message 3 of 5
(3,161 Views)
Thanks! (How did you create that I32 specific refnum? And also, is there a way to change a waveform graph's type other than the ad hoc way of wiring a strict I32 to it?)
0 Kudos
Message 4 of 5
(3,161 Views)
Phredrick,

When you create a control refnum, it looks like a refnum. You can choose "Show Control" from the pop-up menu on the control refnum. Now you have a control inside of a control rufnum shell. You can change the properties of the control by poping-up on it. You can also remove the control and replace it with another. What I did was put your wf graph into the shell. You can pop-up on the shell again and deselect "Show Control". Now your refnum will have a little red star which means that it is a strict reference.

As far as I know, wiring data to a graph or chart's terminal is the only was to change its data type.

Glad it worked for you!

-Jim
0 Kudos
Message 5 of 5
(3,161 Views)