I was looking through the "NI-845x Hardware and Software Manual" to find out if I can program the NI-8451 with SPI streaming functions but it wasn't clearly mentioned in there. Can anyone clarify this? The reason I suspect this is that I have been getting "Error -301713: NI-845x: An input parameter, or combination of parameters, is invalid." even though I have checked over my code several times.
Secondly, if you can't program the ni-8451 with streaming functions, is there a way to implement something similar with SPI scripts?
Thanks ahead of time,
Solved! Go to Solution.
The USB-8451 supports 8 bit transfers. You can write a 16 bit number, but there will be a small delay between the 2 bytes (approximately 10-20 us). This is a small delay and is typically not a limiting factor in your program.
I have attached a few articles I believe will be helpful to you.
Also as far as that error goes, double check all of your data types are correct for what your function is expecting. I would also recommend using highlight execution to pinpoint exactly where the error is being thrown so you know where to troubleshoot.
No, the streaming support is only for the NI USB-8452 product.
Reviewing the manual, I can see how that is not as clear as it could be and we will address that in a subsequent release.
Jordan: Thanks for sending those documents. I'll try it again with your suggestions. I have a 24-bit adc that I'm working with but running the 8-bit transfer 3 times would work out.
GBIP Guru: thanks for clearing that up
I just want to point out the the 10-20us delay between bits is not trivial at a high bitrate. At 12MHz clock speed, 10us is equivalent to 120 bit delay between every pair of 8 bits, making the operation an order of magnitude slower. At a 500kHz clock, you are only 25% slower due to this inter-byte delay, but at the full clock speed of the 8451 card it is non-trivial.
Thanks for pointing that out. As mentioned, the 8451 is not intended for streaming applications, but is not acutely visible from the manual. In the subsequent manual release it should become quite clear and users interested in streaming should pursue that option instead.
Apperently, the answer is NO, that is for the NI-8452 only.
It is now 5 years later.
I just bought the NI-8451-OEM and it is still not in the manual I found : 290598a
Not a word.
This is going to limit my datarate to 15 KSPS at 4MHz & 24bits/sample ?
Formally MDI-AJT here. NI should really put a warning when adding the 8451 to your cart. Years ago a rep told me on the phone an 8451 was really only good for when you were replacing an existing card in a legacy system or duplicating a legacy system. Any new application should just get the 8452. Best of luck.
Here's a deck from a short talk I did at our local NI user group meeting a few years ago:
National Instruments offers two USB devices designed to aid in SPI and I2C communication, the USB-8451 and USB-8452. These devices share the NI-845X driver set. In a ten minute presentation given at a local Chicago LabView usergroup meeting, I presented the capabilities and shortcoming of these devices. The key takeaway is this: do not buy the USB-8451 for any new projects, however the USB-8452 is a fine device if you understand its capabilities. Check out my slides here (pdf).
Thank you Tamalonis. I read your powerpoint.
I could not agree more. I even would like to take this one step further.
- As the NI-8451 does not support streaming it should not be sold at all
- You're better off with the NI-8452. If you need that, just throw away the box.
- The software enforced 64 ‘message’ limit per script is ugly. There should be a warning in the manual
- When this thing runs on windows timing control is very poor. 8 bit groups are just cut in twox4.
- Synchronizing data with a sample clock does not seem to be supported.
- The SPI library consists of three different groups of VI's that do not mix.
- The basic group has a property node that works. The script group likewise has a property node that does nothing.
- Documentation is not clear. It all looks messy and what you get is worse than you feared.
- The delay seems to happen after each group of 8 bits. Not just where you put it in.
- you're better off with a $1000 FPGA card like the sbRIO-9607. It'll work and gain you days.
I'm pretty sure I've bought and used an 8451 for basic SPI stuff years ago. After the program was done and deployed I found the LINX (or rather LIFA at the time) library for Arduino stuff. It has a SPI library and as a test I dropped in an Arduino instead of the 8451 and changed out the calls to the LIFA toolkit and the whole application worked just fine. It was something like a $20 microcontroller replacing a multi-hundred dollar NI device. I get that an Arduino doesn't have the support, warranty or industrial rating of NI's stuff. But my takeaway from that project was that the 8451 was only useful in places that we wanted SPI, and management wanted some branding behind it.