LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange Behavior of Data and Other Refinements

Solved!
Go to solution

Some more comments:

 

  • You are using the while loop as a glorified FOR loop. Since you can calculate the number of iterations before the loop starts, a FOR loop would be correct for the upper part. You can show the conditional terminal to exit early when an error occurs. (wire the error directly to the conditional terminal, no need to unbundle)
  • Since you keep the file open in the consumer loop, there is no need to set the file position. It wll write where it left off automatically. If you want to append to an existing file when the program starts, you can set the file position to the end before the loop, right after opening the file.
  • It is typically pretty pointless to do the EOL conversion when writing.
Message 11 of 16
(1,146 Views)

2_8_16.png

One final thing: the data must be in four colums: one for each analog input's voltage data, and another for the sample at which the 3 samples were taken. How can this be achieved?

0 Kudos
Message 12 of 16
(1,087 Views)

And thank you both! I've implemented most of your changes, I just need to verify that the data is formatted correctly and that the data is obtained continuously. I am going to use it to make a transfer function for the device I am characterizing.

0 Kudos
Message 13 of 16
(1,084 Views)

A small update. I may close this post, but I have a few comments and perhaps someone can come up with a quick solution.

 

The output data are arranged such that the number of iterations of the for loop multiplied by the number of channels corresponds to the rows (so that every third row corresponds to a single channel). The columns in the data correspond to the number of samples taken in every iteration of the four loop. I've written some code in MATLAB that takes the data and reorganizes it into four columns, but believe it would be more efficient to do this operation in LabVIEW. I've attached images of the basic format and of the format I'd like.

 

vi_outputformat.PNG

 

Does anyone have any advice?

0 Kudos
Message 14 of 16
(1,040 Views)

Hi xcnmoore,

 

There are a few different methods you can use to output to Excel with LabVIEW,  but to be able to output with your own custom formatting, the easiest would be either to use the Report Generation Toolkit if you have it, or to export your data using ActiveX.  You can either find a tutorial on using the Report Generation Toolkit with excel here, or I would recommend looking through the LabVIEW shipping examples (particularly Excel - Write Table.vi) for a look at using ActiveX to set your formatting.

Message 15 of 16
(990 Views)

Thanks for the advice. I think that my boss would rather I just use the MATLAB code for the time being, but I'll come back to this, given more time.

 

Thanks everyone for the help, I think I'll select an answer and close the topic.

0 Kudos
Message 16 of 16
(965 Views)