Guidance on Modeling System Response with Xcos and Dynamic Input Manipulation

Hello everyone,

I’m currently exploring the capabilities of Xcos for modeling the response function of a system I’m working on. My goal is to dynamically adjust the input variables using interactive elements, such as sliders, to observe real-time changes in the output signal. Eventually, I plan to replace these manual input adjustments with a control algorithm block for automation.

I have a couple of questions and would greatly appreciate any insights or advice from the community:

  1. For implementing interactive sliders to control input variables, is TK Scale a suitable choice within the Xcos environment? If not, what alternatives would you recommend?

  2. I’m encountering an issue where, upon starting the simulation, the windows for my scope and sliders do not maintain a fixed position. They tend to move unpredictably across my screens, and sometimes the scope window is hidden behind the main Scilab window. This makes it challenging to monitor the output and adjust inputs simultaneously. Is there a way to ensure that these elements remain visible throughout the simulation, preferably with the Xcos window in the background? Would creating a custom GUI be necessary to achieve this level of organization and control?

  3. Is it possible to assign a custom name to a TK Scale slider, specifically using the name of the variable it controls? I would like to make the interface as intuitive as possible by labeling each slider with its corresponding input variable name.

As someone who is relatively new to Scilab and Xcos, I’m eager to learn and improve my project with your help. Thank you in advance for any tips or guidance you can provide!

Hello,

Thanks for the nice use case. Maybe @davidcl will be able to answer.

S.

My initial attempt to address the issue involved configuring the Scope Parameters as follows:

I retrieved the current figure handle with h = gcf() and then set the output window position to [5760,0] and the sizes to [1920,1080].

Unfortunately, the window still appears on the incorrect screen.

Is there also a way to anchor the TK Scale windows to a specific location on the screen?

Is it possible to delay the start of the simulation? Currently, the TK Scale and the scope windows overlap each other, and I would like to resolve this issue before initiating the simulation. Can anyone advise on how to achieve this?

Hello @Smart, as you want more than one TKScale I suggest you to take a look at its implementation (it’s fully implemented in Scilab) and create your control dashboard for your needs.

As a reference, TKSCALE.sci is the Block interface function and tkscaleblk.sci is the simulation function.

Using your own dashboard simulation function, you can also delay the start of the simulation up to a click to a button.

1 Like