how to aquire xPC data in a triggered manner

3 次查看(过去 30 天)
Hello,
I would like to log some signals in xPC, preferentially to file using xPC file-scope. However, I would like to log data only at the occurrence of a trigger signal and would very muck like to have one file per trigger event (i.e., each time the trigger goes high, make a new file called like xxx001.dat and log data until trigger gets low. At second trigger event log to xxx002.dat and so on).
Dividing the recorded data is essential as logging everything to one file would make this file huge (!) and make data extraction difficult too...
Any ideas how I can do so? Alternatives would help me too.
Thanks in advance.

采纳的回答

Suneesh
Suneesh 2014-2-10
1 "have one file per trigger event": For this I am not able to think of a way apart from having several File Scope blocks each of them getting triggered at a different point in time.
2. If your main concern is having files that are too big then maybe you can use 'Dynamic file name enabled'. This enables splitting the files. Look for 'Dynamic file name enabled', 'Max file size in bytes' and AutoRestart in:
  4 个评论
Suneesh
Suneesh 2014-2-10
编辑:Suneesh 2014-2-10
The only other solution I can think of is to write your own C MEX S-Function which internally uses C commands like FOPEN etc to write to files. I feel you can name the files in you code as well. If you are not familiar with S-Functions this is not going to be trivial.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by