Hi Vivek,
I understand that you want to implement different logic based on the different data type of the signal. But In Simulink, directly fetching the data type of a signal within the model (such as from an Inport block) using a Fcn block is not possible. The Fcn block is designed to perform mathematical operations and does not have the capability to determine signal properties like data type.
However, there are a few approaches you can consider for handling different logic based on the data type of an input signal:
- Data Type Conversion Block:
- Use a Data Type Conversion block to explicitly convert the signal to a known data type before it enters the Fcn block. This ensures that you know the data type and can implement the appropriate logic.
2. Variant Subsystems:
- Use Variant Subsystems to switch between different implementations based on the data type. You can control the variant conditionally based on the data type using a MATLAB script or a mask parameter.
3.Custom S-Function:
- Create a custom S-Function that can access the data type of the input signal and implement the required logic based on that. S-Functions have more access to the simulation environment and can be programmed to check signal properties.
I hope it helps to resolve the issue!