Why don't I receive any data from my hardware device if I try reading the data in a callback function using "parfeval"?
Show older comments
I am trying to read data from a Bluetooth device. I have code which works perfectly fine in MATLAB. But when I was reading the data in MATLAB, current MATLAB session remained busy till the data was read. However, I wanted to acquire this data in parallel, so I decided to use "parfeval" to read data on a different worker. I am creating Bluetooth object and using "fopen" to open Bluetooth connection in MATLAB. I have a call back function which will be used in "parfeval", this function accepts this Bluetooth object and reads data from Bluetooth device. However, when I call this function using "parfeval", I get an error saying:
ERROR: Error using parallel.FevalFuture/fetchOutputs (line 147)
One or more futures resulted in an error.
ERROR: Error in parallelProcessingTest (line 61)
val = fetchOutputs(f)
Cause by:
Error using icinterface/fscanf (line 208)
OBJ must be connected to the hardware with FOPEN.
Since, this function was working correctly when I was not using "parfeval", I believe the issue is because of "parfeval". How can I collect Bluetooth data in callback function using "parfeval"?
Accepted Answer
More Answers (0)
Categories
Find more on Background and Parallel Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!