Add text in log file and change log directory
Add text in log file and change log directory
PCIE CANBUS
c# / Visual Studio
Windows
Hi,
I've implemented with success the log file in my application.
Now I would like to know If :
Is there a parameter to put the log file in a subdirectory of my application ? : "\\CANLog\\" for example
Is there a function to add text in the log file to write the step on my protocol in the file to read it easily ?
Is there a solution to add the Transmitted message in the message listview of your sample code ?
Thanks
c# / Visual Studio
Windows
Hi,
I've implemented with success the log file in my application.
Now I would like to know If :
Is there a parameter to put the log file in a subdirectory of my application ? : "\\CANLog\\" for example
Is there a function to add text in the log file to write the step on my protocol in the file to read it easily ?
Is there a solution to add the Transmitted message in the message listview of your sample code ?
Thanks
Re: Add text in log file and change log directory
Hello,
please check the available parameters for LOG handling:
please check the available parameters for LOG handling:
See PCAN_LOG_LOCATION
See PCAN_LOG_TEXT
Not sure to understand. IF you mean the GUI sample project, well transmitted messages are already being written in that List-View. This is just what that List-View is intended for.
Best regards,
Keneth
Keneth
Re: Add text in log file and change log directory
Correction:
Received messages are shwon here. If you want to include the transmitt messages you have to change the code, of course. Just study the code and see where you have to pass your transmitted messages and how to handle those information. It will be very similar to that what is already implemented for received messages
Best regards,
Keneth
Keneth
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: Add text in log file and change log directory
Hello,
You can enable the parameter PCAN_ALLOW_ECHO_FRAMES and you will receive your transmitted messages in the message listview.
You can enable the parameter PCAN_ALLOW_ECHO_FRAMES and you will receive your transmitted messages in the message listview.
Best regards,
Fabrice
Fabrice
Re: Add text in log file and change log directory
I agree,
the solution from F.Vergnaud just suits best for your needs.
the solution from F.Vergnaud just suits best for your needs.
Best regards,
Keneth
Keneth
Re: Add text in log file and change log directory
The log works fine thanks
Thanks for the ECHO tips but in the log it will appear in Rx instead Tx.
Thanks for the ECHO tips but in the log it will appear in Rx instead Tx.
Re: Add text in log file and change log directory
Please read your own question:
If you want to include sent and received messages in the LOG file you just need to configure the LOG as needed, by using PCAN_LOG_CONFIGURE. Please check and read the documentation. All paramerters are well documented and explained with sample code.
The Echos are transmitt messages that will appear in the listview.
If you want to include sent and received messages in the LOG file you just need to configure the LOG as needed, by using PCAN_LOG_CONFIGURE. Please check and read the documentation. All paramerters are well documented and explained with sample code.
Best regards,
Keneth
Keneth
Re: Add text in log file and change log directory
I've tried to add text in the log file like the documentation
I can see the logged sucessfully in the console but the text is not added in the log
Code: Select all
private void VarStepChange(string Step)
{
if(PCANBasic.SetValue(PCANBasic.PCAN_NONEBUS, TPCANParameter.PCAN_LOG_TEXT, Step, (uint)Step.Length) == TPCANStatus.PCAN_ERROR_OK)
Console.WriteLine("logged sucessfully");
else
Console.WriteLine("Error! It was not possible to log own message");
}
Re: Add text in log file and change log directory
I don't want to add more message in the CAN BUS.
I will stay with the analyze of the log file.
I will stay with the analyze of the log file.
Re: Add text in log file and change log directory
Hello,
If you principally want to analyse the CAN data, you should rather use a TRACE file (not log file). For generating such a file you have similar parameter to the LOG ones.
If you principally want to analyse the CAN data, you should rather use a TRACE file (not log file). For generating such a file you have similar parameter to the LOG ones.
- Attachments
-
- TRACE.JPG (30.76 KiB) Viewed 36069 times
Best regards,
Keneth
Keneth