01-16-2019 10:01 AM
I am working on a data acquisition project where i need to read the .nitrace file created by NI I/O trace directly(not the exported .txt file format ) using matlab. when i open the .nitrace file with matlab, I find some encoded language (attached with the picture) which is not very useful without knowing the encryption technique used in .nitrace file format.
Any leads on this topic is appreciated.
Thanks,
Ranjith veeran
Solved! Go to Solution.
01-21-2019 06:35 AM
I highly doubt about decoding .nitrace file format. Why not rather save NI I/O trace file into .txt? You even can do it from LabVIEW with NI I/O trace API:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9MWSA0&l
Hope this helps!
Regards
01-21-2019 06:53 AM
As specified, the tool I am working with is completely developed in MATLAB platform. Is there any NI trace api available to perform the similar things in matlab ?
01-21-2019 07:58 AM
there is no MATLAB API, or any text-language API publicly available for NI I/O trace. The only one you can freely use is the one in LabVIEW.
If the file is already outputted in .nitrace format from other LabVIEW application, you should ask the developer of that app to change it for text file format. Otherwise you can then export the .nitrace file manually in NI I/O trace which I believe, is not convenient
Regards,
01-21-2019 08:23 AM
Thanks for the response. I am trying to resolve the problem by calling IO trace application from matlab and use 'java robot' in matlab to create the .txt file from IO trace.
01-21-2019 08:41 AM
Sounds like an idea!
Good luck, let us know, whether it did work out for you.
Regards,
01-22-2019 04:56 AM
Hello patrick,
is there any shortcut key available for exporting text file from IO trace ?
thanks,
ranjith
01-22-2019 06:31 AM
Hi Ranjith,
no direct constant.
However you can in Tools->Options->Logging set logging directly into the file (even .txt) after you captured desired API calls.
When you have NI I/O Trace window active, you can go with help of a Windows environment for a shortcut, therefore:
Alt+RightEnter+E
or
Alt+ArrowDown/ArrowUp+E
It's too simple, but it might work.
Regards,
01-22-2019 08:02 AM
Hello patrick,
Thank you for the response. i can successfully export the .txt file
the following is a simple matlab function which can export .txt file invoking io trace.exe:
function o = nitrace2txt(input_nitrace_file)
h = actxserver('WScript.Shell');
winopen(input_nitrace_file) % opens the .nitrace file using io trace
h.SendKeys('%'); %invokes attention to io trace
pause(1); %wait
h.SendKeys('%'); %points file menu
pause(1); %wait
h.SendKeys('{DOWN}'); %opens file menu
pause(1); %wait
h.SendKeys('E'); %points export
pause(1); %wait
h.SendKeys('~'); %perform exporting
pause(1); %wait
h.SendKeys('~'); %save txt file in the same folder
pause(1); %wait
h.SendKeys('%{F4}'); %closes ni io trace
end