News:

  • March 28, 2024, 04:59:08 AM

Login with username, password and session length

Author Topic: Close devices when they get locked Open  (Read 3562 times)

OrionHE

  • Sr. Member
  • ****
  • Posts: 78
Close devices when they get locked Open
« on: May 12, 2017, 12:18:25 PM »
I had an SMTP_Client device get stuck "Open", despite having a 30 second timeout. It stayed Open through multiple PLC writes, and I believe power cycles. It wasn't until I used DMD to set the mode to Program and back to Run that the device closed.

Now I would like to add a redundant timeout condition that closes the SMTP_Client device in case it gets stuck for no good reason again. Unfortunately, I can't "Close" a device that I didn't "Open". Is there another solution for me?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5975
  • Yes Pinky, Do-more will control the world!
Re: Close devices when they get locked Open
« Reply #1 on: May 12, 2017, 04:27:18 PM »
I had an SMTP_Client device get stuck "Open", despite having a 30 second timeout. It stayed Open through multiple PLC writes, and I believe power cycles. It wasn't until I used DMD to set the mode to Program and back to Run that the device closed.

Now I would like to add a redundant timeout condition that closes the SMTP_Client device in case it gets stuck for no good reason again. Unfortunately, I can't "Close" a device that I didn't "Open". Is there another solution for me?

Device being stuck open is generally a coding error. The code that invokes a device-centric instruction needs to keep running (every scan preferably) until the instruction signals complete. The best way to send an email is to put the email sending code in a program block that runs until the email sending is complete. The very best way is to use stages to sequence the operations.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

OrionHE

  • Sr. Member
  • ****
  • Posts: 78
Re: Close devices when they get locked Open
« Reply #2 on: May 12, 2017, 04:41:55 PM »
The offending Email call was running every scan. This didn't help. The owner was left clueless as to why they weren't receiving their daily logs. The program reported no errors or messages indicating what the problem might have been. We do have scenarios that call for multiple simultaneous emails to be sent, but the documentation in DMD0068 specifically approves this.


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5975
  • Yes Pinky, Do-more will control the world!
Re: Close devices when they get locked Open
« Reply #3 on: May 12, 2017, 04:46:22 PM »
The offending Email call was running every scan. This didn't help. The owner was left clueless as to why they weren't receiving their daily logs. The program reported no errors or messages indicating what the problem might have been. We do have scenarios that call for multiple simultaneous emails to be sent, but the documentation in DMD0068 specifically approves this.

What version firmware?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

OrionHE

  • Sr. Member
  • ****
  • Posts: 78
Re: Close devices when they get locked Open
« Reply #4 on: May 12, 2017, 04:52:16 PM »
Do-more: 1.4.0
OS: 1.4.1
Booter: 3.0.6
FPGA: 3.6
Hardware: 7B

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5975
  • Yes Pinky, Do-more will control the world!
Re: Close devices when they get locked Open
« Reply #5 on: May 12, 2017, 05:05:36 PM »
I know of no email bugs in 1.4.1. Doesn't mean none exist.

There are only two things that will cause a device to hang: 1) Not properly servicing the device, or 2) something's broken. It if is #2, we're going to need to try to recreate the failure. We're going to need lots more information (email service stuff), and it wouldn't hurt to see the program. Might be best to handle this through email.

Would also like to see if the PLC has crashed. $WatchdogReboots contains a count of crash reboots. Might also be good to see if there is anything odd in the system log.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

OrionHE

  • Sr. Member
  • ****
  • Posts: 78
Re: Close devices when they get locked Open
« Reply #6 on: May 15, 2017, 02:47:37 PM »



Here we are again. This unit is running the same exact program as 9 others. It is the only one that I have seen this issue on. The SMTP is configured the same, the program is the same, apart from IP addresses on the CPU and remote racks. The program "Alerts" runs every scan unconditionally. The "Idle Time" reports between 2-3. The manual says this is "OK".

I would accept either a success or an error, this endless open is killing me though.

(struggling to get the imgur link working here)
« Last Edit: May 15, 2017, 02:54:41 PM by OrionHE »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5975
  • Yes Pinky, Do-more will control the world!
Re: Close devices when they get locked Open
« Reply #7 on: May 15, 2017, 03:29:32 PM »
I would accept either a success or an error, this endless open is killing me though.

Set $EnableMsgDump (ST36) and run DMLogger on a PC connected to the PLC's network. This will let us see what's going on in the EMAIL instruction.

Really would be great if you could email us a copy of the program to support@hosteng.com. We keep those in strict confidence and will delete the copy once we've debugged.

If would also be helpful if you could give us some information about your email provider.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

OrionHE

  • Sr. Member
  • ****
  • Posts: 78
Re: Close devices when they get locked Open
« Reply #8 on: May 15, 2017, 04:48:32 PM »
Email sent. I connected via VPN and couldn't see any information sent to the Do-more logger. I have never used it before so I have no way of knowing that I even configured it correctly. I also don't know if VPN is a viable way to read messages from the PLC.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5975
  • Yes Pinky, Do-more will control the world!
Re: Close devices when they get locked Open
« Reply #9 on: May 15, 2017, 05:01:47 PM »
Email sent. I connected via VPN and couldn't see any information sent to the Do-more logger. I have never used it before so I have no way of knowing that I even configured it correctly. I also don't know if VPN is a viable way to read messages from the PLC.

The PLC is sending broadcast packets to port 29298 (0x7272). If your VPN passes those you should see the messages show up in DMLogger. I'm guessing it isn't, at least not by default.

It's probably worth working on to get it working, even it it means getting on site. The single best help we're likely to get is to see the message dump from sending an email. That should help us understand where it's going off the rails.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO