Jump to content

Isakovic

Privileged Member
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by Isakovic

  1. If I understand manual correctly this Master Clock can work as an NTP server. There is a function in VisiLogic called RFC-1305 for time synchronization with NTP server, there is also an example. It works fine, but if something goes wrong and server returns 0 it will reset PLC clock to midnight 1.1.2001. Just make sure to have some logic preventing this.

    Or if wiring allows it use digital input as Ausman says, that will take less programming time and be pretty accurate for this case.

    • Like 1
  2. Oh I see it now!

    If the PLC and Hama are powered from the same supply both CH1 and GND on the PLC module will effectively be on the ground potential.

    Now I suspect AI08O also has GND and negative power terminal connected, so switching terminal places would not work. But will it work if separate power supply is used only to power Hama (not referenced to the ground), and other supply is used for current loop and PLC?

  3. You can search this on the internet for detailed explanation. It means that Integral component has maxed out over time and is contributing 100% to PID output. Maybe integral time is too slow or system cannot reach setpoint fast enough. If this makes oscillations or any other problems you can force Integral component to take some other value, there is a function block for that in PID menu.

    • Like 2
  4. The way that Sargani explained in post number 2 should work.

    6 hours ago, vken said:

    but as far I can understand is that the reading should be in two arrays or two registers.  how ever I was not able to read two arrays from unistream. 

     

    6 hours ago, vken said:

    When is saying 4 bytes (2 registers) they are 2 registers in row?

    Yes you can (and should in this case) read several registers in a row. If in "Modbus Master" setup you define tag as an array of 16 bit integers, let's say of length 10, PLC will read 10 consecutive registers from Modbus Slave.

    Can you post part of the program with code for making 32 bit float from 16 bit ints, with setup for Modbus so we can help you find the problem?

  5. Hello,

    I need to add two columns to an existing Data Table, in VisiLogic this can be done without losing values, I'm not sure how it works in UniLogic, I remember once editing it and all values went to 0. Can I add a member to Data Table struct and retaining values in old columns? I would back up old table, but problem is that I can't read the values in online mode and back them up, I get this error:

    Capture.PNG.2deca2da9005fa80d71bade16d9925c0.PNG

    Connection to plc was over Ethernet, ladder works normally in online mode so I wouldn't say it's a connection issue.

    If new columns cannot be added without losing values, my second question would be: Is it possible to read values via UniApps and save DT to USB stick?

  6. I'll explain the problem I had, maybe it helps somebody.

    I have several controllers that need to have synchronized RTC, and there was a problem that time update didn't work properly. After some troubleshooting I found that "Status" variables need to be defined in order for function blocks to work.

    This does not work (usually):

    1719291847_doesnotwork.thumb.PNG.b19ce3c3270426407db836db9bb2b3b9.PNG

    This does work:

    works.PNG.0132c4cbc8e36df8957f0f2bda2a1d5d.PNG

    Both cases compile the same without error or warning.

    UniLogic version 1.28.34
    PLC USP-070-B08

    • Upvote 1
  7. Here are my suggestions.

    This part here:

    Capture.PNG.b0d6b689cb8aa07d6f71902900a989f1.PNG

    If no connection is established due to some reason, T0 will stay on and PLC will not try to reconnect again. T0 should restart if there is no connection after some time.

    Since you do both master and slave pack all registers that you need to read from slave one after another and then read them all at once with one command (Vector length 24 in read command). It's more efficient than reading them one by one.

    About SB168 I always Set it at startup as suggested and Set SI103-106 to 200. Don't know how it behaves if values are left blank.

    I'm curious does your method of calling Modbus commands works? Have you tested it?

  8. When doing system upgrade for Vision PLC, there is a message while OS is being installed:

    For System Upgrade PC should be connected to PLC via COM 1

    Should be, or has to be? OS can also be upgraded vie Ethernet, so why is it recommended to be done over serial port? Why is this note there? Is it technical reason or practical, like if something goes wrong PLC will be in your reach and you won't have bricked unit in remote location.

    98186377_shouldbe.PNG.877970b1859dd16a3516b03e63b5b968.PNG

  9. On 6/11/2020 at 7:51 AM, Isakovic said:
    On 6/10/2020 at 7:46 PM, Flex727 said:

    To connect to a different device using the same socket, you must Disconnect, re-initialize the MODBUS Configuration FB, then Connect to the new device.

    I'm not sure about reinitializing Configuration FB. It does have addresses for only 15 slaves, but if I remember right when you execute read command it will read from whichever slave the PLC is connected to, disregarding the "Slave ID number" that is in the read command. Maybe this was an issue from some older VisiLogic version when I encountered this for the first time. I've wanted to test this for some time now, but don't have the will.

    So, I tested this.

    One master reading 3 slaves one after another from the same Socket. No slaves were defined, every read command had Slave 0 and it worked.

    Turns out you don't need to have defined slave addresses in Modbus Configuration FB. Modbus commands are sent to device which is connected at the moment of execution, no matter what is in the Slave ID field. Should we add slave addresses in Configuration FB or not (I don't see the point since connection has to be made manualy), what is a good practice here? Is it OK to communicate with more than 15 devices without reinitializing Configuration FB, like in newbie88's case?

    • Like 1
  10. I'll tell what worked for me regarding your questions, newbie88.

    Steps go as you described. Connect to 1-Read-Disconnect;  Connect to 2-Read-Disconnect... You are using TCP so connection is required. Delay of 0.4 seconds after disconnecting from one client before connecting to second one, and another 0.4 seconds before sending Modbus commands, maybe this can be shorter (probably, you should experiment). For 4 clients this cycle takes 3.9 seconds, if time is critical you may need to use more sockets or go to UniStream. For any slave that drops number of retries and timeout will add extra delay.

    11 hours ago, Flex727 said:

    To connect to a different device using the same socket, you must Disconnect, re-initialize the MODBUS Configuration FB, then Connect to the new device.

    I'm not sure about reinitializing Configuration FB. It does have addresses for only 15 slaves, but if I remember right when you execute read command it will read from whichever slave the PLC is connected to, disregarding the "Slave ID number" that is in the read command. Maybe this was an issue from some older VisiLogic version when I encountered this for the first time. I've wanted to test this for some time now, but don't have the will.

    19 hours ago, newbie88 said:

    Any bit to confirm the values is readable before going to the next one?

    This depends on how you make your logic. If you use that standard form from Examples

    ip.PNG.26f51876a46f030b18e63bd03a1c7d9e.PNG

    You can go to next step after all read bits are low for how many read commands you have. I found it works without putting delays between commands, just using "Function in Progress" bit to stop multiple read commands from interfering one with another.

    Don't forget that system bit that shows if socket is connected should be a condition before blasting Modbus commands.

    Hope it helps, tell us how it goes.

    • Like 1
  11. Great topic. I have a question for eminent wizard kratmel.

    Is it recommended or not to use different power supplies for main power and output power? If both are referenced to ground I guess not, but what if they are floating?

    I remember a case when I had safety circuit cut +VO line as a bonus security on Jazz unit. This rebooted PLC when activated so I don't use it anymore. Why was this happening? It was the same supply for PLC and outputs.

  12. 1. You have correctly initialized Socket 3. What is the purpose of MB11? Looks to me like it has to be switched on manually. Also it is better to call "Socket Connect" block over transition contact. Maybe something like this:

    snip.PNG.11ce3e491f916372a7bfd5511d7c5d30.PNG

    It will reconnect after losing connection. In rung 3 you are closing socket after Modbus command, you don't need to do that.

    Maybe socket status changes to other value than 23 while sending Modbus command and may trigger connect block if it stays like that for more than 5 seconds in this example. You may have to investigate this. Also look into "Keep alive" values for sockets if they suit your application.

    Generally it is wise to have logic that will recognize connection problems in situations like this and try to automatically clean up what needs cleaning up and connect what needs connecting.

    2. 🤷‍♂️

    3. Initialize 2 more sockets. You have 8 sockets available in V700. Manage them the same way like the first one. They can work independently. If you ever need to communicate with more devices than you have sockets you need to make logic to connect and disconnect from various slaves, but that's not the case here. Leave one socket for your PC connection.

  13. What kind of motor are you using?

    I don't think it's an encoder issue. From your explanation it seems the inertia is causing inconsistency in positioning. It's hard to drive the system precisely with start/stop motion with relatively fast motor. If steppers and servos are out of question maybe you can try with VFD. To have a significantly slower speed when you approach desired position. Or add a gearbox, if there is space and speed reduction isn't much of an issue for machine performance.

    Since you mentioned motor with brakes. I had one project where I had control done just as you did here but with braking motor. Precision was 1-2mm (within tolerance for the project), even when carrying heavy load. Brakes wear off fast though.

×
×
  • Create New...