MATLAB: Quanser+Simulink Real-time workshop, triggered save to host computer.

data acquisitionreal time workshopsimulinksimulink coder

Hello,
I have a problem configuring a real-time experiment to save data the way I want to, if someone here could help I would be very grateful.
The setup that I'm using is a Quanser Shake Table II and a Quanser Q8 data acquisition card installed in a PC running 32-bit Windows 7 and Matlab/Simulink with real time workshop.
I've managed to set everything up so that it is to control the shaking table and read out the response from the mechanical system mounted on the table. After changing the forcing parameters (frequency and amplitude) of the table, the mechanical system has a long transient period, before it settles down to a stationary behavior. Since I'm only interested in saving data for a short period of the stationary behavior, and the continue changing the parameters of the experiment, I need to be able to trigger the data-streaming on/off. Qunaser made a block specifically for writing data to the host-pc, and this block can be triggered in the same way as scopes through the 'External Mode Control Panel' in Simulink.
Now my problem is that it is not possible for me to choose different options for triggering different signals. If i make a trigger signal, that will allow me to trigger the data-stream to disk, all the scopes that triggers using this signal. This is very unfortunate since it is important for me to be able to monitor the experiments throught the scopes, while it is running. Furthermore, the .mat file that the Quanser block creates appears to be corrupted, unless I stop the execution of the model on the Real-time target before loading it. This same is the case if I use the save data to workspace feature from the scopes. Since my experiment has to run continously it is not possible for me to start and stop the model on the real time target.
I am sorry for the lengthy text, it was hard to explain shorter..
If anybody could help me with this, or even just if anybody has an idea of what I could try, I would be greatly apreciated!
Thank you very much!
– Emil

Best Answer

What version of MATLAB are you using? At least in the latest release, it appears possible to select individual signals for triggering: http://www.mathworks.com/help/toolbox/rtw/ug/bs61qx2.html#f1003723 (full disclosure: I don't have any experience with external mode simulations)
There also appears to be an option "Write intermediate results to workspace" which should let you examine the data without stopping the model.