LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with NcReadMult and 300 packet acquisition

I have a can device under test that send 3 different packets out every 7ms.  I'd like to grab 300 frames of each packet using ncReadMult.  What's the best way to set up the read queues for this. How should the read queue be set for the Network Interface Object?   I am using a CAN object for each packet. 
I seem to run into trouble if I set the read queues to 300 on any of them.
0 Kudos
Message 1 of 7
(3,681 Views)
Could you post an example section of your code. It would be helpful to see how you're making the call to the ncReadMult. Also, what error are you getting when you try to read the 300 bytes?

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 2 of 7
(3,668 Views)

What I'm trying to figure out is how large to set the Read Queues in the CAN Objects to do this.  I've tried setting them to 300, but I get a "-3" error that is undefined when configuring the Can Objects.

I understand how to do the ReadMult, however, the buffering is what has me stumped.  I want to ensure that I do not drop packets.

 

 

0 Kudos
Message 3 of 7
(3,667 Views)
It looks as though you may be running into Queue length issues.

Knowledge Base regarding Queue length in NI-CAN

See if that helps explain this at all. Basically, you may need to bring in those 300 farmes in 2 different pieces.

Hope this helps,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 4 of 7
(3,644 Views)

Thanks.  That info is very helpful.

It appears that the CAN board itself would not have enough memory to hold all the messages I want to capture.

Does the driver transfer the packets from the CAN card to the PC RAM in the background so that nothing is lost?  In other words, if I want to do a ReadMult of 300 packets, would the driver handle getting the data off the card so that the 300 packets of data would be stored in PC-RAM? 

0 Kudos
Message 5 of 7
(3,636 Views)
That's correct. You dont' have to have all of that data on the board at one time. It will be streamed to the memory by the driver. This takes place behind the scenes when you use the NCReadMult.

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 6 of 7
(3,621 Views)

That being the case, is there a memory limit on how many packets are held locally in the PC? 

I will try a readmult on my project with the recommended queue sizes and see if it work.  If not, I'll attach the code I used to set up the Can object and network interface object.

 

Thanks.

0 Kudos
Message 7 of 7
(3,613 Views)