Jump to content

Flex727

MVP 2023
  • Posts

    3,325
  • Joined

  • Last visited

  • Days Won

    241

Posts posted by Flex727

  1. 46 minutes ago, JMorel said:

    I tried with SB 2 and SB 142 but still nothing

    SB 2 _AND_ SB 142? Do NOT use SB 142 here. SB 142 turns on when the Ethernet card is initialized. It will never activate the Ethernet card initialization function block.

    Is your PC on the same subnet as the PLC (i.e. does your PLC Ethernet address begin with 192.168.100.xxx)?

  2. A few other items of note:

    1) Do NOT place multiple logic threads in a single ladder rung, as you are doing in the Szamlalo subroutine.

    2) Do NOT use Direct Contacts to call an HMI screen - use Positive Transition Contacts.

    3) No need to call the Start-Up Display with SB 2 - it will be called automatically at start up.

    4) No need to set or reset operands with SB 2. Use the Power-Up checkbox for MIs and SET or RESET selection for MBs.

  3. Not sure what you're trying to do here. All operands are retained through a power cycle (if there is a functioning battery installed). If you want the register to assume a particular value at start-up, then you use the Power-Up value to accomplish that.

    Looking at your program, MI 0, 1, & 9 have the power-ups checked. If you want MI 0, 1, & 9 to retain their last value, then uncheck that box.

  4. Briefly, (and perhaps over simplified), a Port is an address that is visible to the outside world. A Socket hosts the Port for the communications. You have 4 Sockets in your Unitronics PLC (numbered 0-3) and therefore you have 4 paths for communications over Ethernet. You can mix and match protocols as you wish, but you only have 4 that you can use at one time. Each of the 4 Sockets has a default configuration, but you can change that with a Socket Initialization FB. If you're going to use MODBUS TCP, you must have a MODBUS IP configuration FB for each Socket that will be using MODBUS TCP. Both the Socket Initialization and the MODBUS configuration should be activated with SB 2.

  5. There are example programs that came with your VisiLogic installation that show you the proper way to set up MODBUS TCP communications. You can have a continuous connection with up to 4 MODBUS TCP devices by using the 4 available sockets. You will need to initialize the sockets with the proper protocol and port number, as well as set up your MODBUS IP configuration for each.

  6. 28 minutes ago, ncbc said:

    Perhaps I am using the wrong datatype?

    Yes you are. Use MI, not ML. For the above ASCII String, you will need a vector of 3 MIs to hold the 6 characters of your string. (I believe you can use MLs and hold 4 characters per register, but why complicate things.)

    In the Read Row FB, you need to assign an operand to every column in the Data Table Row. You can certainly make the operands contiguous so that you have a vector to operate on later, but you need an assignment for each element.

  7. Also, do NOT use SB 3 for your communications. If one second intervals are sufficient for your communications, use SB 13. SB 3 will cause the PLC to attempt comms on every PLC scan for fully half of each second. You want to trigger communications with a transition contact or SB 13, which is automatically a transition contact.

    And place an inverted contact of MB 100 in front of the comms FB.

  8. First of all, you need to Read Holding Registers (R.H.R #3), not Read Input Registers (R.I.R #4).

    Also, you can read and write bits (coils) directly using Read Coils #1 and Force Coils #5 or #15.

    But the simplest method when you are communicating between two Unitronics Vision PLCs is to use the FB Read/Write Mixed Data. This FB allows you to enter a mix of operands and read or write them directly using a single function call.

    • Like 1
×
×
  • Create New...

Important Information

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