Example Code

Boolean True Only During Specified Time Each Day

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example is a subVI that can will give a boolean true during a user-specified time range each day. 

 

Description

This code could be used in a variety of applications that run for extended periods. This example was originally created for a NI Discussion Forum Thread. The Format Date/Time String function is set to work on a 24 hour clock, but can be changed to a 12 hour clock by using the format string "%I:%M:%S".

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code 

1. Download the attached VI

2. Drop it into LabVIEW and create control architecture to set the time limits

3. Use the boolean output to control logic-based architecture such as Case Structures

 

Additional Information or References

 Front Panel

True At Specified Time.png

VI Snippet

123.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Example_Scrubber_Guangyu
Member
Member
on

User tried to use timestamps for the In Range and Coerce but couldn’t find a way to ignore the date included in the timestamp.