MATLAB: Am I not receiving any data on the host PC

simulink

Why am I not receiving any data on my host PC?
I am using Simulink Real-Time with a WebCam connected to my target PC. My Simulink model reads images from the WebCam and then processes them. However, my model is not receiving any image data. Why is this?

Best Answer

When using Simulink Real-Time, remember that you have two different computers: the Target PC and the Host PC. If you run your model on the target PC, it will read data from the WebCam and process it on the target PC. You can use the Simulink Real-Time Explorer to observe the behavior of the model running on the target PC. If you run your model on the host PC, it will not find the WebCam because it is not connected to the host PC.
If you would like to read and process data from the webcam on the target PC and then transmit the data to the host PC for further visualization/processing, you have a couple of options depending on your needs.
If you would like the host machine to process the data while the target is running, you can use two models: one for the target PC and one for the host PC.
Please see the following Example for more information about how to transmit data from the target PC to the host PC.
If you do not need to process the data on the host machine until after the target machine has finished, you can log all of the data to files on the target machine. Then you can copy the files over to the host and analyze them later.