Reputation: 1537
Goal: Configure Simulink to read serial data from a sensor.
BACKGROUND: A serial sensor delivers 3 bytes each second and was validated on a serial terminal. This model is Based on the Mathworks Instrument Toolbox's Simulink Send \ receive example:
OBSERVATION The "Query Instrument" Block can be configured for COM1,2,3 or 4: not COM13. I am assuming that the 'Serial Configuration' block is necessary for the model in the sense that it declares \ opens the COM13 port to the Simulink model.
QUESTION
1) Is the 'Query Instrument block' the appropriate block for serial data?
2) Why is the 'Query Instrument block' not configurable to COM13?
In this 'smoke test' example the goal is to display 3 byte serial data @1Hz. Bitwise manipulations will be needed to process status byte and cast the measurement bytes.
Upvotes: 0
Views: 2476
Reputation: 1537
The "To Instrument" and "Query Instrument" blocks are older blocks and were hardcoded to only be used for ports COM1-COM4. For a device that's on a different serial port, please try the "Serial Send" and "Serial Receive" blocks to achieve the same functionality. The block parameters dialog for these blocks should auto-populate the list of available COM ports to communicate with so that you can select the proper port for your device.
Upvotes: 0