06-27-2016 04:08 PM
Hello,
I have a pair of SPI devices, and a pair of NI USB8452 DAQS, and a single machine that I'd like to do all my reading from. This seems like it shouldn't be a problem, but the second device is throwing an error when I call ni845xSpiStreamRead (specifically, error 0xFFFB6569, which StatusToString renders as "An unknown error has occurred"). The problem is only happening when I try to do a SPI stream read on the second device - either device by itself works fine.
The flow of the program is as follows:
Step 7 is where the error appears.
What would be most straightforward (but also inconvenient) is if two devices cannot simultaneously stream. Offhand, though, I'm not sure why that would be the case; I understood the computer's role in streaming to be to pass a block of instructions to the DAQ, and the DAQ does all the heavy lifting, while the computer just occasionally requests data. In such a case, the number of devices doesn't seem like it would be important to the computer. Is that not the case? I've looked through the documentation, and not seen an answer one way or the other. (the documentation is clear that streaming mode only allows a DAQ to poll one device, but that's not what I'm asking)
So, here's the two questions:
Solved! Go to Solution.
06-28-2016 07:37 AM
Embarassingly, I'm answering my own question again.
1) Two DAQs can run simultaneously in streaming mode. This may also be true for the n-DAQ case, but I don't know that.
2) 0xFFFB6569 appears to get thrown when you pass an invalid uInt8 pointer to ni845xSpiStreamRead.
Briefly, I was mallocing the size of the readFromDevice array based on the value of "DEVICES", and doing ni845xSpiStreamRead for (int i=0; i<devices; i++). DEVICES was hard-coded (set to 1), devices was written by the ni845xFindDevices (and was two in the two-device case, one in the one-device case).
This is a ridiculous mistake to make, but I'm leaving this here in case somebody else makes the same mistake and looks up that specific error code.