PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger in pxi 6542

Hi Brandon

 

My code is structured similar to the example vi you have mentioned.

 

I am attaching a document with screen shots, which I hope would help you to have a better understanding.Please let me know if it is still unclear.

 

Thanks again for your time and help.

 

0 Kudos
Message 11 of 12
(959 Views)

Hi testough,

If I'm understanding you correctly, you are serially reading in on one digital data input channel, where each sample (or frame) of SPI data is 32-bits.  You are only interested in the upper 2 bytes of each sample (bits 16-31) and wish to only transfer these upper 2 bytes to computer RAM.  By "block size" I'm assuming you are referring to the number of samples to read from the niHSDIO Fetch Waveform.vi.  Is this correct?

 

If this is right, then you will need to call the niHSDIO Fetch Waveform.vi for each sample of data as the data is non-continuous in the buffer.  Each call of Fetch Waveform.vi should increment the read pointer automatically so that each subsequent call will index the next sample in the buffer.  You can implement this by putting the niHSDIO Fetch Waveform.vi in a for loop where you are acquiring as a single record fetch.  If you are not bandwidth constrained, it may be more efficient to read in all 1024 32-bit samples in one single fetch and then simply discard the lower 2 bytes in each sample.

 

Another possibility would be to externally provide a hardware trigger that is active only when the upper 2 bytes of each sample is transmitting.  This would prevent the extraneous bits from ever being loaded into the buffer.

 

Also for your reference, you may want to take a look at the SPI Digital Waveform Library.  It can be found on this link here.

 

If there's something that I am missing about your application, it would definitely be helpful if we can get a timing diagram that includes the data line(s), clocking and triggering lines all in one.

 

Thanks testough!

 

 

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 12 of 12
(948 Views)