Hello All, I'm running into a synching issue with a Zaber X-BLQ linear stage and an NI myDAQ. The overall project is using a linear stage to pull a strain gauge in a sinusoidal motion and record that strain information using a Wheatstone bridge hooked into the myDAQ to record voltages. The stage has a position sensor that I can record. If I individually record the data of the stage and the voltages, I can output these to two separate spreadsheets and everything is fine (data is taken at regular intervals and no hiccups occur.) If however I pipe both data streams into an array and push that to a spreadsheet, I get not only irregularities in the stage output (varying sample frequency and limited depth of measurement) but also sampling on the myDAQ at a uniform position on the stage and no other position. I have tried timestamp merging, multiple while loop configurations, a fair smattering of forum lookups and am stumped. Thanks for any advice. I have attached both the vi in question and one sample of data taken.
Solved! Go to Solution.
Reviewing your code, I think the issue with the output spreadsheet is that you are exporting it within the while loop. Each iteration of the while loop, you are taking the entire waveform up to that loop as one element of the array and the DAQ reading for only that loop as the other element of the array, and adding that to the spreadsheet.
I would recommend either a) moving the Export Waveform to Spreadsheet file to be after the while loop (and outputting the DAQ values from the while loop using a 'indexing' output to form an array), or b) using Write Delimited Spreadsheet within the while loop instead of Export Waveforms to Spreadhseet, and feed it only the data for that iteration of the while loop (not the array of positions that you input to the Waveform Chart).
Hopefully this helps. Feel free to contact me directly.
Mike, Thank you so much. Both solutions worked and I ended up going with the "write delimited spreadsheet" as it seemed the most elegant.
I would also like to say your company has been absolutely phenomenal in support. Thank you for being a pleasure to work with.