From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-14-2017 09:19 AM - edited 06-14-2017 09:46 AM
Hi,
I'm currently trying to read off of two instruments simultaneously. I've included the VI I've written for this purpose - it has custom VIs for the instrument I'm using (RBD 9103 Picoammeter) but those shouldn't be too important for what I need help with. I have the data collection in a while loop. The data comes out as a double which I collect into a cluster in order to plot in a waveform chart. I then convert the cluster to an array in a small loop, and send the array to the TDMS write. It seems to me that this is what I want; however, I'm not sure if I have it structured properly. Currently it takes a long time for any data to be plotted and this may have to do with the cluster-to-array loop. I put the TDMS close in the last frame of my flat sequence but I'm not sure if that's right. I've tried running this and have consistently gotten "Error 6" but I'm having a hard time discerning exactly what's wrong with my code. Error 6 is typically caused by too much data in one file directory, but this only seems to produce maybe 10 data points when I run it for a couple of minutes. Any help would be appreciated! Thanks.
Solved! Go to Solution.
06-14-2017 09:44 AM
1. The FOR loop is not doing anything. You can actually right-click on it and choose to "Remove FOR Loop".
2. You really should open the TDMS file before your loop and don't close it until after the loop.
3. Are you supplying a valid path?
My suspicion is that #2 will fix your error. The reason being that you create the file on the first iteration and close it. But on the second iteration, you are trying to create a file that already exists, giving you an error.
06-14-2017 10:30 AM
Hey, thanks so much for your response. I tried everything you suggested and it seems to work, but I have somehow created a new problem. When I open the TDMS file it for some reason opens in excel, and only displays the number of data points taken... but no data. I've attached the file and my updated code.
06-14-2017 10:47 AM
@astroLaura wrote:
When I open the TDMS file it for some reason opens in excel, and only displays the number of data points taken... but no data.
Look on the bottom of the Excel window. There is a tab for your group. That is where the data is displayed.
Also, you need to name your second channel for the TDMS Write. You are currently not saving your second channel.
06-14-2017 12:28 PM - edited 06-14-2017 12:46 PM
I've named my second channel, and placed an indicator on the array to make sure it's producing an array of the correct size, which it is. Searched around on the web for a solution but it's still outputting only one channel when it should be recording two. Is there something obvious I'm missing?
Thanks
06-14-2017 02:05 PM
I think it needs to be a 2-D array. So just add a Build Array with only 1 input. You may need to transpose the array (been too long to recall immediately).
06-14-2017 02:12 PM
Omg, duh. I had to go the extra step and make a second build array to make it 2D. I was just being silly. Thanks for all your help!