LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview to excel

I have a program that reads QR codes from an external webcam, i am trying to put the captured QR code data into an excel spreadsheet with my row labels on the left hand side in column A (QR code 1, QR code 2, QR code 3) etc. The problem i have is im not sure how to insert my QR code data into the corresponding rows in column B. 

 

This probably seems like a fairly simple problem to fix but i have only been using labview a few weeks as a student.

 

Any help would be greatly appreciated, thanks.

 

 

0 Kudos
Message 1 of 2
(2,690 Views)

One problem you are having is you are trying to Run when you are just learning to Walk.  You are using the Vision Acquisition Express VI to take an Image and make a (single) QR code, but somehow want to embed this into a routine that opens a Delimited Spreadsheet File (not an Excel file -- Excel files have extensions like .xls and .xlsx and are designed to be accessed by Excel), allows multiple QR codes to be read, writes multiple Spreadsheet lines, then exits when the User says to do so.

 

Can you make your code read a single QR code and write a one-line Spreadsheet file?  That would be a good place to start -- do the Simple Things First!

 

If you want to do multiple QR codes, you need to think about how to decide what to do.  How do you know when to read?  Maybe you have a button that says "Read QR Code".  How do you know when you are done?  Maybe you have a button that says "Stop" (which you have).  How do you know where to save the data?  I'll leave this for you to consider.

 

To do what I think you want to do, you might want to build an Event-Driven State Machine.  Do you know about Events in LabVIEW, built to "do specific code when I push this button"?  Do you know about State Machines (consisting of a While loop surrounding a Case Statement, with the While Loop's Shift Registers holding data used by the State Machine)?

 

To specifically answer your question (how to insert QR Code data into rows in column B), if you have all of the rows for Column A, and all of the rows for Column B, you can create a 2D Array made up of Column A and Column B.  There's a trick -- the "Column A" 1D array and the "Column B" 1D array, to LabVIEW, are just 1D arrays -- there is no "Row" or "Column" yet.  If you use Build Array with "Column A" as the first input and "Column B" as the second, you'll get a 2D array whose first row will be "Column A".  Fortunately, there's a function on the Array Palette that will change this 2D array so that the first column will be "Column A" -- see if you can find it (and try it out to be sure it works!).

 

Bob Schor

0 Kudos
Message 2 of 2
(2,642 Views)