LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 questions about my Html report

Dear All,

I've created this Html reporting VI as a template for future work. As you can probably see on the VI i'm saving at a set time so that i can save the report once a day. I'm doing this by comparing the current time to the time input it works but it creates 2 folders one for the right set time and one for the second later somehow i've tried various solutions but i still cannot manage to obtain only one folder. Could someone help with this please?

Another issue is when i'm appending front panel images (in sequence 2). Is there a way to insert a space or tab between them because at the moment they are one after the other? I found the tab for reports but it doesnt work for html only for excel by the look of things.

Thank you in advance,

Frederic. 

Download All
0 Kudos
Message 1 of 4
(2,236 Views)

For your specific questions:

  1. The reason you are getting 2 folders is that you are comparing the time to the resolution of seconds. Your save is occurring so fast that when the loop iterates again less than a second has passed, so the comparison you are performing to test whether to generate the report is still true. Instead of doing all those conversions just compare the current time with the set time to save using a simple Greater or Equal? function.
  2. Normally extra spaces and tabs in HTML are ignored by browsers. If you want to insert a space you have to use a non-breaking space or create a table.

Other comments:

  • Do yourself a favor and get rid of the sequence structure. All those sequence locals just make a mess. Use a state machine or create subVIs that logically break up your report generation.
  • The outermost while loop is not necessary. You can place the update of the current time in the small loop.
  • Do not hard-code paths in your code as you are doing with the directory where the reports will be saved.
  • Is the intention to save the report "on-demand" by allowing the user to change the time when the report will be saved, or where you intending to save this automatically once a day?
Message 2 of 4
(2,230 Views)

Thanks for having a look at the code I did clean up my diagram following your suggested steps. I removed the while loop which was unecessary and then by removing the sequence i ended up with the VI generating one folder only as intended without modifying the rest of the code. That's great. So thank you very much for that.

As for the space between images nbsp works great i tried it before but didn't put enough space so i couldnt see it.

And to answer your question yes the intend is to save daily at a set time hence the folder name, note on the "real" VI the record time will be put as a constant in the code but it's more practical to have it on the diagram for testing reasons. Could you please explain why you wrote "Do not hard-code paths in your code as you are doing with the directory where the reports will be saved." . Does it create a problem? The idea of this is at a later date it'd be easier to look at the reports and see what was going on a day of specific interest.

 

 

Frederic 

 

0 Kudos
Message 3 of 4
(2,221 Views)

@fredericb wrote:

Thanks for having a look at the code I did clean up my diagram following your suggested steps. I removed the while loop which was unecessary and then by removing the sequence i ended up with the VI generating one folder only as intended without modifying the rest of the code. That's great. So thank you very much for that.


That doesn't really solve the fundamental problem. You basically got lucky due to probably a slightly different compilation optimization. On a fast machine you'd probably still have the issue that I identified.

 



@fredericb wrote:

Could you please explain why you wrote "Do not hard-code paths in your code as you are doing with the directory where the reports will be saved." . Does it create a problem? The idea of this is at a later date it'd be easier to look at the reports and see what was going on a day of specific interest.


In your specific case you hard-coded to your user folder. What happens when someone else tries to run it? They won't be able to access that folder, unless they are logged in as you. Put a file path control on the front panel to allow the base directory to be specified. You can set the control to have a default value if you wish.

0 Kudos
Message 4 of 4
(2,217 Views)