Jump to content

Flex727

MVP 2023
  • Posts

    3,325
  • Joined

  • Last visited

  • Days Won

    241

Everything posted by Flex727

  1. I've written hundreds of programs for chemical systems that use dangerous chemicals. There are many safety systems in place including, as Ausman says above, cutting power to all the subsystems when certain alarm conditions are present, but I have never seen a situation that requires the PLC to be powered down or reset by an alarm condition. Further, a reset of the PLC does NOTHING except return operands to the "Power-Up" assignment (and execute code linked to SB 2), all of which can be easily done in ladder, if needed, without resetting the PLC itself. As I said, examine Outputs to determine ALL of the conditions for them to be on. Some of those conditions will be the absence of alarms. Write that into your ladder code and you won't need specific reset subroutines. I'm going to repeat this, you do NOT need any GoTos or jumps for your application. Get rid of them. Normal computer programs execute sequentially from top to bottom, but you should not think of PLC ladder logic in that way. In PLCs, even though the ladder is executed left-to-right, top-to-bottom, you should think of it as executing all at once. Why is this? Because of the fundamental PLC cycle, which is (in abbreviated form): 1) Read all physical inputs. 2) Execute all ladder logic. 3) Write all physical outputs. 4) Repeat endlessly. Nothing happens to the outside world until ALL of the program has executed.
  2. What I do is place the object on an HMI screen in VisiLogic, screen capture, place in Paint, crop, and rotate/manipulate as needed. It's a bit of a pain, but it works.
  3. This is a really good suggestion. The entire comment "rung" (is a comment really a ladder rung?) should have a light yellow background so that it is obvious and easy to spot when scrolling.
  4. It's impossible to do this properly without knowing the details of what your hardware is (Normally Open, Normally Closed, Momentary contact, etc). There are many ways to approach the logic, but here is generally the way I would handle something like this: "Machine Ready" is the summation of any checks you might need to do before the machine is ready to operate. "Start" assumes a N.O. momentary contact switch. "Stop" assumes a N.O. momentary contact switch (they are usually N.C., but I used N.O. here for simplicity). "Low Level Sensor" assumes a N.O. sensor to detect the level is low and may or may not be latched in some way. "Done Filling Sensor" is whatever means you have of detecting when to stop filling. What happens with this logic is the following: 1) Start button is pressed to start sandblasting. 2) Sandblasting will proceed as long as sand level is not low. 3) If sand level goes low, begin filling while sandblasting is paused. 4) When sand level is full, resume sandblasting. 5) Stop button or alarm stops the sandblasting operation. This is just the basic logic that would need to be fleshed out extensively with other operational details. No jumps or GoTos required. The issue here is that you have to wrap your mind around PLC Ladder Logic. It's fundamentally different from regular computer programming and the techniques can be a bit difficult to grasp until you get into the right mindset. I usually work my way backward from Outputs to Inputs. I examine each Output and determine ALL of the conditions that would turn on the Output, then code that for each one. For instance, with your Sandblasting Output (O 0 above), it will be on when the start button is pressed, but the fill level is okay and there are no alarms and the stop button hasn't been pressed. Just code that and you don't have to worry about other stuff in the program. Usually, you don't even need to worry about order of events, but here rung 2 follows rung 1 purposely to prevent MB 1 from being ON at any point when there is an alarm present (it might get turned on in rung 1, but it will turn back off in rung 2, thus never activating O 0).
  5. Historic reasons. I can't remember exactly why, because...CRS Don't tell anyone, but I once extended an expansion cable by using a regular ethernet cable and a coupler. It worked perfectly, but it wasn't a noisy environment.
  6. This is certainly true. And no doubt "better" is in the ear of the beholder. By the way, the rant wasn't aimed at you, just the audiophile community in general. I apologize if it was taken wrong. Meanwhile, back to PLCs...why did Unitronics use RJ-45 for the expansion cable. everyone always gets the expansion cable and ethernet cable reversed. Not surprisingly, neither works when wrong way round. (I can rant about anything! That's what we old codgers are best at.) Hey! I just realized we need a gray-haired emoticon.
  7. I'm convinced this is delusional. CDs were originally pretty bad because sound engineers failed to properly tailor the sound for the new media and instead used the equilization curves for vinyl with insufficient modification. That's no longer the case. Nowadays, the abysmal compression of MP3s may be worse than vinyl, but no one who really cares about sound quality should be listening to either compressed MP3 or vinyl. Vinyl necessarily has extreme equalization in order to achieve any bass response, necessarily lacks sufficient channel separation, and degrades every time the record is played. </rant> THIS I agree with wholeheartedly.
  8. There are so many settings involved in network communications (with any PLC), that I don't think I've ever written a project from scratch where I didn't miss getting some setting right.
  9. We were all beginners once. Unitronics has some excellent YouTube videos for training that can help you along more quickly. Also, take a look at some of the example projects that came with your VisiLogic installation to see some recommended logical formulations.
  10. Ladder logic is not like other programming languages you may be familiar with. You rarely need to use "GoTo" loops. In over 10 years of ladder programming, I've never used that command once. Just write your logic working left to right and top to bottom. Use subroutines, as needed, to break your logic up into manageable pieces. Remember that PLCs are already looping continuously and there is a watchdog timer that is looking for the entire PLC scan to complete within a short period of time. Looping within the scan risks triggering the watchdog. I don't have time right now to go over your program in detail, but a few items were immediately clear: - Never call an HMI on every PLC scan. HMI calls need to be gated by a transition contact (i.e. only called once). - Never place more than one line of code in a single ladder rung. - Placing timer coils and contacts in the same rung, in the way that you're doing, may not work the way you expect. - Conditional calls of subroutines can be dangerous and I recommend avoiding them whenever possible. In your case the subroutines are mostly Reset coils, so the danger is alleviated, but it leads me to believe you're not understanding the purpose of Set and Reset coils and the difference between them and Direct coils. - I find that code in the same rung following an HMI call sometimes does not get executed. It's good practice to separate HMI calls from the other logic. Don't try to stuff too much logic into a single rung - there's no need to conserve ladder rungs. Here's an example of many of the above problems in a single rung: Frankly, I have no idea how this will execute (without pulling up the STL), but I'm certain it will NOT do what you're expecting it to. Break your logic up into the smallest possible pieces and place the pieces into separate rungs. You're welcome to ask additional questions. Best of luck to you.
  11. I don't think you really need a Counter for this. Just use the Increment function of an MI, ML, or DW (depending on the max value anticipated) triggered off SB 3 to count seconds. If you expect a total run time of less than 24 hours, you can actually use a Timer so that you can display it on the HMI easily.
  12. I used to work for Texas Instruments and we made memory chips (among many, MANY other things). You don't want to know. You really don't, but it takes about $2 Billion worth of equipment and people who know what they're doing.
  13. It sounds like you did everything except re-install your serial driver. Your message would indicate that's where the problem lies. I believe it's also possible to connect to your PLC using the PLC's Serial Port 2. I'd try that also.
  14. The nice thing about VisiLogic is that Timers work just like regular contacts and coils. You activate a timer just like you activate a coil and you take action with a timer contact, just like you would a bit contact. You can also reset a timer, if needed, with a Reset Timer Coil, just like you would use a Reset Bit Coil.
  15. It looks like you hit that pretty close. The IO-AI4-AO2 has 12-bit resolution, so you should see a value between 819 & 4095 on the 4-20mA input. Now add a linearization block that looks like this:
  16. Regarding the linearization - go online with your PLC and record the MI values for your potentiometer at minimum and maximum position (0 & 10 positions). Now use that for the linearization block for your output. If you need help with that, then post those numbers here and I'll help you. As a sanity check, you should also record the number at position 5 to confirm that it's about halfway (in value) between 0 and 10 to confirm your potentiometer is linear.
  17. I'm not exactly sure what you're asking, but it seems like you could adjust your linearization blocks to achieve what you're wanting.
  18. Sure, place your conditional code in separate subroutines and call the appropriate one based on which condition is met.
  19. Yes, those are the 3 timer types available - and those are all you need. You can create any other type of timer easily from those three. For a TOF, just use an inverted contact as the activating condition.
  20. Thanks for the correction, Joe. That's what I get for typing off the top of my head.
×
×
  • Create New...

Important Information

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