LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom File Name & Acquire Several Loops of Data

Hello all,

I'm a LabView beginner, just started in a lab at school, and I have several tasks I would like to do on this VI done by other people.
I have added some features on my own, however, there are a couple that I cannot find how to do it.

First one: Custom filename

This VI measures the current output of a Solar Cell, I would like to add a feature to the VI that whoever runs it must type their name and the name of the sample, also range of measurements, date and conditions. How can I do this? Where can I find tutorials that will help me do it?

Second one: Acquire several loops of data.

The Solar Cell is tested from a range of voltage, right now the program runs one loop and spits out the data in two columns. I would like it to make several runs over the same range of voltages over and over again, like 5 times. And to also build a table of data, first column de range of voltages, and second and subsequent columns, the current at that voltage. Is it possible? Where can I find tutorials about this?

I know it's a lot to ask, but I have no idea where to start or even if the VI is designed properly. Any help at all is apppreciated.

PS: Additionally, I was asked to do a stand alone program for this VI. I tried using the project manager, but the Startup VIs wouldn't load? Anything I'm missing?
I was followign this:
http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/preparing_vis_to_build_app_dll/

http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/using_labview_projects/

Thanks,
Isaac

0 Kudos
Message 1 of 5
(3,416 Views)

Here are some suggestions (in a random order):

  • Learn about and use LabVIEW Project.  Use it to organize the VIs you are developing.  You use the Build part of the Project to create the stand-alone Executable that can run your code without needing to directly invoke LabVIEW.  Indeed, you can run the Executable on a PC that does not have LabVIEW installed, but only the LabVIEW Run-Time Engine.
  • Think about what you want in a File Name.  I have a colleague who makes up long, complex file names that incorporate the User's initials, the date and time of acquisition, and three other "facts" -- needless to say, these names are long and unwieldy.
  • You can organize your output files by name and folder (for example, each user could have their files stored in a folder with their name, and the files themselves could be called "BSData.001, BSData.002, BSData.003 ...".
  • A very nice function to create a string based on several different inputs is Format Into String.  You can edit the "Format String" to, for example, specify that a numeric "File number" be represented as a 3-digit numeric string, with leading zeros.
  • Use the Build Path and Strip Path to combine Folder and File information into a complete Path.
  • If you are doing multiple runs and having multiple columns of data per run, that sounds like arrays, possibly 2-D arrays.  Nested For loops can create such arrays for you.
  • To save the data, you have a variety of options.  Two simple ones are Comma-separated Variable (.csv) Files (what LabVIEW calls "Spreadsheet" or "Delimited" files) and Excel (.xlsx) files, created with the Report Generation Toolkit.  Depends, in part, on what else you plan to do with the data.

Bob Schor

0 Kudos
Message 2 of 5
(3,402 Views)

Hello isaacbonyuet,

 

A good start point is looking for examples in the community. You may want to use Express VIs since you are new to LabVIEW.  Here you have two examples of how to use the Prompt User Input Express VI:

 

https://decibel.ni.com/content/docs/DOC-34700

 

https://decibel.ni.com/content/docs/DOC-4173

 

Also for your second question, you maybe could build an array of 5 elements with the range of voltages you want and use it as an input in a For Loop with an auto-indexed input tunnel. That way the For loop will iterate once for each element in the array.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/auto_indexing_1/

 

Message 3 of 5
(3,346 Views)

Thank you!
I was able to build a filename with this example:
https://decibel.ni.com/content/docs/DOC-4173

However, the loop one I do not understand at all. I do not know at which point in my VI I can set it to Loop. It's specially confunsing that the "Write to Spreadsheet" has a 2D data input, but I want to build a spreadsheet with several columns. Do you know of any examples?

0 Kudos
Message 4 of 5
(3,308 Views)

Hey isaacbonyuet,

 

I might misunderstood you a little bit and maybe you were requiring a different functionality.

 

For what I can see in your VI you are writing into the spread sheet file just once at the end of the loop. Maybe you can find what you are looking in this examples:

 

Write Multiple Columns with Write to Spreadsheet File VI

https://decibel.ni.com/content/docs/DOC-36448

 

Write New Data in Columns and Save to Spreadsheet

https://decibel.ni.com/content/docs/DOC-11050

 

0 Kudos
Message 5 of 5
(3,274 Views)