10-19-2012 08:04 PM
Quick Breakdown: from left to right
Section 1: Task Configuration VIs - set up pressure sensor SPI control bits for two sensors. CSI control bits. MISO bits, Shared SCLK line.
Section 2: Master Repetitive Loop - enable CS Lines for both sensors
Section 3: SPI Reader Loop. Task is to read 32 bits, so we must generate 32 cycles of SCLK. Cycle SCLK low. Cycle SCLK high. This cycle should push one bit out of the SPI MISO lines of the sensors, so perform two reads (one for each sensors). Relay the read bits to the parsing structure.
Section 4A (Upper): Disable the CS lines so sensors know to generate the next reading word.
Section 4B (Lower): According to Honeywell documentation, parse 32 bit word into Status (2 bits), Pressure Data (12 bits), Temperature Data (6 bits), and Don't Care bits (5 bits). Perform math to convert Pressure count to actual pressure reading (this varies by sensor, depending upon measurement span). Display all of the above.
Section 5: Write the data and computations to file.
and finally, after leaving the master loop
Section 6: Terminate the VIs.
11-13-2012 01:34 PM
Hey thanks this code has been helpful, but I am a little confused on how you set up your task configuration VI's. Did you create those using MAX?
11-13-2012 02:39 PM
>> I am a little confused on how you set up your task configuration VI's. Did you create those using MAX?
It has been a while since I set that up, so I'm a little fuzzy on exactly how I came to put it togther. However, I'm pretty sure I did not use MAX; I think I just used tiles from the Functions > Measurement I/O > NI-DAQmx > Data Acquisition pane of the tool pallet. If I'm remembering correctly, I spent a lot of time trying to use the wizard to set this process up, but was never able to get it to work properly, so I was forced to do it entirely manually using the tiles as shown.
Doug G.