Jump to content


Privileged Member
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Isakovic

  1. Here are my suggestions. This part here: 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?
  2. I suppose this is because of differences in how memory is organized in Visi and Uni. But if it can be done it would be great.
  3. This could have inspired that Note. I remember reading an old topic about user objecting that timers which have unused contacts should generate warning message after compiling, now timers with unused contacts do generate warning after compiling.
  4. 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.
  5. 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?
  6. 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. 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. This depends on how you make your logic. If you use that standard form from Examples 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.
  7. 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.
  8. Yea, this last version is a little messy. Status 19 means that the socket is initialized properly, when it connects it changes value to 23. Change those port numbers and separate rungs as Flx said and tell us how it goes. If you need to connect from a PC over Ethernet just initialize one socket as TCP slave.
  9. Your best option is to contact the company/person that made the original program. If that is not an option contact Unitronics support directly. Or write program from scratch. If you can't get your hands on the program this is probably what has to be done.
  10. 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: 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.
  11. Will reusing the same operands (system or standard) in several places in program be a problem? I often use the same memory place as auxiliary variable for several calculations in the same scan.
  12. You can linearise as many analog inputs as PLC has them. You can linearise other numeric values, I don't think there's any limit.
  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.
  14. 1. I don't think you need to have port 502 on your side on any socket for Modbus to work as master. Try it out. 2. In rung 5, MB4 should be set, not reset. It should be reset after Modbus block in rung 6.
  15. Alternative to this is using "Struct" function. This is how I see it, someone correct me if I'm wrong. Vector length is number of 16 bit registers that is taken in memory, MI is 16 bits long. So length 4 means 4 MIs will be written into. In your case you write into ML which is 32 bits, so you are overwriting 2 consecutive MLs. I guess that is happening, because when I do it I read all needed into MIs and use "Struct" function to pack read registers and form what I need. This way is maybe better in some cases because you have control over the data you read. ML register are signed, so if you read the number of pulses or whatever from your servo that is always positive you can overflow it and go into negatives for large numbers, in that case you need DW register as your destination ("Master:Start of Vector"). I use this method when reading floats from power meters, because you can't write directly into MF. If your method works and gives you what you need than it is correct and you don't need to change anything and complicate things.
  16. Try to increase "Every Period" time, that helped me in similar situation. I don't know if it is still a thing in UniLogic like in VisiLogic, but also break rung 5 into more rungs. Cramped rungs used to make issues.
  17. In rung 9 try calling connect function over a transition contact. Also looks like you are connecting to 2 slaves simultaneously over the same socket, I think this won't work, you need to connect to first slave, run Modbus commands, disconnect, connect to second one, run Modbus for second one. Or use two sockets. Tell us how it goes.
  18. Do it elegantly as Flex said or: 1000 0000 0000 0000 0000 0000 0000 in decimal is 134217728. If you store this number in DW150 4th bit (or 28th depends how you count) will be zero. I remember working with older ladder software that didn't have bits manipulation. If you needed to make a certain combination of 1s and 0s in register, first you reset register (store 0), than if bit 1 is 1 add 1, if bit 2 is 1 add 2, if bit 3 is 1 add 4, if bit 4 is 1 add 8.... Good times.
  19. That is the best way to do it. Function that packs bits into registers is called "Struct", you can find it in "Vector" tab.
  20. Maybe try updating with NTP server. There was this topic some time ago.
  21. If you have a program that is on the plc you can read DT values and export to Excel via UniLogic.
  22. If you mean firmware update, look Help -> Firmware, as Alex said. If you mean transfering new project to PLC this is also possible with USB stick, look Help -> Downloading/Uploading a Project
  23. I think if you make an array out of a tag you write into, it will read consecutive registers to fill the length of an array. I also had to look up the topic Alex linked this morning because I got stuck on the same problem as you did. In VisiLogic you didn't have to swap bytes, just combine two MIs into an MF with Struct.
  24. Compared to working configuration I once did, all settings are the same except nothing was checked in the client area and "Inactivity timer" was set to 20. Also value 310 was stored in SI145 on startup. You have address in Ethernet settings, maybe it's a typo.
  • Create New...