Block: AutoSwitch



PIC




Inports


In1

Input #1



Switch

Input #2: Threshold signal



In3

Input #3






Outports


Out

Either value of input #1 or input #3 dependent on value of input #2






Mask Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal




Description:

Switch between In1 and In3 dependent on Switch signal:

Switch signal rising: Switch >= Threshold up –> Out = In1

Switch signal falling: Switch < Threshold down –> Out = In3

Implementations:
FiP8 8 Bit Fixed Point Implementation
FiP16 16 Bit Fixed Point Implementation
FiP32 32 Bit Fixed Point Implementation
Float32 32 Bit Floating Point Implementation
Float64 64 Bit Floating Point Implementation

Implementation: FiP8


Name FiP8
ID 128
Revision 0.1
C filename AutoSwitch_FiP8.c
H filename AutoSwitch_FiP8.h

8 Bit Fixed Point Implementation



Controller Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal



Status

Current hysteresis state




Data Structure:

typedef struct { 
     uint16        ID; 
     int8          *In1; 
     int8          *Switch; 
     int8          *In3; 
     int8          Out; 
     int8          Thresh_up; 
     int8          Thresh_down; 
     int8          Status; 
} AUTOSWITCH_FIP8;

Implementation: FiP16


Name FiP16
ID 129
Revision 0.1
C filename AutoSwitch_FiP16.c
H filename AutoSwitch_FiP16.h

16 Bit Fixed Point Implementation



Controller Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal



Status

Current hysteresis state




Data Structure:

typedef struct { 
     uint16        ID; 
     int16         *In1; 
     int16         *Switch; 
     int16         *In3; 
     int16         Out; 
     int16         Thresh_up; 
     int16         Thresh_down; 
     int8          Status; 
} AUTOSWITCH_FIP16;

Implementation: FiP32


Name FiP32
ID 130
Revision 0.1
C filename AutoSwitch_FiP32.c
H filename AutoSwitch_FiP32.h

32 Bit Fixed Point Implementation



Controller Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal



Status

Current hysteresis state




Data Structure:

typedef struct { 
     uint16        ID; 
     int32         *In1; 
     int32         *Switch; 
     int32         *In3; 
     int32         Out; 
     int32         Thresh_up; 
     int32         Thresh_down; 
     int8          Status; 
} AUTOSWITCH_FIP32;

Implementation: Float32


Name Float32
ID 131
Revision 0.1
C filename AutoSwitch_Float32.c
H filename AutoSwitch_Float32.h

32 Bit Floating Point Implementation



Controller Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal



Status

Current hysteresis state




Data Structure:

typedef struct { 
     uint16        ID; 
     float32       *In1; 
     float32       *Switch; 
     float32       *In3; 
     float32       Out; 
     float32       Thresh_up; 
     float32       Thresh_down; 
     int8          Status; 
} AUTOSWITCH_FLOAT32;

Implementation: Float64


Name Float64
ID 132
Revision 0.1
C filename AutoSwitch_Float64.c
H filename AutoSwitch_Float64.h

64 Bit Floating Point Implementation



Controller Parameters


Thresh_up

Threshold level for rising switch signal



Thresh_down

Threshold level for falling switch signal



Status

Current hysteresis state




Data Structure:

typedef struct { 
     uint16        ID; 
     float64       *In1; 
     float64       *Switch; 
     float64       *In3; 
     float64       Out; 
     float64       Thresh_up; 
     float64       Thresh_down; 
     int8          Status; 
} AUTOSWITCH_FLOAT64;