I have been trying to get the ultrasonic data from an arduino using serial communication toolbox in scilab to be brought in the xcos simulation. To do this I followed Include a Scilab function/script as a block in xcos/scicos and created my own function. Is there a way to plot the serialread data in xcos scope? or i think my implementation is wrong in the scilab function. Iam Using Windows 10 64bit
SCILAB function
function y = serialREAD(a)
h = openserial(7, "9600,n,8,1") // open COM7
for ii = 1:a
y = strtod(part(readserialline(h), [1,2,3])) * (a/a)
end
closeserial(h)
endfunction
endfunction
XCOS block diagram
The ERROR [ This error has been solved converted the string to a double using the strtod ]
The Data in CMscope but not in realtime only after the simulation my final integration time is 100.