LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

start and stop time

No, you do not convert to string. Why would you want to use a string? Use a numeric for the time entries and wire these to the In Range function. Right click on a numeric control and select Display Options. Change to Relative Time. Get the current time and convert that to a numeric.
0 Kudos
Message 11 of 18
(1,122 Views)

Thanksvery much Dennis

 

Could you pls explain what problems i  may get with the other method, it will be much helpful to improve my knowledge

 

Thanks

 

 

0 Kudos
Message 12 of 18
(1,103 Views)

The problems you have with strings is that they just will not work.

 

What is the numeric value of the string "9:14:05 AM"? That is what you are trying to use. A time value represented as a string has absolutely no relationship to an actual time. It's just a bunch of characters. You might just as well compare that string above to 'I have no idea'. Are you at all familiar with how characters are represented in ASCII? For example, an 'A' is equivalent to a decimal 66 and an 'a' is equal to a decimal 98 so you could co say that 'a' is greater the 'A' and ther are legitimate uses for this type of comparisons but I think you will see nothing but unpredicatable results. Have you actuall run your VI and have you gotten a true result?

0 Kudos
Message 13 of 18
(1,098 Views)

I wanted to add some more information and clicked post too soon.

 

What I don't know is how the In Range function treats a string with multiple characters. If it sums up the decimal equivalents of all the characters, then 00:05:00 could very well be equal to 00:50:00. That is not what you want. Using numeric controls and passing those values to the In Range function has a knows behavior. Besides, converting to strings would just be an extra step that is uncessary, even if it the comparison was robust.

0 Kudos
Message 14 of 18
(1,093 Views)

Veer-

 

Interesting post! Thanks.  You got me to add a function to my time utility library named time to time of day (see attached) We need this function to solve your problem.

 

I've edited your ex_1 (attached) to work with the problem your original post brought up.  Take a careful look at the properties of the start time and stop time controls.  Since what day it is is not important none of that information is shown.

 

How could you edit Ex_1edit.vi to take the weekends off?

Message Edited by Jeff Bohrer on 06-25-2009 01:20 PM

"Should be" isn't "Is" -Jay
Download All
0 Kudos
Message 15 of 18
(1,083 Views)

Hey Jeff-

What if the computer is scheduled for the night shift or through midnight UTC?  Your ex_1edit.vi  will not work in that case.

Here is the fix for that oversight


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 18
(1,070 Views)

800 to 1700.

 

I only tested it for time between 16:40 and 16:45.  Seemed to work for those limits.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 17 of 18
(1,067 Views)

Thanks a lot Dennis and others

 

I got an indea,

 

Thanks

0 Kudos
Message 18 of 18
(1,046 Views)