Developing a mlapp - simulink app to control a tool with inputs and outputs signals in order to test parts automatically

1 次查看(过去 30 天)
Dear all,
I'm trying to develop an app to control a tool which heats, rotates many times and cool down parts to pass its life time tests. I need an interface to control this tool and also to show the temperature, number of cycles, etc. I have to use cDaq device from National Instruments to read motor position, activate the motor, etc. (I'm already able to set outputs, read inputs and so on with the commands from Matlab).
The process starts heating the chamber (activate a digital output from cDaq), until defined temperature is reached (temperature is catched with a thermocouple connected to the cDaq device), then run the motor with a sensor which counts turns (I have to detect the edge of the sensor and register the number of turns), and after a certain turns and time change the direction of the motor (activating another digital output)
I'm really lost regarding the right approach to create the structure. I think a state machine with stateflow inside simulink model is a right solution, but many tries and only errors appeared. I did not found and example of a similar system: control a real machine/tool with input-output signals with a cDaq.
I will appreciate if you can give me some example or documentations.
Thanks in advance, best regards,
Samuel

采纳的回答

Ayush
Ayush 2023-9-5
Hi Samuel,
I understand that you want to develop an app to control a tool that undergoes heating, rotation, and cooling for lifetime tests and for the same you need an interface to control the tool and display information like temperature and cycle count. You have a cDaq device from National Instruments to read motor position and activate the motor and you are considering using a state machine with Stateflow in a Simulink model but have encountered errors. You want some examples or documentation on controlling a real machine/tool with input-output signals using a cDaq device.
For developing an app, you can use MATLAB's App Designer or GUIDE to create a graphical interface that allows the user to control the tool, and view relevant information, and implement callbacks or event handlers in the interface to call the respective MATLAB functions/scripts when the user interacts with the controls.
Finding specific examples or documentation that precisely matches your requirements for controlling a real machine/tool with a cDaq using Stateflow can be challenging due to the specificity of your use case. However, you can explore the resources provided by National Instruments and MathWorks, to gain insights and guidance on integrating the cDaq device with Stateflow for your application.
To learn more about MATLAB App Designer, you can refer to the MathWorks documentation link below: Develop Apps Using App Designer - MATLAB & Simulink - MathWorks India
Hope this helps!
Regards,
Ayush Goyal
  1 个评论
Samuel Pina
Samuel Pina 2023-9-7
Thank you for your support. After reading all documentation found in Mathworks and forums I rejected the original idea of using Stateflow and simulink model. I created the state machine with code as a matlab function and called from the mlapp main function. I expect to use simulink in future for other purposes :).
Regards,
Samuel

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Control Design 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by