Hi Labview users. Do you know if there is a limit on the number of CAN frames that can be received by the NI CAN USB 8473 Interface? I seem to be getting maxed out with 18834 data frames. The way I implemented CAN 8473 is as follows:
- Connected 8 nodes to the CAN bus from 8 discrete microcontrollers with embedded CAN.
- Each microcontroller transmits 32Kbytes of data through the embedded CAN and baud rate set at 1M.
- Frame data size is 8bytes and using extended (29bit) arbitration ID.
- The CAN bus is relatively short, less than 3 feet in length.
Error code returns 0xBFF62125 from NI-CAN ReadMult Network if 32Kb data is transmitted from each of the node. If I limit the data transmitted by each microcontroller to 16Kbytes, then CAN 8473 is able to receive all the data. One solution i can think of is to transmit the data in smaller chunks but that entails a lot of overhead. I really wanted to perform data transmission one shot if i can. Appreciate any comments or suggestions.
Have you considered calling ncReadMult more frequently? I haven't seen a maximum buffer size documented anywhere - it may be operating system or configuration dependent since it's in the host's RAM - but that module is expected to be able to handle a fully-loaded CAN bus at 1mbit without losing any frames, so probably you just need to read in smaller chunks rather than breaking up the data writes.
Yes i tried that too, but the total number of frames that is received by USB CAN 8473 is still less than the 32K frames that i was expecting. The last ncReadMult call still returns an error. Moreover, a call to ncGetAttr polling for ReadEntriesPending returns just 18K frames.
But why are you trying to read all message at once?
Are you really waiting for the buffer to fill up until you read from the buffer?
What is the setting you have for the ncOpen?
All 8 microcontrollers are periodically transmitting 32Kb of acquisition data to the CAN bus that needs to be processed through FFT, hence they have to be read at once to maximize throughput. Sampling for less than 32K will slightly degrade SNR so reducing sample size is my last option.
I've set the Read Queue buffer for ncOpen to 34000, even up to 68000 but even this did not help.
You are somehow mixing things together, sampling of a signal and a digital communication has nothing to do with eachother.
You need to read the CAN messages more offen!
Now on your PC side, you need to make a buffer that can hold the messages that forms your complete 32Kb of data from each microcontroller.
Once you have a complete data set, you can do what ever you want with your data.
Yup, perform the read periodically which sends data from the hardware buffer to your PC. Your PC has tons more memory space to hold data, and can even log it to disk if you can't hold it all in memory at once. I tend to read CAN data very often, ideally I'd say you shouldn't read more than a few hundred frames at once. Sending that much data from the hardware buffer to the PC may take some time, and in that time frames are going to come in.