LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monthly Attendance vi using LED and record button for 10 employees and saving to excel sheet

Solved!
Go to solution

Here i attached what is tried.  It can save excel file but how to append attendance without altering rows (days of month)  and column headers (emp names), regards

Notes_250306_154120.jpg

Download All
0 Kudos
Message 11 of 19
(231 Views)

Hi touqeer,

 


onlinetouqeer@gmail.com wrote:

Here i attached what is tried.  It can save excel file but how to append attendance without altering rows (days of month)  and column headers (emp names), regards


You were asked for code and all we got are 2 images!

Did you know we cannot edit/debug/run images in LabVIEW?

 

From your image:

  • Learn LabVIEW basics, like autoindexing loops...
  • You should NOT name a CSV formatted file "xls". Use the filesuffix ".csv" for "comma separated value" text files...
  • What about using AutoCleanup to improve your block diagram?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 19
(226 Views)
Solution
Accepted by topic author onlinetouqeer@gmail.com

onlinetouqeer@gmail.com wrote:

Here i attached what is tried.  It can save excel file but how to append attendance without altering rows (days of month)  and column headers (emp names), regards


here is what I had in mind, when suggesting "write to csv":

 

   
alexderjuengere_0-1741268232983.png

 

alexderjuengere_1-1741268254850.png

 

   

 

logging.gif

Message 13 of 19
(212 Views)

To be able to control what is editable, I suggested an alternative way of saving and only a daily update of that file. Anyway only edit for the actual day but allow intermediate saves.

 

greetings from the Netherlands
Message 14 of 19
(198 Views)

Ok thanks,  

1 - If the record button is pressed on the same day more than once it need to be overwrite existing attendance colmn.

, otherwise update next colmn on next day

2- plz reshare block diagram as it's left half is cropped 

Regards

0 Kudos
Message 15 of 19
(195 Views)

I did this on purpose, because I consider my approach as "not good" and I don't want to encourage using it in a real application.

Í am using local variables, a sequence structure and two while loops - and I avoid the necessary event structure by using the old "wait for frontpanel activity" function....

 

 

 

 

 

 

 

Message 16 of 19
(143 Views)

Hi, Alex,

its ok for me just to compare with my code i will modify it and will be responsible, therefore plz send me remaining section ,  

thanks

0 Kudos
Message 17 of 19
(135 Views)

Hi, 
I am working on a LabVIEW project where I need to log data into an Excel sheet. My requirement is:

  1. On the first run, write headers (column names) to the Excel sheet.
  2. On subsequent runs, append data to specific columns without modifying the headers.

What is the best approach to achieve this in LabVIEW? Should I use the Report Generation Toolkit, ActiveX, or CSV file handling? Any example VIs or guidance would be greatly appreciated.

0 Kudos
Message 18 of 19
(102 Views)

Hi touqeer,

 


onlinetouqeer@gmail.com wrote:

Hi, 
I am working on a LabVIEW project where I need to log data into an Excel sheet. My requirement is:

  1. On the first run, write headers (column names) to the Excel sheet.
  2. On subsequent runs, append data to specific columns without modifying the headers.

What is the best approach to achieve this in LabVIEW? Should I use the Report Generation Toolkit, ActiveX, or CSV file handling? Any example VIs or guidance would be greatly appreciated.


You write about "Excel sheet", RGT, ActiveX and "CSV file" in a wild mix…

  • Real Excel files (XLS, XSLX) require RGT or ActiveX (which is used by RGT under the hood).
  • Simple CSV files (which can be handled by Excel) only require simple (text) file functions.

I recommend to start with CSV files…

 

On your questions:

  1. When the file doesn't exist you create the file and write the header rows.
  2. When the file already exists then you already wrote the headers. Read the whole file as a 2D array, manipulate the array as needed and write the changed array back to the file…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 19 of 19
(94 Views)