how to redirect the trace window output to a file in CANoe - can-bus

i would like to get all the data present in the trace window to my text file, even log recording can help but it can't display date and time in that file, so i've a plan to copy entire trace window to file.
i've tried to do ctrl+a and paste in notepad, but it is just copying some sort of area only not all.
i would like to know is there any chance to redirect how trace window is printing like that i can see in text file, or at least is there any way to copy entire file and paste in text file.

The trace windows just display the data, you configure it in the Measurement Setup.
But be aware that this will be only a part of the data anyway. There is a buffer where CANoe stores the data for the Trace window. You can configure the type of this buffer (memory or hard disk) and its size. Go to Options -> Measurement -> Data History to change your settings.
You can also configure the size of the visible data range there. But even with a very long range and a large 200 GB buffer, there might be a possibility that some data will not be available, because the Trace works as a ring buffer deleting the old data on overflow.
If you need the complete data, you should enable the Logging in the Measurement setup. Yes, the data files will be not human-readable. You will then need to open them in the Offline Mode in CANoe to analyze them. The timestamps will be of course logged, so you can easily use them for your analysis.

You could pretty-print it to the write window using CAPL:
on message *
{
int i;
write("[%07.3f] %03X", this.time / 100000.0, this.id);
for (i = 0; i < this.dlc; i++)
writeEx(0, 0, " %02X", this.byte(i));
}
And then export it to a file.
Or you write it directly to a file.

Hi I would suggest logging the necessary data into a CSV and then analyzing using Excel. You can make use of the File Access CAPL functions like openFileWrite for the same

Related

Saving stream of bytes to file in Swift on iOS

I'm using FileHandle to write stream of bytes to the mp4 file.
My data source allows me to input bytesOffset which is basically the current size of the file (if 0 it starts from the beginning, if more then it continue to save until reaches end).
I want to implement restart functionallity, but when write gets interrupted, the file exist, but size is always 0 KB.
Do you know any way to solve this or know any library which could help me with implementing this?
You can use Shamik framework for that.

Can config file size >1024 bytes on ESP8266 Arduino?

I am using ESP8266 Arduino ConfigFile.ino as an example to store configuration settings on SPIFFS.
https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
From this code segment, configFile cannot be >1024 bytes.
size_t size = configFile.size();
if (size > 1024) {
Serial.println("Config file size is too large");
return false;
}
Why is 1024 bytes the limitation for config file size? If this is indeed a limitation, are there ways to overcome this limitation?
It's a limitation only in this particular example - It's meant to serve as a basis for you to start developing your own configuration file code. Nothing is stopping you from creating a larger buffer for both the raw character data and JsonBuffer. I have several configuration files on production devices around 10-20K with no issues to report.

How are printing functions made?

I am making my own programming language, and how can I print characters on screen?
When I try to print using video memory (0xB8000) program crashes...
Erm, no don't do that. This is how an operating system can print stuff to the screen, but I doubt it would allow you to do the same without some kind of segmentation violation.
If you just want to print text to the screen, and assuming you are on a UNIX like system, either use the write[1] system call, or just open the standard output file (stdout, assuming your language allows you to open files) and write there.
[1]: This is the signature for write: ssize_t write(int fd, const void *buf, size_t nbytes);. For more information, read this

spreadsheetgear - open/save file

I want to update an existing Excel file using SpreadsheetGear.
I load the Excel file using:
_activeWorkbook = Factory.GetWorkbook(#"./excel/test.xls");
workbookView1.ActiveWorkbook = _activeWorkbook;
but when I want to save it:
private void menuSave_Click(object sender, EventArgs e)
{
workbookView1.GetLock();
try
{
_activeWorkbook.Save();
}
finally
{
workbookView1.ReleaseLock();
}
}
I get this error: System.IO.IOException: The process cannot access the file 'C:...\bin\Debug\excel\test.xls' because it is being used by another process.
As the exception indicates, some other process (or possibly your same application, if you utilize multiple threads) has a lock on your file and so SpreadsheetGear cannot save it back to disk. Any number of other external processes could be the culprit, such as anti-virus software scanning your file or having it open in Excel itself when you try to save it. There is no way to determine the exact cause with just the information provided above.
What I can tell you is that SpreadsheetGear does not keep any file streams open after reading and writing files. The file stream and lock on the file is only open for as long as it takes to read/write its contents, which is usually very short if the file is small. Put another way, #".excel/test.xls" should be writable immediately after your Factory.GetWorkbook(...) line executes.

How can I get a frame's content with mshtml?

Here's the issue:
I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event to parse the content of the document for some precise info.
That document contains frames, so I look into the HTMLDocument.frames. For each one, I look into the document.body.outerHTML property to check for the content.
Problem is, the string I'm looking for never shows there, whereas it is displayed in the finale page. So, am I looking in the wrong place? If it is displayed when the page is fully loaded, then it's downloaded at some point, right? But in which object should I look ?
BTW, I Don't know if that is of any importance, but the page I'm searching into comes from a ASP.NET application.
public void OnNavigateComplete2(object pDisp, ref object url)
{
document = (HTMLDocument)webBrowser.Document;
mshtml.FramesCollection frames = document.frames;
for (int i = 0; i < frames.length; i++)
{
object refIdx = i;
IHTMLWindow2 frame = (IHTMLWindow2)frames.item(ref refIdx);
string frameContent = frame.document.body.outerHTML;
}
}
Thank your for your help.
#rams
This event is launched many times for each page, so I figured it was each time a framed is loaded, even if i don't get to catch the one I'm looking for. If not, what would be the event to catch the frames content?
What I want to do is detect some precise info on a precise frame, then save it. later, a web page is loaded triggered by some user action, where I need the info I got from parsing the frame.
Do you know the name/id of the frame you are looking for content? If so, in your navigateComplete2 event, can you get a reference to the frame like
iFrame frm = document.frames(<your frame id>);
int readyState=0;
while(frm.readystate !=4){
// do nothing. be careful to not create an endless loop
}
if(frm.readyState==4){
// get your content now
}
HTH
Are you using some kind of threading? Running the browser in a separate thread really messes up things. Try to execute it in an STAThread and check if you get the correct result.
The reason your string does not show is because of the frame. The web browser control fires the document navigate complete event after it has loaded the main document. At this point, the frames haven't yet requested their sources. After the document is parsed by the web browser control, requests for the frame sources are issues and downloaded.
Can you please describe what you are trying to accomplish?

Resources