Any idea why the first time for every channel the cantpapi.init takes ages (+30s).... we have 4 can cards in our pc... so it will take up to 4x30s ....
Code is very simple ... see below ...
public int SetupCommunication(int channel)
{
//----------------------------
// setup uds connection
//----------------------------
byte canchannel = (byte)(0x40 | channel);
//init UDS connection
TPCANTPStatus sts;
// Connects to the selected PCAN-ISO-TP channel.
sts = CanTpApi.Initialize(canchannel, TPCANTPBaudrate.PCANTP_BAUD_33K);
Trace.WriteLine(string.Format("CANTP INIT : {0}",sts));
//do mappings
sts = CanTpApi.Reset(canchannel);
Trace.WriteLine(string.Format("CANTP RESET : {0}", sts));
sts = CanTpApi.RemoveMapping(canchannel, 0x24c);
sts = CanTpApi.RemoveMapping(canchannel, 0x64c);
sts = CanTpApi.AddMapping(canchannel, 0x24c, 0x64c,
TPCANTPIdType.PCANTP_ID_CAN_11BIT, TPCANTPFormatType.PCANTP_FORMAT_NORMAL,
TPCANTPMessageType.PCANTP_MESSAGE_DIAGNOSTIC,
0x1a,
0x1b,
TPCANTPAddressingType.PCANTP_ADDRESSING_PHYSICAL, 0x00);
Trace.WriteLine(string.Format("CANTP MAP1 : {0}", sts));
sts = CanTpApi.AddMapping(canchannel, 0x64c, 0x24c,
TPCANTPIdType.PCANTP_ID_CAN_11BIT, TPCANTPFormatType.PCANTP_FORMAT_NORMAL,
TPCANTPMessageType.PCANTP_MESSAGE_DIAGNOSTIC,
0x1b,
0x1a,
TPCANTPAddressingType.PCANTP_ADDRESSING_PHYSICAL, 0x00);
Trace.WriteLine(string.Format("CANTP MAP2 : {0}", sts));
return 0;
}
CanTpApi.Initialize takes very long (+30s)
Re: CanTpApi.Initialize takes very long (+30s)
Hello,
we have tested your code on a PC running Windows 10 - x64 (PCI-Express FD), compiled with C++ and C#. Both works without problems, i.e. there is no delay at connect. Please check the following on your side:
we have tested your code on a PC running Windows 10 - x64 (PCI-Express FD), compiled with C++ and C#. Both works without problems, i.e. there is no delay at connect. Please check the following on your side:
- PCAN-Basic version being used. The last verison is 4.1.0. If your version is older, please update it.
- PCAN-ISO-TP verison being used. The last version is 2.0.0. If your version is older, please update it.
Best regards,
Keneth
Keneth
Re: CanTpApi.Initialize takes very long (+30s)
We will update the APIs... they seems to be very old ... keep you posted...
Re: CanTpApi.Initialize takes very long (+30s)
Hi Barry,
We have similar issue, have you succeeded to solve it? We have installed the newest APIs but without success. Interestlingly is somehow related to the network connection. Some stations at development phase in the development shoplfloor never had this problem but once moved to production floor where the network is limited the issue started, but not all stations, this is again weird.
We have similar issue, have you succeeded to solve it? We have installed the newest APIs but without success. Interestlingly is somehow related to the network connection. Some stations at development phase in the development shoplfloor never had this problem but once moved to production floor where the network is limited the issue started, but not all stations, this is again weird.
Re: CanTpApi.Initialize takes very long (+30s)
Hello,
are you also using the PCAN-UDS API?
are you also using the PCAN-UDS API?
Best regards,
Keneth
Keneth