フィルターのクリア

Simulink Desktop Real-time with DAT I/O (or NON- SLDRT I/O blocks) with the Real-time-sync block, and Matlab functions in Simulink

2 ビュー (過去 30 日間)
Can the normal Data Acquisition Toolbox Blocks available in Simulink be synchronized in real time with the Desktop Real-time "real-time-sync" block?
I use the signal generator block to generate a sine wave at say 10Hz, directly feed it into an Analog Output from the Data Acquisition Block "Analog Output" (NOT the Desktop real-time analog output block), set the sample rate of my NI PCIe-6321 setting to the max, and set the configuration setting's fixed time step to something like .0001 so that the sine wave is not so aliased and staircasey- on an external real scope connected to the analog output voltage, the sine wave signal is incredibly slow. I realize this is because the simulation time is NOT real time.
I thought I could stick in the Desktop real-time-sync block to make (any?) block in normal mode synchronized to real time, but still see the same result (a very slow sine wave, NOT 10Hz on a real external scope).
I know if I use strictly the Desktop Real-Time analog output this issue is resolved, and it truly is real time.
Am I missing something about the "real-time sync" block then? It can't synchronize a DAT output block? I ran the Van der Wahls example- which has no IO features, its fine. I can't find for the life of me what the "real-time sync" block is limited to... can it synchronize a matlab function that is put into a simulink block?
The reason I ask is, I have a Measurement Computing DAQ that has NO support from the desktop real-time IO blocks (https://www.mathworks.com/matlabcentral/answers/325269-measurement-computing-data-acquisition-devices-support-in-data-acquisition-toolbox-across-releases), or any Simulink DAQ block for that matter. It is one of these nicer 24 bit ones (https://www.mccdaq.com/usb-data-acquisition/USB-2416-Series.aspx). In such a case (it does have regular matlab support I suppose?), if I want to write my own matlab (.m file, not going to another language) to send output and get input from that DAQ, and then put it into a Simulink block, can the real-time-sync block from the Desktop Real-Time be used to synchronize IO such that I get the same result as using a Desktop Real-Time IO block?? I also have DAQs that DO have Simulink DAT support but not in Desktop Real-Time IO support (data translation daq), and GPIB devices I want to control in real time. Are all these synchronizable to real-time control by Dekstop Real-Time IO block, without resorted to generating C code, Mex file, etc? (or what would be the suggested flow in that case).
The path/language/software I choose has a lot of implications for whether my code can be used by other engineers from the get go or how much extra training I need to plan in, and I've spent a week digging around and haven't found a very centralized place discussing all this. Thanks for the help, really appreciate it.

採用された回答

Mandar Patwardhan
Mandar Patwardhan 2017 年 7 月 28 日
Can the normal Data Acquisition Toolbox Blocks available in Simulink be synchronized in real time with the Desktop Real-time "real-time-sync" block? Using the Real Time Sync block won't work with the DAQ Blocks. If you want to speed up the execution, you can try running the model with the DAQ blocks in Accelerator mode. (But this won't be in Real Time).
Refer to the following link to write custom I/O drivers. Custom I/O Driver Basics
  1 件のコメント
X W
X W 2017 年 7 月 31 日
Got it, many thanks for your response.
In the case that "normal" mode is only available for the blocks I'm running Simulink with, what would be the best way to set a start and stop time for a given real amount of time? For example, if my control loop runs in "normal" simulation mode, on "inf" for infinite amount of "simulation time"- what would be the best way to stop the simulation and collect results for 10 real hours?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by