Reputation: 121
I have an angle in degrees, and need to map it to a voltage.
i.e. left: -360 degrees = 0V, straight: 0 degrees = 5V, right: 360 degrees = 10V.
How do you map values in LabVIEW?
I found scaling under the numeric pallet but they seem to be very specific (e.g. for a thermistor) with no generic block.
Upvotes: 0
Views: 2330
Reputation: 6284
If the mapping you want is described by a mathematical formula, just implement that calculation using LabVIEW functions. In your case, assuming it's a linear relationship, the formula is voltage = (angle + 360) / 72 .
You could code this in LabVIEW with an Add function followed by a Divide function, or if you think it's clearer written out as a formula then you could use a Formula Node.
If you need to use this calculation in more than one place in your application, make it into a subVI.
Upvotes: 4
Reputation: 79
Looks like you're trying to read a analog gauge value! Actually it's very simple.
Refer the VI Snippet (Just paste this image into your block diagram).
Sample Output:
Upvotes: 0