Jump to content

Component: Map Function (Calculation): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 48: Line 48:


''<span style="color:red;">No additional examples</span>''
''<span style="color:red;">No additional examples</span>''




Line 319: Line 321:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}





Revision as of 12:21, 3 February 2023

Author medelec35
Version 2.0
Category Calculation


Map Function component

The map function is intended to change one range of values into another range of values. For example. Output from a temperature sensor is in centigrade. you can map it to give the result in Fahrenheit. To do that set: InMin to 0, InMax 100, OutMin to 32 & OutMax to 212

Component Source Code

Please click here to download the component source project: FC_Comp_Source_temp/Map-Function.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/Map-Function.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples





Macro reference

MapByte

MapByte
Map function for byte type variables 
- BYTE Value
Main variable used for map function 
- BYTE InMin
Lowest input value 
- BYTE InMax
Highest value input 
- BYTE OutMin
Lowest value after conversion 
- BYTE OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- BYTE Return


MapFloat

MapFloat
Map function for floating point type variables 
- FLOAT Value
Main variable used for map function 
- FLOAT InMin
Lowest input value 
- FLOAT InMax
Highest value input 
- FLOAT OutMin
Lowest value after conversion 
- FLOAT OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- FLOAT Return


MapInt

MapInt
Map function for signed int type variables 
- INT Value
Main variable used for map function 
- INT InMin
Lowest input value 
- INT InMax
Highest value input 
- INT OutMin
Lowest value after conversion 
- INT OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- INT Return


MapLong

MapLong
Map function for signed long type variables 
- LONG Value
Main variable used for map function 
- LONG InMin
Lowest input value 
- LONG InMax
Highest value input 
- LONG OutMin
Lowest value after conversion 
- LONG OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- LONG Return


MapUInt

MapUInt
Map function for unsigned int type variables 
- UINT Value
Main variable used for map function 
- UINT InMin
Lowest input value 
- UINT InMax
Highest value input 
- UINT OutMin
Lowest value after conversion 
- UINT OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- UINT Return


MapUlong

MapUlong
Map function for unsigned long type variables 
- ULONG Value
Main variable used for map function 
- ULONG InMin
Lowest input value 
- ULONG InMax
Highest value input 
- ULONG OutMin
Lowest value after conversion 
- ULONG OutMax
highest value after conversion 
- BOOL ClampMinMax
Clamp min & max so result does not go above or below set values. 0=No, 1=Yes 
- ULONG Return


Property reference

Properties