09-24-2012 05:37 AM
Hello,
I am working on an complex application, that is very hw demanding and I am trying to make the code as smooth as possible. I would like to read CAN data, only when there is data available. From what I read, this is not possible using XNET, only via polling, is this correct (I use XNET 1.4)?
If so, is it better to code the CAN part using the CAN api, I have noticed that there are wait functions available.
The CAN driver should read every frame with HW timestamp to determine skipped frames and further is timestamped with central PC time to connect with remaining gathered data.
Thank you, any response is welcomed.
09-26-2012 10:35 AM
Hi Bublina,
As I understand, you want to read CAN data using minimal resources only. Could you tell me some further details about this application, so that I can see the problem more clearly? What kind system are you using? What is the expected rate of CAN data received?
With XNET, working sessions put received CAN frames into a buffer and you can read multiple timestamped frames at once with one call of XNET Read (Frame CAN).vi so if your data flows in at a fairly reliable rate, I would recommend using such a method. The wait functionality of the CAN API is also available in XNET, with the XNET Wait polymorphic VI. You can find further info about these items at
http://www.ni.com/pdf/manuals/372840b.pdf , Chapter 4 Pages 18 and 434, respectively.
Kind regards:
Andrew Valko
Applications Engineer
National Instruments
09-26-2012 10:43 AM
Thanks for answer,
I handled the problem on my own, it was caused by my not knowing that functions that read the whole frames (frame input queued) do wait for the frames, compared to the frame input single point mode that does not wait for incoming data.
09-27-2012 03:19 AM - edited 09-27-2012 03:19 AM
Dear Bublina,
I'm glad you were able to resolve this issue. If you have any other trouble or question regarding you application, feel free to contact us.
Kind regards:
Andrew Valko
National Instruments