Shut down Windows HMI PC on contact closure ?

Ken Roach

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Seattle, WA
Posts
17,482
This is slightly off-topic, but I figured I'd ask the community.

I have an application where we're running a panel PC with Windows 7 Professional and Indusoft Web Studio as our HMI, powered by 24V DC from an ordinary PULS power supply with a battery backup/buffer unit.

The battery backup unit (a PULS UBC10.241) has only dry relay contacts for Ready, Buffering, and Replace Battery indications. It has no USB or serial interface.

Does anyone know a simple method for a Windows computer to perform an orderly shutdown based on a contact closure ? The PC does have RS-232, RS-485, and USB ports.

I have done a little Google searching, and learned about how old AS/400 servers used to interface their serial ports to relay contacts in a standard way, but haven't found anything that seems to fit the bill.

My fallback method is going to be to wire the UPS inputs to the PLC, and use an HMI tag trigger to have Indusoft run a batch file with the Windows "shutdown -s" command and then use the IWS $Shutdown command to stop the runtime before that happens.

But I'd prefer to find something that connects serially or over USB that will shut down the computer when a contact closure occurs.
 
Long shot....

Power the USB with the contacts on the battery, not dry (5vdc)... so on contact closure you would power up the USB port and the PC would detect the USB device

Create a task in your task scheduler to trigger on the USB device detection and run a shutdown

The trick is tying them together, you can run a auto run once the device is plugged into the USB port but you need to only run when that device is plugged in or anything USB will run the shutdown, you can also put a 60 sec delay on the task so you could stop it

Here is some help on the auto run USB https://superuser.com/questions/219401/starting-scheduled-task-by-detecting-connection-of-usb-device
 
The OS would be 64 bit Windows Professional (though we're considering a smaller Windows Embedded 7 box).

The USB auto-detect method sounds like a fun hack, but this is a commercial system that will be unattended 99% of the time. The odds of sabotage and vandalism are actually pretty high on this system so I am disabling as many external access and peripheral features as I can.

I just tested the IWS shutdown script and it was pretty straightforward, so that may be what I stick with if I can't find a service+hardware device.
 
You could use the CTS input of the RS232 port. Read the port status and react to a change.
You can use the rts/cts/dtr/rtr signals a digital inputs and outputs for windows.

But if you already have an plc, i think it's the better and safer option to go over that path.
 
Last edited:
Ken,

I assume you know this, but a Rockwell panel PC with a Rockwell UPS can use APC Powerchute to manage orderly shutdowns in case of a power loss. Can you use something similar?
 
How you power on the PanelPC? It goes on when 24V is present?
So, how will you restart it after windows shutdown?

If yes, I would use a python script and a modbus communication to shutdown (so it's fast and easy, TCP or RTU as you prefer). Then the power on should be easy with a contact.

If the PanelPC is ATX conform (check BIOS) and there's a push button to power on the PC, just use a contact to send a pulse < 5sec. It will start the windows shutdown sequence.
 
Last edited:
Does the PC have a power button that you can access the pins on? If so, You could wire the UPS to the PLC, and have the PLC close a relay contact to act like the power button being momentarily pressed. Configure the pc to perform a shutdown on this action?
 
Thanks for all the input !

I want an orderly shutdown because as good as Windows is these days at handling power crashes, it's not perfect. There is no room in the system for a conventional UPS with PowerChute or similar features, or I would definitely use those.

These PCs generally boot when 24V power is applied, according to the setting in the BIOS.

I didn't realize the ATX power standard would do a Windows shutdown on a pulse of the power button. I will figure out if that feature is present and if it can be reliably wired into the computer. I know there are no field wiring terminals to connect such a feature.
 
Thanks for all the input !

I want an orderly shutdown because as good as Windows is these days at handling power crashes, it's not perfect. There is no room in the system for a conventional UPS with PowerChute or similar features, or I would definitely use those.

These PCs generally boot when 24V power is applied, according to the setting in the BIOS.

I didn't realize the ATX power standard would do a Windows shutdown on a pulse of the power button. I will figure out if that feature is present and if it can be reliably wired into the computer. I know there are no field wiring terminals to connect such a feature.

Ken - You would configure this action in Windows. Under power settings, choose what happens when i press the power button.
 
@Dravik: sometimes on PanelPCs there's no powerbutton or power contact.
It depends on the manufacturer
 
@yell, for win 32 there is a more accessible win API and proven solutions for the serial port (google tells me). After the parallel port disappeared and moving to higher complexity/speed, the access to low level devices is sacrified.

I too was in the same situation and did the script shutdown but opted to retrofit with communication UPS. Althought cheap and easy to do the HW solution with for instance out of the box arduino and a small .net program - I want someone other than myself to support and guarantee these solutions.
 
Last edited:

Similar Topics

I have a panelview plus 7,and often popup a messagebox"application servicesd.exe encountered a serious error and must shut down"I refreshed the...
Replies
0
Views
1,074
Hi, I need to upgrade the ups on the FactoryTalk Scada Servers. I have a primary server, secondary server and Historian server. 1) Is there a...
Replies
4
Views
2,578
Hi, I just experienced something strange. I connected a Field PG (PG/PC adress 0) on a profibus network to monitor something in the field. I...
Replies
16
Views
6,859
So I am wondering how many other troubleshooters force things on or write around things temporarily to get a machine running, then come back and...
Replies
36
Views
12,879
There is a plant shutdown for around 5 months. We are planning to preserve the control system for maintenance reasons. Any standards for...
Replies
4
Views
1,650
Back
Top Bottom