CAN Library from tdxAllLibrariesDll for Apalis T30 with WinCE and VB.net

Hello Regarding the former Question here is some VB.net Code which i wish would work (I made it As Simple as Possible (VS2008). Please take a look at the attached file and help to point out the error.

Best regards,

Stefan

As mentioned on the other thread, you currently have to use SPI4 and SPI6. The CAN1 and CAN2 identifier do not work in this lib version.

Attached some sample code.
[link text][1]
[1]: https://share.toradex.com/260wbz4la6j13oi?direct

Output is Handle = 0, Fail to set Configuration.

I tested with an internal version that already fixed this issue. You find the internal release here.

link text
Works much better, but still not to our full satisfaction.
It does not send messages on the bus or receive messages from the bus.
Are the Settings/Parameters correct for the designated purpose?

When the BOOL Can_Read ( HANDLE hPort, pCanMsg msg) is executed, does the return value also return false if there are no messages?

Here you find my VB.net Sample Project for VS2008.

Unfortunately I’m stuck with the Can_Read function. Initialisation and Sending works now.

Would you please aid me to receive CAN Messages?

Hello @Stepfan.P: We are working on this and provide you an update next week.

Hello @samuel.tx,

thank you for the information. We are eagerly waiting for this update.

Best regards, Stefan

Btw: You linked the wrong User. (How does one link a user?) (Solved)

@roman.tx: This seems to not work at my place. If i press AltGr+Q it inserts “Blockquote” if i Insert the @ via Clipboard it seems to work. I expected it would work like in Facebook :wink:

Blockquote

Hello @samuel.tx,

Do you think you can provide a Solution until mid of next Week?

Best regards,
Stefan

@Stefan.P: A colleague from the library team is working on this. I will ask him to provide you an update on the status and the schedule.

@Stefan.P We are able to fix CAN library for Apalis T30 and it seems to be working fine. Also, have made little changes in the demo code for better understanding please have a look in lib demos folder.
Dowload the preliminary version

Let me know if you need to discuss further

@raja.tx : What does IOGPIO(178); return? Is this the correct IO for CAN1 (SPI6)?
Unfortunately my sample programm still doesn’t run as expected.
Can you supply your CANDemo as executeable for Apalis T30 and CE7?

Best regards, Stefan

@Stefan.P: I attached you a modified source of the demo. This setting works on the CAN1 (upper port on the Apalis Evaluation Board) with the Apalis T30. I quickly tested and was able to send and receive data based on the source I shared with you and the download archive @rajat.tx shared with you.

Could you let me know where the demo fails on your side?

@raja.tx, @samuel.tx

Finally it is working great. Some Issues are left:

  • It can receive CAN Messages with extended Identifiers properly if the FrameFormat is set…
  • Is it true, that the new Library only works with CE7 Image 2.1B2 and up? I tried with 2.0 and it didn’t work.
  • The Timeout CAN Configuration Parameter is not fully clear to me. “CAN timeout in ms, INFINITE to wait until operation is complete.” What do i need to specify immediate return from the function if no (more) messages are in the Buffer? For me it works with “3”. The use case is, that i call the BOOL Can_Read ( HANDLE hPort, pCanMsg msg) cyclically and i need to read all messages which were received - and hope that the buffer will not overflow. For me it seems as there is a time wasted in waiting for messages which are not yet received.

Best Regards,
Stefan

@Stefan.P

Did you make it work with Timeout parameter?
We would like to know your feedback.

@samuel.tx,

  1. We tested with 2.0 image, CAN library works. CAN Library doesn’t limit with Tegra release version.
  2. You can use as little as the 1-millisecond timeout. 0 is not a valid parameter. 1 millisecond to INFINITE is a valid parameter. Please refer attached code. We will discuss internally regarding implement 0 ms timeout parameter and let you know our feedback.

@raja.tx, sorry for the late response. - With Timeout = 1 it also works flawless, with a value of 3 it also worked for me - in Fact for me it seems not to make a difference.
With TimeOut = 0 it doesn’t work properly. I don’t know how long the Reading takes but with 1ms it is ok for my application

Best regards,
Stefan

@raja.tx, sorry for the late response. - With Timeout = 1 it also works flawless, with a value of 3 it also worked for me - in Fact for me it seems not to make a difference.
With TimeOut = 0 it doesn’t work properly. I don’t know how long the Reading takes but with 1ms it is ok for my application

Best regards,
Stefan