how to aquire xPC data in a triggered manner
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Suneesh
on 10 Feb 2014
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 Comments
Suneesh
on 10 Feb 2014
Edited: Suneesh
on 10 Feb 2014
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.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!