System date and time in XPC target model
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to get the system date and time in my simulink model, which is used for XPC target. In simulink, this is not a problem, using the embedded matlab function with the following code:
function [Y, M, D, H, MN, S] = sysClock()
coder.extrinsic('clock');
Y = 0;
M = 0;
D = 0;
H = 0;
MN = 0;
S = 0;
[Y, M, D, H, MN, S] = clock;
end
However, this block gives me error messages when I try to compile it to XPC. Is there another way? Or do I need to change the code? Shouldn't be such a difficult problem I would say...
Thanks!!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Jan De Vries
am 28 Aug. 2012
2 Kommentare
Kaustubha Govind
am 28 Aug. 2012
Where do you get xpcwalltime.c from? The file in the above solution is named xpctimeofday2.c, and I am able to compile it successfully with the mex command.
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!