07-12-2025 01:46 PM
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
07-12-2025 01:48 PM
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?
07-12-2025 03:50 PM
@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!
07-12-2025 11:11 PM
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.
07-14-2025 02:44 AM - edited 07-14-2025 02:48 AM
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:
Btw. when attaching VIs you should rename them instead of pretending "modifications by CA" by still using the "_MODCA" in the filename!
07-14-2025 11:29 AM
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?
07-14-2025 01:13 PM
Personally, I would even use an array of strings instead of scalar string followed by built array. Fewer cats to herd... 😄
08-15-2025 06:42 AM
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.
08-15-2025 06:52 AM
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…