10-22-2015 04:34 AM
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
10-22-2015 04:41 AM
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.
10-22-2015 04:58 AM
ok, the attached snapshot summes up what I need to do:
However the value of the boolean has no effect on the value displayed in the Waveform Chart, this remains Unsiged.
10-22-2015 05:24 AM
I managed to find a solution, even though I must admit it looks odd.
what do you think?
10-22-2015 05:37 AM - edited 10-22-2015 05:39 AM
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):
(It's a VI Snippet, you can save it and drag it onto your block diagram)