Scilab 5.5.2 function as a block in xcos : Variable returned by scilab argument function is incorrect [

拜拜、爱过 提交于 2019-12-25 00:38:08

问题


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.

来源:https://stackoverflow.com/questions/55040779/scilab-5-5-2-function-as-a-block-in-xcos-variable-returned-by-scilab-argument

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!