Abdullah Al Mamun
Abdullah Al Mamun

Reputation: 65

LabVIEW: Save the timestamp of different button press time

I have a VI file in LabVIEW. In the UI I have several button which controls the speed of a fan.

enter image description here

enter image description here

"AUS" turns off the fan whereas STUFE1, STUFE2, STUFE3 are the different speed of a fan. I want to get the timestamp saved in a excel file whenever a user presses each button. The output should be the following:

Timestamps Button
5:24:10 PM 5/6/2022 STUFE3
5:32:46 PM 5/6/2022 STUFE1
6:10:10 PM 5/6/2022 AUS

I have tried to follow this stackoverflow solution but I can follow it in my case. Since I am new to LabVIEW, I am not also familiar with the blocks too.

Upvotes: 0

Views: 427

Answers (1)

Fourier
Fourier

Reputation: 111

I believe you have to build a log file. Excel file is mandatory or you can use a CSV file? Notice that CSV can be open with Excel too.

However, you should:

  • add an event for each button: AUS value change, Stufe1 value change, etc...
  • Every time one of these events occurs, you save the timestamp in your log file.

NOTE: As suggested by Mateusz, you should refactor your code. I suggest you to move the code that is outside of the event structure inside the Timeout event.

Here is my suggestion. Consider that there are other more efficient ways. This is one of the simplest solutions. You can drag and drop the image below in your LV Block diagram in order to view the entire code. enter image description here

Upvotes: 1

Related Questions