Asked — Edited

Auto Shut Down Of Ezb And Computer?

I have been successful with the Help of Alan (@thetechgruru) in having my robot automatically start by applying power to the EZB and starting my computer. This allows the robot to fully activate.

I have built a script that upon verbal command I can get the program and the EZB to shut down.

My next goal is to have this verbal command disconnect the EZB and shut off the computer. I know there is a command to disconnect the EZB which I can add to the verbal shut down script. I can also add a relay which applies and removes the EZB power prior to startup and after shut down.

My question is: Is it possible to shut off the computer from the EZB ?


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#1  

You can use the EXEC script command to send commands to the operating system.


Exec( EXE/Bat File, [parameters] )
Executes a windows application or batch file. The second parameter is a list of optional parameters
Example: Exec(C:\Windows\Notepad.exe)
Example: Exec(C:\Windows\Notepad.exe, C:\MyFile.txt)

Windows has a shutdown command "shutdown". You would want to use it with the /p flag which powers off the computer and forces a shutdown even if an application has an open dialog box (which ARC might. If there have been any changes to the project, it will be asking if you want to save them, and if you force a shutdown, it won't save those changes, so this should be used carefully). (some computers don't fully power off on a shutdown, so using the /s and /f flags to force a shutdown might not actually power it down)

The script would look like:


Exec("C:\Windows\System32\shutdown.exe", "/p")

See https://www.lifewire.com/shutdown-command-2618100 for more options.

Alan

PRO
Synthiam
#2  

Or use EZ-Script command...

Quote:

SleepPC( Suspend|Hibernate, force, wake ) Sends a command to the operating system to sleep or hibernate. If Force is TRUE, the computer is forced to sleep and other applications have no say in the decision. If Wake is TRUE, the computer will wake up on Wake events. Example: SleepPC( Suspend, true, true ) Example: SleepPC( Hibernate, true, true )

#3  

I am away so I will try it when I get back. I assume it goes in the shut down script as the last thing?

PRO
Synthiam
#4  

Unless you can somehow make your bed before getting out of it:).... things in our universe must happen in order. Cause and effect!

Shut down before other commands and you guessed it: The other commands after it won't execute.

#5  

LOL..... My statement was kind of dumb.... I will try to get it loaded when I get back tomorrow.

#6  

Hay Andy, do you also want to shut down the entire game automatically when the computer shuts down? If so consider using a Smart Strip Power Strip. When the Smart Strip senses that you've turned your computer off, it automatically shuts off your anything else plugged into it too.

Amazon Smart Strip

User-inserted image

PRO
Synthiam
#7  

Andy - no dumb comments or questions:) yours was just a little easy to innocently poke fun at!

#8  

Hi Dave. The power strip looks nice. I may use it on another project. Thanks for the info. We kill the main power to the barn at the end of the day so no need for it on this project. I have a switch to apply or remove power to the EZB, so we can shut her off when we don't want to hear her. The cool thing is that now Madame boots up by herself when we turn on the computer on. Once I get the shutdown to work it will be great.

Dj. I'm easy. I even laugh at myself...