LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart - display different data type based on user selection

Hello everyone,

 

i need a Waveform Chart to display n variables of different data types ( signed, unsigned, 8/16/32 bit..) based on what the user has selected.

 

Any idea?

 

thanks,

 

Lorenzo

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

There isn't really much information in your post - which bit are you specifically having problems with? Can you show us what you have tried so far?

 

If you need to display different data types, coercing the data to a floating point (DBL) will allow you to display all numeric types.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(3,213 Views)

ok, the attached snapshot summes up what I need to do:

 

  1. when the boolean is TRUE, the data displayed in the Waveform Chart should be Signed (if Numeri = FF, then value displayed = -1)
  2. else, when the boolean is FALSE, the data displayed should be same Unsigned

However the value of the boolean has no effect on the value displayed in the Waveform Chart, this remains Unsiged.

Download All
0 Kudos
Message 3 of 5
(3,201 Views)

I managed to find a solution, even though I must admit it looks odd.

 

what do you think?

0 Kudos
Message 4 of 5
(3,187 Views)

That is an absolutely terrible idea (local variables can introduce horrible race conditions - your chart could update before you update the data). LabVIEW is about dataflow. Use wires!

 

If you want LabVIEW to display -1 on the chart, then you need the data type of the chart to be signed. The chart adapts to type, you'll notice the icon colour change as you wire different data types to it.

 

I would convert both numbers to an I16 (to ensure you can represent the full range of values from -127 to 255) and wire that to the directly to the graph. You may need an in range and coerce to get your -1 if less than 0 logic in there.

 

This might not be quite right (because your description of what you're trying to do isn't clear), but it should demonstrate some of the principles I'm talking about (I replaced the case structure with a select to make it easier to see the two options):

DataTypeToChart.png

 

(It's a VI Snippet, you can save it and drag it onto your block diagram)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(3,176 Views)