Hi Cameron,
I believe the current usage of np.uint32 and np.uint8 is correct for the NI PCIe 6363 in the original configuration.
The code using np.uint32 relates to the storage of the state of all 32 channels in the HDF5 file. Here one channel corresponds to one binary bit. However, as you say, the NI function requires each uint32 number to be converted to an array of 32x uint8 numbers (one for each channel). The places where you see uint8 are where the data is in the correct format for the NI function, and the uint32 is where it is in the format for storage in the HDF5 file. The reason for the different formats is simply to reduce the HDF5 file space (1x 32 bit number is significantly smaller than 32x 8 bit numbers!).
In your case, because you were only trying to get the first 8 channels to work, you are correct in changing the uint32 to uint8 so that the conversion to the format for the NI function doesn't include data for 24 channels that don't exist! (this is likely why it didn't work correctly for you at first). I believe that the code for the NI PCI-6733 uses uint8 everywhere because it only has 8 buffered output channels.
I notice in your follow up email, that you indicate you have all 4 ports working. Have you tested simultaneous output of all 32 digital lines? In changing it to use uint8 everywhere, I believe you will only be storing the first 8 channels...Oh I think I see the issue. Line 37 of myNIBoard.py is outputarray[line] = output.raw_output. This ignores the port. As such, you are overwriting the first 8 channels with the second 8, and then the second 8 with the third 8, etc. I think you will find that the output of each port is identical, regardless of how you command them. To fix this I think you need to change back to using uint32 is the appropriate places (but not everywhere, see above) and then change that line to read outputarray[port*8+line] = output.raw_output.
There may be additional changes required as well, but I think that is the main one. A good way to check is to convert the integers stored in the HDF5 file into a binary string and see if the output state of each bit matches what you expect.
Let us know how you go!
Cheers,
Phil
P.S. We'd be keen to make NIBoard.py compatible with your myNIBoard.py file, and then have your NI_PXI_6535.py file subclass NIBoard like the other NI cards do. But it is probably best to wait to do this until you have confirmed all of your ports are working correctly.