Capturing transmitted message from PCAN-View
Capturing transmitted message from PCAN-View
Hello,
A quick question for you guys!
Just wondering if there's a quick and easy way to capture a sent user-generated message from PCAN-View, just the CAN ID and data content. I've done a super quick poke-around in the PCAN-Basic API, would I benefit from looking a little further into it?
Thanks in advance for the help!
A quick question for you guys!
Just wondering if there's a quick and easy way to capture a sent user-generated message from PCAN-View, just the CAN ID and data content. I've done a super quick poke-around in the PCAN-Basic API, would I benefit from looking a little further into it?
Thanks in advance for the help!
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Capturing transmitted message from PCAN-View
Hello,
Thank you for your request.
The easiest way to capture messages is to use the Trace-feature of PCAN-View,
which allows you to capture all messages present on the bus.
Sent messages will be marked as "TX" in the trace-file.
Also you can export all messages currently in your transmit list as a transmit-list file
via the File-dialogue -> "Save".
You could also use the PCANBasic-API for this purpose, if you prefer.
In this case you could write all messages transmit to a seperate file once PCANBasic
returns a successful transmission.
Maybe you could describe your usecase a bit further so i might suggest a more tailored solution to you.
Best Regards
Marvin
Thank you for your request.
The easiest way to capture messages is to use the Trace-feature of PCAN-View,
which allows you to capture all messages present on the bus.
Sent messages will be marked as "TX" in the trace-file.
Also you can export all messages currently in your transmit list as a transmit-list file
via the File-dialogue -> "Save".
You could also use the PCANBasic-API for this purpose, if you prefer.
In this case you could write all messages transmit to a seperate file once PCANBasic
returns a successful transmission.
Maybe you could describe your usecase a bit further so i might suggest a more tailored solution to you.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Capturing transmitted message from PCAN-View
I have created labview vi using pcan basic dll. I am able to read and write the messages but I am not able to capture a trace using pcan basic api.
I have set following parameters using CAN_SetValue function-
1. PCAN_TRACE_LOCATION
2. PCAN_TRACE_STATUS
3. PCAN_TRACE_SIZE
4. PCAN_TRACE_CONFIGURE
are these parameters supposed to be set in some order? Can you provide an example?
I have set following parameters using CAN_SetValue function-
1. PCAN_TRACE_LOCATION
2. PCAN_TRACE_STATUS
3. PCAN_TRACE_SIZE
4. PCAN_TRACE_CONFIGURE
are these parameters supposed to be set in some order? Can you provide an example?
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Capturing transmitted message from PCAN-View
Hello,
The Parameter PCAN_TRACE_STATUS is also setable,
to start the the Trace you'll have to set it ("PCANBasic.PCAN_PARAMETER_ON").
Furthermore you`ll have to make sure you are actively reading during the recording of
a trace.
So, after configuration you'll have to set the PCAN_TRACE_STATUS and make sure
PCANBAsic is reading during the recording of a trace.
Please report back to us, if this has solved your issue.
Best Regards
Marvin
The Parameter PCAN_TRACE_STATUS is also setable,
to start the the Trace you'll have to set it ("PCANBasic.PCAN_PARAMETER_ON").
Furthermore you`ll have to make sure you are actively reading during the recording of
a trace.
So, after configuration you'll have to set the PCAN_TRACE_STATUS and make sure
PCANBAsic is reading during the recording of a trace.
Code: Select all
TPCANStatus stsResult;
uint iStatus = PCANBasic.PCAN_PARAMETER_ON;
// We activate the tracing by setting the parameter.
stsResult = PCANBasic.SetValue(PcanHandle, TPCANParameter.PCAN_TRACE_STATUS, ref iStatus, sizeof(int));
if (stsResult != TPCANStatus.PCAN_ERROR_OK)
{
ShowStatus(stsResult);
}
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Capturing transmitted message from PCAN-View
I was not setting the buffer length before.
But now after setting the buffer length I am getting unknown error.
Could you please check the attachment and confirm if the values I am setting are correct or not?
But now after setting the buffer length I am getting unknown error.
Could you please check the attachment and confirm if the values I am setting are correct or not?
- Attachments
-
- D1BCA991-739F-4E8D-AE8B-5F2C038620B6.jpeg (2.36 MiB) Viewed 11168 times
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Capturing transmitted message from PCAN-View
Hello,
Can you share a screenshot of this unknown error with us?
Best Regards
Marvin
Can you share a screenshot of this unknown error with us?
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Capturing transmitted message from PCAN-View
It’s the error code returned from CAN_SetValue function.
The error value is 65536 which signifies ‘PCAN_ERROR_UNKNOWN - Unknown error’.
The error value is 65536 which signifies ‘PCAN_ERROR_UNKNOWN - Unknown error’.
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Capturing transmitted message from PCAN-View
What exactly did you change regarding the bufferlength?
the bufferlength seems to be defined as a Uint32
as far as i can tell from your screenshot.
The length of the buffer is the size of uint32 or 4Bytes.
Please report back to us regarding this.
Best Regards
Marvin
the bufferlength seems to be defined as a Uint32
as far as i can tell from your screenshot.
The length of the buffer is the size of uint32 or 4Bytes.
Please report back to us regarding this.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Capturing transmitted message from PCAN-View
Earlier I was not passing any value to buffer length so I am guessing it was taking the default value as 0 and I wasn’t getting any error. But after looking at the example you provided I passed 4 as the value for buffer length and now with buffer length 4 I am getting unknown error.
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Capturing transmitted message from PCAN-View
Do you use your own VI or
do you use a third party VI?
Best Regards
Marvin
do you use a third party VI?
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team