02-21-2013 07:13 AM - edited 02-21-2013 07:16 AM
Hi there,
first sorry my English might be bad but its because im not a nativ english speaker.
I've got a Problem with NI-CAN. I write a Programm which has to read and write CAN-messages pretty fast. In a 2ms timedloop (I tried 4ms aswell but I need to run this loop every 2ms) I merge 9 Signals and write them in a single ncWriteNetMult.vi subvi (signal 0-8). In a second loop i read every 10ms 6 CAN-messages (signal 9-14) from the same CAN-Net (CAN0). In a third loop I read and write a CAN-message (signal 15 and still CAN0) evrey 100ms.
Everything works fine but after a short time (a few minutes) I've got an -1074388990 error (Explanation: NI-CAN: (Hex 0xBFF62002) An internal error occures in the NI-CAN driver. A description is located in the file NIcanErr.txt in your ..\NI-CAN\bin folder (typically located at C:\\Progr....)
But the NicanErr.txt shows almost nothing, I tried to rename the error file to force him to create a new one but still there are no information inside.
I have no Idea to solve this Problem because it seems to happen randomly.
I hope someone can help with that
02-21-2013 07:52 AM
Oh i forget a bit,
Im runnin LabVIEW 2010 SP1 on a Win Xp machine
my RT-target runs LabVIEW Real-Time 10.0f2
I use
NI-CAN 2.7.4f0
NI-DAQ 9.6.0f0
on both sides
02-21-2013 08:54 AM
Hi, I've never seen that particular error and there's no (useful) description as you state.
However, you're running quite a fast loop reading the data and a slower loop writing it out - one suggestion might be to try changing the read and write queue lengths using the configure bet block
The standard is 10 (as above), you could try increasing these to see if it helps.
Paul
02-21-2013 09:32 AM
Well my readloop is with 10ms slower than my writingloop (2ms).
As I had trouble with the queues (i read too slow and got an buffer overrun in the write queue) I just had to fasten up the readloop and higher the writequeue and everything runs nice and smothly (to be honest at this point I worked with a just every 4ms write loop). The new driver errors makes me crazy, I have no iedea why they happen -.-
02-21-2013 11:43 AM
02-21-2013 12:03 PM
hmmm this might help, thank you Paul i gonna try it tomorrow and let you know if it works.
02-27-2013 05:00 AM
sorry for the late response, i had to try a couple things.
the driver restart or re-initiate doesn't work but i was able to watch a strange behavior.
The pic "case1" shows, what kind of messages he sends every four milliseconds and in which order. So just for understanding, every two milliseconds he put nine data inputs in one array and send it with the ncWriteNetMult.vi. This is the stable case, the CAN-driver runs without stop working.
The pic "case2" was my idea to reduce the overhead. My Idea was to send just the data inputs I need and not all nine every four milliseconds. But in this case the driver stops to work like every 30 seconds.
So it looks for me like, the driver just crashes because I tried to reduce the overhead ^^
02-27-2013 06:52 AM - edited 02-27-2013 06:52 AM
Damn i thought i solved the problem but still i got these annoying driver crashes. This time i tried (because i didn't changed anything in the code after the last stable try) to reset again the CAN-Cards and it helps for a while (I was able to run a over 20min test). But still after a random time the driver crashes.
PS. I changed the code a bit so I just have one 4 millisecond task to read and write Can-message and a 100 millisecond task to read and write the nmt messages (network management). I thought if I just have one very fast loop it might help to safe some Power or even free me from these driver crashes.
03-01-2013 04:56 AM - edited 03-01-2013 04:58 AM
Hi again,
I did some more research and was able to point out where the error happens.
If I run a 2ms (1st pic) iteration duration I've got an error shown in the pictures (queue overrun 2nd pic),
but the iteration duration shows me he needs 0.5-2.5 milliseconds for one iteration (1.2 milliseconds average 3rd pic).
Now my question, If I let him write 9 CAN-Messages every iteration and i can see the massages on the CAN-NET how is a queue overrun even possible?
does ncWriteNetMult.vi needs so much more time (lets say another millisecond) to write messages to the CAN-NET?
I don't get it
03-01-2013 05:03 AM - edited 03-01-2013 05:32 AM
If I run exactly the same in a 4 millisecond task/loop (1st pic). The program runs stable till the point (today after ca. 6min) the CAN-driver crashes (2nd pic).
I hope there is a CAN or LabVIEW Master out there and knows what I can do to avoid this behavior. 🙂