Combining Scilab with Xcos and Arduino Toolbox

Hey guys,

First of all the problem:

I created a HIL-ManualTesting-Prototype in Xcos using the Arduino Toolbox with an Arduino Mega as an I/O-Device. It works okay but has a bad user experience due to the problem that all the tk-Scale sliders aren't named and also deploying on one window (you have to slide them bigger and put them to another place to use all of them). Currently I am using five TK-Scales but I want to scale the HIL to a bigger size. Moreover I also want to bind one slider to an value. For example I have two states. At state one I can manually change the slider value but if state two appears it should change the slider value to a fix level that is calculated by software.

My thoughts about a solution:

Maybe I can run scilab code in addition to my xcos model and create sliders with the GUI toolbox or sth like that (so both running and scilab delivers live input for the xcos model or rather the Arduino I/O's). I have to admit that I don't use scilab pretty often so here the question:

Is there any way to use scilab to create sliders that are sending live data to my xcos model that is uploading it to my I/O-device or do you have any idea how to fix the problems?

I'm thankful for every answer

Scilab 16-11-20, 8:56 p.m. PaY_DaY
The first solution that comes to my mind is to use CONST blocks in Xcos and assign them some variable name rather than a value. By doing so, you can change the vaiable value while the Xcos simulation is running (may be using sliders defined in the GUI). Try it and let us know.
24-11-20, 10:22 a.m. rupakrokade


I assigned it to CONST-blocks but I still have the problem that I can't change the value while the simulation is running. Could you explain how to change it like you wrote above?

24-11-20, 7:14 p.m. PaY_DaY

Login to add comment

Using a CONST block is just a way to use variables defined in the workspace BEFORE the xcos simulation is started. The TK_SCALE block in the Sources palette can be used to change the values DURING the simulation as it provides a slider.
14-06-21, 1:24 p.m. rupakrokade

Log-in to answer to this question.