06-24-2009 08:48 AM
06-25-2009 10:49 AM
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
06-25-2009 11:49 AM
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?
06-25-2009 12:07 PM
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.
06-25-2009 01:18 PM - edited 06-25-2009 01:20 PM
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?
06-25-2009 02:58 PM
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
06-25-2009 03:50 PM
800 to 1700.
I only tested it for time between 16:40 and 16:45. Seemed to work for those limits.
06-26-2009 07:54 AM
Thanks a lot Dennis and others
I got an indea,
Thanks