08-27-2017 09:57 AM
I am currently learning about Labview and DAQ systems..
I have a set of 15 force sensors which are split as 1 primary and 14 secondary sensors. All the sensors' data are received continuously through Arduino Mega to the Labview front panel's Voltmeters, Table Control and write to a CSV Spreadsheet successfully. As of now, I can save the array data continuously in table and excel (.csv)
However, my intention is to save only the immediate first single data from all sensors every time the 1st sensor crosses some threshold, show in table and save to excel.
Most discussions in saving excel are based on time limits and number of times to save... I need to save custom data when triggered from one sensor as mentioned above.
Anyone from this forum help me get the right idea...
08-27-2017 12:16 PM
Right-idea #1 -- make a distinction between Excel, a component of Microsoft Office that has a proprietary format, .xls and .xlsx, which requires LabVIEW's Report Generation Toolkit to use, but gives you access to the power of Excel and its tools, and a Comma-Separated-Values (.csv) file, a Text file that has "rows and columns", with the rows separated by OS-dependent "New Line" character(s) and columns separated by commas (or, as in the LabVIEW Default format, Horizontal Tabs).
If you have a 2D array of numbers or strings, LabVIEW's Write Delimited Spreadsheet can create a file with the .csv extension (but if you want comma separators, you need to specify that as an optional input to the Write function). If you drop this function on a Block Diagram, you can right-click it, choose Help, and get information (and examples) suggesting how to use it for "Write All At One" and "Write and Append" modes of action.
Right Idea #2 -- play "scientist". Write yourself a tiny routine where you "make up data" (say, a 4x10 array of random numbers) and try writing them using (say) Write Delimited Spreadsheet. Note that Microsoft thinks Excel "owns" this format, so by default will give these files an "Excel" icon, so if you double-click the file, it will open in Excel. OK, at least you can see the contents -- does it look like 4 rows of 10 columns? Maybe you are doing something right! If you need to do multiple writes, expand your first "experiment" to add another 3 rows and see if this works.
Right Idea #3 -- try do do as much (initial) work as you can. When/if you get stuck, return here, attach your LabVIEW code (meaning the files ending in .VI, or if you are using LabVIEW Project, compress the Project folder and attach the resulting .zip file). Please do not send screen-shots -- we have a very hard time "editing" your code, and an even harder time trying to execute it.
Good luck.
Bob Schor