01-10-2014 11:24 AM
I'm confused by this parameter, which while part of the CAN data cluster fed to the CAN WRITE vi, and read from the CAN READ vi, can't even be found by searching for "DataLen" in the NI Embedded CAN for sbRIO Help file (for LabVIEW 2012).
I can see potential use for it: Have the Payload array always contain 8 elements (CAN maximum), and have the DataLen return the true length of the payload, among others. But I hate to speculate on it's use. In my current project, I built a 1M element array of CAN packets to use as a FIFO, each cluster element having 8 elements in the Payload array, to facilitate using the In Place Element structure to place new clusters into the buffer array. It would be nice to assume the DataLen will be the true length of the data, so I don't have to execute an "Array Size" command to determine this from the CAN READ vi, and don't have to substitute the CAN payload into an 8-element array before placing the element into my buffer. Again though, I hate to speculate.
Please point me to any documentation on this or if the answer is simple and brief, please reply here!
01-13-2014 09:03 AM - edited 01-13-2014 09:05 AM
Good day Erik,
I was checking the VI and I did not see the parameter that you are indicating (see picture attach). Can you please elaborate a little more where you are seeing it?
Also, assuming a few things (hardware/software wise)…here is an article (Document ID: 5TML9LVO) that talks about the interface that is used for sbRIOs. From the name of that parameter, I can only say it might refer to data length which you will find a description on this manual.
01-13-2014 09:12 AM - edited 01-13-2014 09:24 AM
Here's what I have. It looks identical to yours except for the added "DataLen" U8 control.
So you're saying the "DataLen" is the Data Length parameter sent with a CAN Remote packet, to specify the number of bytes the receiving device is to return to the sender. That's a bit disappointing - I was hoping it was the size of the Payload array, negating the need to use the "Array Size" command in my code.
I'm assuming you're using a newer version of the CAN LLB, where this has this removed. Fortunately we're not using CAN Remote packets, so it's a moot issue for me. Looking back at the Help system, it mentions the payload length of the CAN Remote frame is now to be used to specify the return byte count requested, negating the need for "DataLen". Should I end up having to add CAN Remote support while still using this version of LabVIEW (hopefully we're going to 2013 soon), I'll play it safe and set the Payload array size and set the DataLen parameter to the byte count requested.