LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time command Labview Elevator

Solved!
Go to solution

Hi
I need a help. I've build an elevator in LabVIEW. Generally speaking it's working as it should but... I would like to add some additional feature like "Between 7.00 AM to 9.00 AM, elevator reach pointed level (for example 3) and going back to 0". Elevator is moving properly, but I have an issue with seeting the timing. I've made something like this: 

Somarita_0-1704745070193.png

 

 ...and it's not working properly, the second condition (less or equal to 9). I have timestamp on front panel, on block diagram it is reading. Does anyone can help on it? 
PS. It's simulation I do not have any device connected and I will not have. 

0 Kudos
Message 1 of 15
(882 Views)
Solution
Accepted by topic author Somarita

Time stamps are absolute; they represent a specific time and date.  You need to extract the time of day from the timestamp.

TR.png

0 Kudos
Message 2 of 15
(860 Views)

Thank you so much! It's working 🙂 

0 Kudos
Message 3 of 15
(843 Views)

I would have one more question.. is it possible to make something like voice command on it? Like you know I'm saying "floor one" and the elavtor goes there? Or it is not possible withouth external device? 
Ps. I'm not new in the LabVIEW, but I think I do not have full knowledge about that software. 😞 

0 Kudos
Message 4 of 15
(837 Views)

LabVIEW has no built-in voice recognition functions.

0 Kudos
Message 5 of 15
(834 Views)

Ehh what I shame. I thought about making something like speech to string -> command running, but I'm not sure 

0 Kudos
Message 6 of 15
(831 Views)

@Somarita wrote:

 

Somarita_0-1704745070193.png

 

 


Just looking at your code fragment, We can assume that the rest of the program is highly flawed in logic.

Yes, the absolute timestamp us not useful for this purpose, but... Why would you need to read the time twice in parallel via local variables? Where is the time indicator and when was the last time it got updated? (depending on your code architecture, maybe never?)...

 

It feels like you could benefit greatly from some help, so feel free to attach your VI so we can give suggestions for improvements.

 

You really don't need to deal with minutes, seconds and fractional second. If you set the range correctly, the hours alone would be sufficient.

0 Kudos
Message 7 of 15
(752 Views)

@Somarita wrote:

Ehh what I shame. I thought about making something like speech to string -> command running, but I'm not sure 


Not built-in, but Windows does have built-in speech recognition, which you should be able to call using .NET.

 

See here for an example in LV:

https://forums.ni.com/t5/LabVIEW-APIs-Blog/LabVIEW-Speak-Programming-LV-through-voice-commands/ba-p/...


___________________
Try to take over the world!
0 Kudos
Message 8 of 15
(727 Views)

I assume you want to test the actual current time, so all you need is the following:

 

altenbach_0-1704821476693.png

 

  • Seconds to date/time defaults to the current time, no need to wire a timestamp.
  • The range check excludes the upper limit (as configured), so it will show "in range" until 1ms before 9 and turn false at nine.
  • etc.

 

 

0 Kudos
Message 9 of 15
(679 Views)

Hi, thank you for the solution 🙂 I may use it while "cleaning" the application. 

I have few conditions in this program. 🙂 
Here is the list of my conditions: 
1. When it's between 7am and 9am eleavtor after reaching each floor (1,2,3) is going back to level 0. 
2. When it's between 3pm and 4pm elevator after reaching each floor (0,2,3) is going back to level 1. 
3. When it's between 4pm and 5pm elevator after reaching each floor (0,1,3) is going back to level 2.

4. When it's between 5pm and 6pm elevator after reaching each floor (0,1,2) is going back to level 3. 
I've made event structure (with proper button "value change" - if I can name it like that 😜 ), then I put the time condition in case structure. The program is little complicated because of it, but since it's working - I accept it haha 🙂  
The VI is working fine for me. I'm considering about those speach command, but I'm not sure if I have enough time to program it (deadline for my project is really close). For now I would not like to share it on the internet - it can be found out by my professor as a plagiat. 

0 Kudos
Message 10 of 15
(669 Views)