Jump to content

Joe Tauser

MVP 2023
  • Posts

    2,851
  • Joined

  • Last visited

  • Days Won

    308

Posts posted by Joe Tauser

  1. 3 minutes ago, kvlada said:

    There must be something  similar in Unilogic.

    There is not.  There are quite a few functions in Vision that don't exist in UniStream.   PWM and Linearize Array immediately come to mind.

    The thing about a function in Vision is you don't know what the assembly code looks like under the hood to get that function to work.  We got spoiled by some of that stuff.

    Here's the RTC to ASCII udfb I lifted from the example programs.  Looking through it gives us an indicator of what kind of somersaults the Vision programmers performed for that function.  You can call it overkill if you wish.  But it does work.

    Joe T.

    RTC to ASCII V2.ulle

  2. 10 minutes ago, Merle said:

    I was trying to communicate with an actual slave device, which works for single commands only.  If I try to send multiple commands within a relatively short period of time is when the issues appeared.

    Have you tried setting up an Aperiodic Batch Operation?

    Joe T.

  3. The three second recovery probably has something to do with your Retry count setting.

    My experience has been that the specific modbus error codes you describe above don't always get set they way you think they should.  I spent a huge amount of time trying to simulate errors between the PLC and another device and then trying to figure out the timing and value of the error codes, just as you have.

    Are you experiencing errors when trying to communicate with a device or are you just trying to interpret what the PLC response is when firing commands to a dumb terminal?

    If you're just trying to observe PLC behavior with a PC, I'd Google "free Modbus simulator" and put that on your PC.

    If you're just trying to get a more real-time monitor of the communication status between your PLC and the actual device, I'd abandon the Status column in the Modbus Table and go straight to the source - the Modbus Remote Slave Status word.  It changes its value to 2 or 3 pretty quickly when communication is lost and will reset itself back to 1 when communication restores itself.

    Joe T.

    • Upvote 1
  4. Um...  the PC is not a PLC.  How would you connect the wiring of your equipment to it?  All Remote Operator does is mirror the graphics in the PLC to another graphic display device; your monitor in this instance.  Remote Operator does not turn your PC or your phone into a machine controller.

    Based on the PLC information screenshot above your PLC has had it's memory corrupted.  You need to replace it, and you will need to somehow get the program to load into a new one.

    Joe T.

  5. You can't "force" the PID algorithm.  You can intercept the CV output and copy it to your control device, and when the PID block is off you can continue writing that same value, but when the PID block is activated again it will do its thing and come up with whatever value based on the tuning parameters.

    When you remove power from the PID block, the Integral value is retained unless you reset it using the Reset Integral function.  The control value consists of P, I, and D components.  If the PV -SP error is the same as when you turned the block off (so the P component will be the same) the block should pick right up where it left off.

    Joe T.

  6. You have O57 and O59 assigned to duplicate coils.  This is very bad programming practice.  Unlike Set, Reset, and Toggle, you should only use a regular coil once in your program for a given output or bit.

    When the ladder scans, EVERY rung is evaluated.  The last coil assigned to a particular memory location wins.  While O57 and O59 may be ON in Net 4, In Nets 9 and 10 they will be turned OFF if MB 9 and/or MB10 are not on.

    Put an intermediate MB in place of O57 and O59 in Net 4.  Then OR your intermediate MB with MB 9 and MB 10 in Nets 9 and 10 to turn the output on.

    Joe T.

    • Like 1
  7. Were you able to get Remote Operator working over the serial port?

    Ethernet is added with a card you install in the V350 - part number V100-17-ET2.

    Then you have to add a rung to your program to initialize it and assign an IP address.   This is documented in the Help - search for "Ethernet" and then look at "Using Ethernet" and in that topic scroll down to Ethernet: Card Init.

    You'll have to assign a PLC name and depending on the version of Visilogic you're using there may or may not be a mandatory access password.  Versions prior to 9.9.00 do not require a password, but they are less secure.

    You'll then need to connect your V350 via cable to a network that has WiFi Access if you want to use the phone app.  Otherwise you can set up Remote Operator to run on a PC and change the connection from Serial to TCP/IP (Call).

    Joe T.

  8. You can also download the Remote Operator program to your PC:

    https://downloads.unitronicsplc.com/Sites/plc/Visilogic/Download Software Utilities/Remote Operator Version 1.0.95.zip

    Remote Operator is similar to Remote Access.   Remote Operator is Remote Access with some features removed like Data Table transfer.

    Both will allow you to run the equipment from a remote screen.  

    Joe T.

  9. You can't talk to the V350 with the phone app unless it's got an Ethernet card.  The phone app relies on the phone having WiFi turned on and it's connected to your network.

    Your other screenshots show you were able to connect to the dead V350 and that it was in BOOT mode.  That means it's lost it's little mind and you won't have much luck seeing the screens, as it has no application in it's memory.

    But at least your cable and USB adapter are working.  You can access the screens from your PC.  Download the Remote Access program from here:

    https://downloads.unitronicsplc.com/Sites/plc/Visilogic/Download Software Utilities/RemoteAccess_9_8_19.exe

    You should be able to plug your cables into the working V350 and see the screens with this program.

    Joe T.

  10. On 3/26/2024 at 1:14 AM, user32767 said:

    Everything in this servo is so unnecessarily overcomplicated

    I hear you.  It seems like this applies to every brand of servo I've ever worked with 😒

    I don't have a UMD in front of me so I can't fill out your form.  Sorry.

    On 3/26/2024 at 1:14 AM, user32767 said:

    I have connected pulse frequency output of controller to PULS+ and PULS- inputs of the servo,

    This may be the problem.  You didn't included a diagram of how you actually wired it.  I posted an explanation about connecting servo and stepper pulse inputs in the Visilogic forum.  It applies here, too.

    Let us know if this helps.

    Joe T.

  11. On 3/27/2024 at 7:35 AM, Flex727 said:

    Just change the PLC model in the program temporarily to test, then change it back.

    Unfortunately UniStream will stomp on your program if you try this.  If you change to a model that has a different I/O configuration then you have to delete any reference to onboard I/O points that are different.

    I would make some buffer input and output bit arrays that match the size of the -T42 onboard I/O.  Then do a search and replace (Edit tab) for each real I/O point and replace it with the buffer bit.  Finally, when you want to put it back in the field add a couple of blocks to copy real inputs to your input bit array and your output bit array to the real outputs. 

    For example - 

    Original code:

    image.png.a71d22ba75d4ef63499754fecf23c538.png

    Code for the -T42:

    image.png.6ef4d3162fc7a292235ed584aac9e9b1.png

     

    After deleting rung 2 I was able to change the model to a -B1.

    I realize it is a bit of a pain in the butt to modify your program this way, but it will work.  You do what you can with the tools you have.

     

    Joe T.

     

     

     

  12. I was contacted about how to connect the HSO outputs on a V130 to control a not-to-be-named brand of servo.

    If you're controlling a servo / stepper with the HSO outputs you're going to be giving it pulses and direction, so it's effectively a stepper.  A servo controller has the added bonus of position feedback, but that's not important for this discussion.

    I tried to quickly find a post on the forum that covered properly connecting an HSO to the pulse input and I had a hard time finding what I really wanted with the forum search  function.  I decided it was a topic worth posting and pinning.

    Here's a pretty typical input to a servo / stepper control:

    image.png.26a3e0c9c6d8ffac3061cea88537002d.png

    The people who put these diagrams together assume you will be pushing the controller with a 5V line driver, which is why it's shown like this.  

    The connection shown above tells us nothing about how to connect this to a PLC system.  If you try to drive the PULS and SIGN input with 24V PLC signals you will blow this thing up.

    When you're connecting components together from different manufacturers, you have to have an understanding of basic electricity.  There's no way around it.  Ohm's Law combined with Kirkoff's Voltage Law (sum of voltage drops = 0)  always wins.

     Let's dive in with some basic facts about optocouplers.  This is the optocoupler part:

    image.png.05ec5e75ffe71af985bee66eec8c6793.png

    It works by passing current through the LED which makes the LED light up.  That turns on the transistor, which is made so that it's optically sensitive.

    Notice I said CURRENT.  LEDs will start working after some forward bias voltage is applied and then get brighter as more current is supplied.  The voltage drop will remain about the same, and eventually if you apply too much current the LED will burn out, just like a light bulb.  A typical absolute maximum input current for an optocoupler is 50 mA.

    I always use a voltage drop of 1.2V and a supply current of 10 - 20 mA for optocouplers.

    Now let's look at the above circuit designed to run on a 5V pulse input with it's internal 150 ohm resistor and apply math:

    image.png.6c9b7714848212bd2d509d09be982085.png 

    As you can see, the current going through the optocoupler is 25 mA.  Well within the specification.

    Moving on, the Unitronics HSO output is an open collector N-type Mosfet.  "Open Collector" is manufacturer-speak for "we didn't connect one side of the device.  That's up to you."  They do this to get the speed needed to call it a High Speed Output.  That's another discussion.

    Just think of an NPN / Open Collector / Sinking Output as a relay contact to 0V.  You've got to provide the high side.

    Here's how the servo / stepper gets connected to the HSO Output:

    image.png.24d766cdaed7392974b530302b79af9c.png

     

    I've re-done the voltage equation to include the extra parts.  For bonus points you can see if you can come up with the equations yourself.

    In addition to connecting the parts together correctly, an extremely important component in the circuit is the pull-up resistor.

    Let's say you're trying to hook this up and your boss and/or customer is riding your butt and you don't have a resistor.  So you just connect your +24V to the (+) on the servo and connect the rest as shown.  

    Let's do the math:

    i = (24 - 1.4) / (0 + 150) = 150 mA

    You will blow up the servo, the PLC, or both probably after about 10 pulses.  Less if your output gets stuck on.

    If you've read my other posts on connecting stuff to open collector outputs you may remember that my go-to resistor I carry with me is a 2.2K (1/2W).  Let's put a 2.2K resistor in for Rp:

    i = (24 -1.4) / (2200 + 150) = 9.6 mA

    Right in range.  Yay!

     

    For the answers to these and other impossible questions remember that Google is your friend.

    Joe T.

     

     

     

    • Like 1
    • Upvote 3
  13. The project I'm working on now requires display of a LOT of REAL tags.  They're typically 5 or 6 significant digits.

    For example, this is from my Scale display.  We're talking to scales which will have a maximum of 5000 kg, and we want two decimal points.  This is how it looks:

    image.png.a65237345123aebcd56c5a2a0eab2fdb.png

    I've sized the numeric boxes so they don't look ridiculously large with the displayed data, but the UniStream compiler chokes on this and I get all kinds of "warnings".

    It would be really nice if we could specify the number of digits on both sides of the decimal point like we can with INTs.

    Joe T.

  14. @Ravi - I generally don't write programs from scratch for people on the forum.  My philosophy has always been you learn by doing.

    That said, I will generally help a user who's made an honest stab at making a program work by editing it for them.  If you upload the program you're working on I and others on the forum will be happy to download it and have a look at your work.

    Make sure you tell us which version of Visilogic you're using.

    Joe T.

    • Like 1
  15. You can't add to the number of timers available but you can change the way you count time.  What is the model of the PLC you have?

    Depending on the application, I often roll my own timers by incrementing an MI with a time pulse and using compare and reset numeric blocks on them.  It takes up more program space, but you get a lot more control over what you do with the "timer" value.

    Joe T.

    • Like 1
×
×
  • Create New...