Jump to content

Flex727

MVP 2023
  • Posts

    3,276
  • Joined

  • Last visited

  • Days Won

    239

Posts posted by Flex727

  1. Hello,

     

    I am new to ladder logic and the Unitronics system, and I had two questions:

     

    1) Is there any way to simulate a project WITHOUT connecting the PLC controller to it? I want to see how some of the example projects run but I don't have the actual console yet.

     

    2) How would I make the program wait for a specific condition to be met before moving on with the code? For example, I want to open a valve, and then once the pressure goes down to a certain level, shut off the valve. However, if I use a positive contact saying "If pressure is <= x" and then write a coil that shuts the valve, won't the program just skip the rung (because in the beginning it would just evaluate as false) and end the program without waiting for the condition to be fulfilled?

     

    Thank you in advance!

     

    It's important to understand the PLC workflow. Here are the basics:

     

    1) Read inputs.

    2) Evaluate ladder logic.

    3) Write outputs.

    4) Repeat steps 1-3 continuously.

     

    Normal software is linear and runs from beginning to end. PLC software is a loop - it executes and repeats infinitely. You cannot have the program stop and wait - it will create a watchdog timer alarm.

     

    The important thing to remember is that each Output Coil should exist in only one ladder rung. Think out every condition that turns the output on and place it in a single rung. (The exception is SET & RESET coils)

    If you need to wait for a condition to be true before executing code, set a bit to be true when that condition exists and use it as a gate for that logic or subroutine.

    Use the Main Routine to execute subroutines and execute initial (startup) actions only. All program logic should take place in subroutines.

  2. The typical RJ-11 cable (like used for phones and like what comes with the PLC) is a crossover cable. If you add an additional cable between the PLC and the coupler it must be a straight-thru cable like this one:

    http://www.monoprice.com/Product?c_id=102&cp_id=10222&cs_id=1022201&p_id=928&seq=1&format=2

     

    You are probably doing a double crossover which will not work. Two crossover cables WILL only work if the coupler is also a crossover.

     

    Where I work we do exactly what you are trying to do and encountered the same issue you are having. A straight-thru cable inside the box works perfectly.

    • Upvote 1
  3. As a followup, I need to say that I really needed to transfer much more than 160 registers. My intent is to move 96 user-entered names of 10 characters each stored in 480 MIs from one PLC to another so that the customer doesn't have to enter them twice (they were in 3 vectors of 160 MIs, hence my need to read 160 in my original question). These names might change from time-to-time so I wanted a pushbutton to grab the names off the other PLC when needed. I broke the read into 5 pieces and tried executing them all at once without any delay and, surprisingly, it worked perfectly. The PB SETs 5 MBs. Each read is the standard line of code where the MB is N.O. and the power flows through the usual check for connected Socket and no other comm in progress, then a RESET of the MB at the end. Even though every single read is initiated in the same PLC cycle, they all execute properly. I may add the delay in anyway just for safety, but apparently Unitronics has some well-written MODBUS function code.

  4. I am fairly experienced with Unitronics PLCs and have done quite a few projects requiring communications with no major problems encountered until now. On this project I am sending data from one V570 PLC to another using MODBUS IP over Ethernet. My need is to send 160 registers (MIs) using R.H.R #3. I've found that I cannot send more than 125 registers without encountering status errors 4, 5, & 6. Is this to be expected? Are there any tips on how to handle this? If I were to break it down to two separate reads, what would be the best procedure - should there be a delay between the two reads?

     

    Thanks.

  5. Fieron is referring to the 4 socket limitation. You will need to connect and disconnect to each slave as needed, or on a regular cycle, depending on your application. Just be aware that it will take a large fraction of a second (or two) to perform the disconnect/reconnect process. I have done this successfully, but I sure would like to see an optimized routine for accomplishing this published as a best practice by Unitronics or an experienced programmer.

  6. Shouldn't Clark1 first just confirm that SI 9 isn't set to zero? It's quick and easy to check (but you'll need your flashlight):

    1) Go into Info Mode by touching an empty spot on the screen for at least 4 sec.

    2) Touch the big button "Enter Info Mode".

    3) Enter password (the default is 1111), and press the Enter key on the right.

    4) Touch the button near the top labeled OPERANDS.

    5) Touch the button labeled "Sys int" (2nd row, 3rd column).

    6) SI 9 will be in the 3rd row in the middle. The numbers in the 3rd row will likely be "8", "1", SI 9, "0", "0". The 3rd number (SI 9) should be a value between 0 and 100. If it's near zero, touch the value and enter 50 then the Enter key. If the value is already greater than about 10, then you truly have a dead backlight.

     

    Alternatively, if you already have Visilogic installed and a programming cable (and a USB-to-serial adapter), you can check it by going online with the PLC and checking the value directly in the Operands window of Visilogic.

  7. My experience is that a coil remains in the state it was last in when the ladder rung stops being executed. This makes sense since the coil had no logic executed to turn it off (if it was last on, for example). This will also crop up when a subroutine is conditionally executed.

     

    Any state change, whether bit, integer, or what-have-you, must be actively executed in order to occur - either off or on.

    • Upvote 2
  8. As Joe said, no need to initialize Socket 2 - it's already set to communicate with your PC. Make sure of the following:
     

    1) NAME the PLC with the Set PLC Name function block tied to a Power-Up contact (SB1) Should be SB 2.

     

    2) Address both PLC and PC to the same subnet and make sure there aren't any duplicate addresses. (Looks like you've done that)

     

    3) Use a CROSSOVER cable or an ethernet switch between the PC and PLC.

     

    4) Go to Connection / Communication & OS (or CTRL-F9),

          - Select Connection Type TCP/IP (Call)

          - Click on Project Settings and enter the correct IP Address for the PLC, Protocol TCP, Port Number 20256, and the correct PLC Name. Click OK.

     

    5) Confirm settings work by clicking the "Get PLC Information" button.

  9. I accidentally bought a 12v power supply for development work with a v570 and used it for months before I discovered my mistake. I certainly wouldn't want to install a 12v power supply on a project at a customer installation, but I never had a hiccup. Yes, I didn't have any I/O modules attached and that might make a difference, but the Unitronics PLCs are very forgiving when it comes to voltage.

×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.