LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate excel report daily using write to spread sheet

Solved!
Go to solution

I am just trying to generate .xls file daily @ 12:00 AM using write to spreadsheet.

I am attaching my code . Please help me to have a solution.

Thank you in advance.

0 Kudos
Message 1 of 16
(4,336 Views)

Hi sridhar,

 

there are two (main) problems with your VI:

1. With WriteToSpreadsheetFile you DON'T create XLS files - you are writing a text file with a common formatting. Please name those files *.txt or *.csv!

2. There is no comparison in your VI! How do you want to determine this "12:00 AM"? I suggest something like

IF 11:59 < Time(current) < 12:01 THEN save(data)

Please try this and ask again for specific problems…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(4,306 Views)
Solution
Accepted by topic author sridhar..reddy

Thank you for your support.

This code is working for me.

is there any other way to simplify it.

 

 

0 Kudos
Message 3 of 16
(4,295 Views)

Hi sridhar,

 

is there any other way to simplify it.

- There is a "=0" comparison available…

- I would put a delay into the upper loop. No need to check the timestamp each microsecond…

- Cleaning up your VI is always a good idea…

(These are just some, but not all improvements I see!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(4,290 Views)

Hi,

 There is a "=0" comparison available-- i had not understood this....

I would put a delay into the upper loop. No need to check the time stamp each microsecond…Thank you, i did it.

- Cleaning up your VI is always a good idea…I did it.

Thanks for your support.

0 Kudos
Message 5 of 16
(4,284 Views)

Hi sridhar,

 

i had not understood this....

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(4,279 Views)

@sridhar..reddy wrote:

 

This code is working for me.

 


How come?! Smiley Indifferent

 

Your VI will keep running forever, with a False wired to the (top) While loop Stop terminal!

 

So, what are you trying to achieve by running the VI infinitely??

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 16
(4,270 Views)

hi,

I am going to use this vi as a sub vi with some conditions.

 

0 Kudos
Message 8 of 16
(4,267 Views)

hi,

I am going to use this vi as a sub vi with some conditions.

My vi should run for 20 days continuously with some conditional operations.

 

 

0 Kudos
Message 9 of 16
(4,266 Views)

No need to use format the Timestamp into String, and then compare it with 12:00:00 AM! Simply compare it with a constant Timestamp, because String operation would be slower than simple TImestamp comparison.

 

Compare Timestamp.png

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 10 of 16
(4,259 Views)