Announcement

Collapse
No announcement yet.

Resetting bool tag each scan

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resetting bool tag each scan

    I have a setup that is using a P-540 PLC that is connected to a Windows based CNC machine tool control. On the windows control there is a .NET app I made that is running a 200ms scan of certain IO in the machine and writing the results out through Modbus TCP to the P-540. I have a tag defined as API-Connected. Ideally what I want is every cycle of the app it will make this tag true, if for some reason the app hangs/shuts down/etc, the value of API-Connected tag should revert back to false. Right now if I shut down the app the values remains. I'm looking for suggestions on how to know that the app is not updating the value of a certain tag every 200ms.

  • #2
    app read> plc value > app write to plc> ack
    plc read>ack and reset: if nak throw comm error

    in other words the app should also write to a location used to verify comms handshaking. the plc resets this handshake bit each time it reads(200ms), so if your app doesnt set it, then you have a problem
    Last edited by quaizywabbit; 08-29-2019, 11:52 AM.

    Comment


    • #3
      Another way would be that since you are writing a tag true every 200ms, you can have the contact that sets the tag on also break power flow to a timer set for 250ms. If the timer is not reset from broken power flow then it will set your "api connected" tag false after an additional 50ms from when the scan was supposed to happen.


      But having something in the program verifying comms is also a necessity and a better way of doing it, and so when that fails you can use that to set api connected to false.

      Comment


      • #4
        Try this. Preset val is the time before an error is generated by not receiving a pulse from the PC. Run Pulse is bit sent from PC. Error is, well, the error bit.

        Click image for larger version

Name:	Capture.JPG
Views:	80
Size:	30.1 KB
ID:	124886

        Comment


        • #5
          Originally posted by bsinkovich View Post
          Try this. Preset val is the time before an error is generated by not receiving a pulse from the PC. Run Pulse is bit sent from PC. Error is, well, the error bit.

          Click image for larger version

Name:	Capture.JPG
Views:	80
Size:	30.1 KB
ID:	124886
          That worked well. I had to put the error timer at 600ms or I was getting false errors, or quick flashes. Thanks for the help.

          Comment

          Working...
          X