LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help export table excel

Solved!
Go to solution

The states


1 - Idle
2 - Pump On, Generate New File and Record
3 - Pump On and Stop Recording.
4 - Turn Off Pump, Continue Recording.
5 - Turn Off Pump and Stop Recording.

 

Files cannot overwrite each other. When the pump button returns to TRUE, the pump must generate a new file.

It can go


1 to 2
1 to 3
2 to 3
2 to 4
2 to 5
3 to 4
3 to 5
4 to 5

0 Kudos
Message 11 of 19
(357 Views)

Thank's

Vou testar assim que chegar em casa, nesse caso aí eu consigo fazer para as 5 variaveis e consigo também colocar para exportar em uma planilha em excel?
I'll test it as soon as I get home. In that case, can I do it for the 5 variables and can I also export it to an Excel spreadsheet?

0 Kudos
Message 12 of 19
(356 Views)

@Felipe_Alves17 wrote:

The states


1 - Idle
2 - Pump On, Generate New File and Record
3 - Pump On and Stop Recording.
4 - Turn Off Pump, Continue Recording.
5 - Turn Off Pump and Stop Recording.

 

Files cannot overwrite each other. When the pump button returns to TRUE, the pump must generate a new file.

It can go


1 to 2
1 to 3
2 to 3
2 to 4
2 to 5
3 to 4
3 to 5
4 to 5


See, now you just need a simple state machine!

0 Kudos
Message 13 of 19
(345 Views)

My friend, thank you so much. I'll send you the VI. I just added mine and made the connections. I was following ChatGPT, and it was telling me to create a Case Event, which was making things more complicated than helping. But the solution you gave is very simple and straightforward. I'll send you the VI I made based on yours, and it's working perfectly.

0 Kudos
Message 14 of 19
(334 Views)
Solution
Accepted by topic author Felipe_Alves17

Hi Felipe,

 


@Felipe_Alves17 wrote:

I'll send you the VI I made based on yours, and it's working perfectly.


You really should take some beginner lessons to create more "LabVIEW-like" code!

 

See this:

  • Avoid repeating code when you can use an autoindexing FOR loop…
  • I prefer outputs being set instantly (pump/recording ON) instead of waiting for the next iteration…

Btw. when attaching VIs you should rename them instead of pretending "modifications by CA" by still using the "_MODCA" in the filename!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 19
(309 Views)

Thank you very much, I will have to learn a lot of things indeed. I liked the way you used the FOR loop, my concern was whether the columns in the spreadsheet would come out with the names of each variable, since I was inserting the name by double-clicking on each block in signal name.I will test it the way you showed, it makes the code much simpler. Do you have any tips to improve my programming method and to use conditionals in the best way?


 

 

 

0 Kudos
Message 16 of 19
(296 Views)
Solution
Accepted by topic author Felipe_Alves17

Personally, I would even use an array of strings instead of scalar string followed by built array. Fewer cats to herd... 😄

 

altenbach_0-1752516756886.png

 

 

 

0 Kudos
Message 17 of 19
(281 Views)

It turned out really well. Besides reducing visual pollution, it also improves PLC monitoring, as you mentioned. Thank you very much! I'm currently facing an hour meter challenge. Turn on the pump and start counting the pump's operating hours, write the file, and then read the file, as you'll need to turn off the PLC and monitor the engine's operating hours.

0 Kudos
Message 18 of 19
(196 Views)

Hi Felipe,

 


@Felipe_Alves17 wrote:

I'm currently facing an hour meter challenge. Turn on the pump and start counting the pump's operating hours, write the file, and then read the file, as you'll need to turn off the PLC and monitor the engine's operating hours.


You're not the first to ask for such algorithms…

 

  • Store the "hour meter" data in a file.
  • Load the file content on program start.
  • Count up the "hour meter" data as long as the program runs (based on conditions like "pump on").
  • Store the data to file upon program cleanup/exit. (I recommend to store data more often while the program runs to prevent data loss on failure.)
Best regards,
GerdW


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