Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire with DAQ and write DATA on can bus

I acquire data with a 6040E card and I would to send some of these data on CAN bus (card CAN DS) at 100ms but my industrial PC crash (1.2GHz 512Mo win2000 LV6.1).
The frequency of the acquisition is 1KHz and i aquire 4 data, my while loop run at 4ms, all seem to be normal.
In the same loop i try to send data on CAN bus all the 100ms but after sending 3 or 4 data my computer crash.
In two differents loops it's the same problem.

When I communicate with RS232 instruments during this acquisition i have no problem.

Can I do it? what is the problem? ...
Thank you for your response.

XAVIER
0 Kudos
Message 1 of 3
(4,044 Views)
Hi Xavier,

I have a few questions to get a better idea of your system and application. Let me kno if you have problems with any of these.

What NI-CAN driver version are you using?. How about the version of NI-DAQ?.

What do you mean exactly by crash?. Is it a Windows Blue screen or an application illegal instruction? What is the error message?

On the DAQ part of the application. I assume you have a continuous acquisition of 4 channels with a sampling rate of 1KHz, is that right?.

On the CAN part, Are you using the Channel API or the Frame API (if you are using NI-CAN 2.0)? Are you using an interface object or a CAN object?. If you could give an description of what CAN functions your using, that would be helpful.

DiegoF.
National Instrum
ents.
0 Kudos
Message 2 of 3
(4,044 Views)
I'm using NI CAN 2.0, NI DAQ 6.9.2, and NI VISA 2.6.1.

In fact I would like to acquire data with a 6040E and 6602 counter at the same frequency (250Hz). I have a continuous acquisition of 16 DAQ channels with a sampling rate of 1KHz. I read 4 data in my buffer (1000) but only the first element of the buffer interresting me. The time of my while loop is 250Hz and all this 250Hz I read the value of my counter (simple read). A buffered read with the counter is not good because of the low frequency of my input signal. That increases the time of my acquisition loop.
I use the RTSI bus to synhronise the starting of the counter with the ai scan start of my DAQ card.

All the 100ms (in the same while loop) I write 1 CAN frame (1 2 3 4 5 6 7 8 at this time) w
ith ncwritenet.vi of the frame API.

But after few second (5 to 60) the image of my computer freezes, my mouse doesn't move, I can only shutdown my computer to restart it.

I have find only this solution to synchronize my DAQ and counter acquisition but it takes many CPU time and it would be the reason of the crash.

Thank you for your futur response.

XAVIER
0 Kudos
Message 3 of 3
(4,044 Views)