How can a time value from the Data Pad be converted to seconds for use in a LabChart for Windows Macro?

When using a LabChart for Windows Macro command such as 'GetDataPadCurrentValue' to retrieve a time calculation from the Data Pad, it can be converted to seconds by multiplying the retrieved value by 86400 (the number of seconds in a day) in the macro's code. This conversion is required because the Data Pad uses the Microsoft Excel time format, which lists the time as the number of days.  Some sample macro code showing how to perform this conversion is shown below:

Dim Timevalue1

Dim Timevalue1inseconds

Timevalue1 = Doc.GetDataPadCurrentValue(1)

Timevalue1inseconds = Timevalue1 * 86400

The variable 'Timevalue1inseconds' now contains the time calculation value listed in Row 1, Column 1 of the Data Pad as a text string of the number of seconds.  The variable can now be used in other LabChart Macro commands that require time as a text string of the number of seconds to function.


To learn more about Macros and their uses in LabChart, please review this instructional video.