08-08-2018 05:00 AM
Hi,
I have cRio 9035. And I'm using NI 9862 C module to read CAN messages from car CAN bus. Also, I have other C modules to read/write analog signals. So, I need to have FPGA code for that purpose.
However, NI 9862 module only works in scan mode. As a workaround, I'm using hybrid mode, in which I added the CAN module under "Real-Time Scan Resources" in LabView project (snapshot attached). That worked fine, and I manged to create nxSession (using XNET drivers) from cpp code. However, the CAN module seems to be not responding and I'm unable to see any CAN messages coming thru it.
I tried to deploy cRio into scan mode, and I was able to see CAN messages correctly. But using this mode will block me from accessing other modules thru FPGA code.
Any suggestions?
Thanks
Mohammed
08-09-2018 04:49 PM
Hi,
What do you mean by creating nxSession (using XNET drivers) from cpp code? Are you using the NI-XNET API for LabVIEW Real-Time? I do not see a LabVIEW Real-Time VI added under your cRIO-9035 in the image you attached.
Did you follow the steps described in this Knowledge Base article to configure your cRIO in Hybrid Mode?
Regards,
Gustave
08-12-2018 09:28 AM
Hi,
We have a VI (carControl) under FPGA target that does the interfacing between analog modules and variables used in RT c++ code. There is no logic related to the CAN module in that VI.
The CAN module is initialized and used thru RT c++ code. Here's the code snippet for initializing an XNET session with the CAN module:
#include <nixnet.h>
nxStatus_t l_Status = nxCreateSession(l_pSelectedDatabase, l_pSelectedCluster,
l_pSelectedFrameList, l_pSelectedInterface, nxMode_FrameInStream,
&m_SessionRef);
Am I missing anything in LV part?
Thanks
Mohammed