Jump to content

Joe Tauser

MVP 2023
  • Posts

    2,858
  • Joined

  • Last visited

  • Days Won

    308

Posts posted by Joe Tauser

  1. I sent a PM to brooksg44 asking further details and learned this question is based on a whitepaper describing converting Petri net to of three of the Five 61131-3 languages. 

    https://abcm.org.br/symposium-series/SSM_Vol5/Section_IV_Industrial_Informatics_Discrete_and_Hybrid_Systems/24333.pdf

    For summary and illustration purposes, I took screenshots of relevant sections.

    Here's the example process and description (page 6:

    image.png.6e3818b232a2f95e997bdcce618aed7d.png

    The I/O consists of three lamps, a button, three valves, three level switches, a motor, and a heater.

    Nothing is really mentioned about the heater and temperature control loop.  This is an academic exercise,  so I'm going to assume that the heater is a frictionless device with the power of the sun that instantly brings the process to whatever setpoint temperature is specified. 😁

     The file brooksg44 posted is a Grafcet diagram, which is a fine way to represent to the process.  I brought his diagram into Visio and added some annotations to help with the State Machine program:

    image.png.8661c2183e74b7ecb76b5777c28b95d6.png

     

    On 12/25/2023 at 8:45 PM, Joe Tauser said:

    I would use more than one pointer,

    I only needed one pointer.

    By putting the Outputs in their own subroutine, they are easily referenced from the state sequence logic.  I did this example program in Visilogic 9.8.65, because that's still my favorite version and anyone should be able to open it.  I also used a 7" Samba because those seem to be very popular these days.

    I didn't spend much time on the graphics.  If someone wants to make it pretty and upload a fancy version knock yourself out.

    Joe T.

     

     

    P. S.  - Take a look at the LD program in that paper.  Yow!  

     

    Tank Fill State Machine JT.vlp

  2. I would use more than one pointer, with state 2 in one path and 3 and 4 in another.  You can kill the path by setting the pointer to zero when it's no longer needed.

    I always have a separate subroutine called "Outputs" where all my coils go and they are turned on and off by the values in the pointers.  There's no rule that you can't have more than one compare block controlling a coil.

    What are your exit transitions for states 3, 4, 5, and 6?

    Joe T.

     

  3. Hi Luis - 

    Thank you for attaching your program.  I opened this using Visilogic 9.8.94.

    For starters, your PLC ID and your Slave ID are the same.  That's generally a no-no.

    The PLC is the Master.  You have a SCAN_EX block tied to Socket 2, which by default will also be port 502.  This makes the PLC into a Slave as well as a Master.  That's OK, but if you want both you need a second MODBUS IP CONFIG block using a different socket and a different port.  Will this unit be a Slave to a SCADA system or something like that?

    If Socket 3 disconnects you can just re-trigger the Connect block.  You can also put a value into SI 110 for Socket 3.  Take a look at the Help for "System Operands" for a detailed explanation.

    Your MI 150 pointer is incremented by a 0.01 sec timer that doesn't take into account whether the Modbus function is busy (MB 32).  That's probably too fast.

    Your RHR blocks also don't consider whether the Modbus function is busy.  It's like you're screaming at the "I don't care if the last function isn't done yet!  Do this NOW!!"

    Anyway, I hacked on it a bit.  Program attached.  Let us know how it goes.

    Joe T.

     

     

    Luis_REV_11_JT.vlp

  4. System bit SB 8 turns on when the battery is low.  I always put a small indicator on the screen for this.

    If the settings will never change you can either check the power-up box or put them in a Data Table with the "Part of Project" checked.  You could load them when the PLC powers up.

    33 minutes ago, ZebioEE said:

    PS. is nonsense nowadays use volatile memory related battery condition :(

    We have to deal with the cards we're dealt.  The battery is rated for 7 years and they typically last for 10 years.  Your client will have to change them from time to time.

    Joe T.

  5. Thank you for posting the diagram to clarify what you're doing.

    Be Honest.  Do Best!

    I love that in the header of the USR manual.

    You're PLC program looks correct.

    I agree with Gabriel that a wired connection is better, but I have set up to Wi-Fi access points to do what you're doing.  Just configure the two USRs to see each other and set their IP addresses to be in your network.  Their connection should be transparent to the PLC and the SCADA system.  It should work without any additional programming on your part.

    200 meters is a fair range.  You may need directional Wi-Fi antennas or a booster.

    Joe T.

  6. Remote Access is a Unitronics dedicated program to remotely replicate the displays of a Unitronics PLC.  This is not what you're looking for to communicate with a SCADA package or another device..

    You will set up the V1040 as a Modbus RTU serial slave for your SCADA software.  Look at the Help and the Examples for Modbus Slave configuration and for Modbus Slave address tables.  The entire PLC memory is available to the SCADA software via Modbus.

    Joe T.

     

  7. OK, that network needs to be broken into about four separate simpler networks.  The compiler is probably having a nervous breakdown.

    What is the purpose of MB 100?

    Normally just Init the sockets and run the configs just once at power-up.  I think you're way over-complicating this.

    Are you configuring two Modbus IP ports because you want to have a Master and a Slave in the same unit?

     

    Joe T.

  8. Adding an RFID reader is relatively straightforward.  The V570 has serial ports that can talk to it.  Adding prox switches is also not a problem.

    Interfacing with the customer's database will be really, really tricky.  Database is a generic term, like "car".  Each customer has their own database, and you'll have to get security access to it, know what type it is, what tables are in it, what the field names are, and so on. 

    This will probably be a  generic solution with a custom program modification for each customer.  You'll probably need to add a UniStream to work with the V570.  The UniStream has much more horsepower in this department.

    I would start by gathering specific database information from all the customers that are asking for this feature. 

    Joe T.

  9. If you're getting one pulse per revolution on a 60 RPM shaft you really don't need a high speed input.  You're getting a pulse every one second.

    You can set up a self-resetting 0.01 second timer as a pulse generator and just count the timer pulses between the proximity sensor pulses.  You could also add more magnets around the shaft to get more pulses per revolution.   Use your imagination.

    What kind of resolution are you looking for?

    Joe T.

  10. The screen on the V350 says "No Application".  That means there is no program loaded into it.  If you look at the Ethernet examples that install when you download and install Visilogic, you'll see that you need to configure the Ethernet port using a couple of function blocks in the program.

    To initially communicate with the V350 you'll need a USB to Serial adapter with the Prolific chipset and a Unitronics serial cable.  A Unitronics distributor can supply both of these, and they're not expensive.

    Joe T.

  11. If you're going through a WAN network there is probably some packet clogging going on and the socket is closing itself.

    SI 101 is the packet timeout in units of 100 ms and defaults to a value of 2 (200 ms).

    Try setting it to 10.

    If that doesn't work, get an old-school Ethernet hub that re-broadcasts all traffic out all ports.  If that's not available see if you can get a managed switch an map two of the ports together so you can observe the traffic between your SCADA software and the PLC.

    Then download WireShark and learn how to use it.  I ran into this problem a few years back trying to talk to a V350 using a pair of cellular modems.   You can set up WireShark to only show port 502 transactions.  WireShark timestamps everything to 1 millisecond accuracy.  I found that by sniffing the packets between the Master and the Slave that the Modbus requests were getting through but the PLC closed the socket before answering sometimes.  The delay was about 800 milliseconds in my case.

    Gremlin problems like this require a deeper dive into troubleshooting.

    Joe T.

×
×
  • Create New...