TConnolly

MrPLC Member
  • Content count

    934
  • Joined

  • Last visited

Everything posted by TConnolly

  1. PIDAuto tune Formula

    void auto_tune(PID, process_time_constant, process_gain, process_deadtime) *sPID PID; float process_time_constant, process_gain, process_deadtime; { *PID.Kp = calcK( process_time_constant, process_gain, process_deadtime); *PID.Ki = calci(process_time_constant, process_gain, process_deadtime); *PID.Kd = calcd(process_time_constant, process_gain, process_deadtime); } Now you may think I'm not being very helpful at this point, but if you will look again then you will see that there are three really big hints about what you need to to learn and understand. If you can understand and then measure them, then you can tune anything. And if its something you don't do very often, you can then tune several loops on $6.00 calculator in less time that it will take to write and compile a C program. Teaching it is way beyond the scope of a forum post, your are going to have to study. BTW, if you can't first program a PID equation in C, then IMO attempting to program an autotuner is futile.
  2. PIDAuto tune Formula

    Click here. Happy reading.
  3. confused

    One more thing that could keep an output from turning on is if the output is located in a false MCR zone.
  4. If that is what the customer is proposing then give them that. Their design. Their responsibility. As I said, I've seen it before. As a precaution however I would configure the output for 0-20mA and program it to output 0 mA when ever CR06330 is off and operate in the 4-mA range whenever CR06330 is on.
  5. Depending on the input impedance of the the valve and the output impedance of your PLC AO you could throw in a small resistor as long as the overall impedance stayed lower than the max impedance of the AO. In theory the 4-20mA AO should be able to deal with a short but I wouldn't bank on all manufacturers building their product that way. The command shorting relay on the vacuum furnace I mentioned was shorting across a very large rack mount Honeywell controller with a voracious power appetite and a power supply to match.
  6. I saw it once on a vacuum furnace - the over-temperature alarm relay shorted the 4-20mA command coming from the temperature controller. If you have a form C relay then you could use one contact to short across the input of the field device and the other contact to open the 4-20mA loop, that way you don't have to worry about the load on the analog output.
  7. Ethernet for Idiots like me

    Rather than spending a lot of time explaining IP addresses, I get the sense that you are looking for something concrete to help you get up and running. I assume you know how to get to the IP address on your computer. When you are connected to your office network you probably want to set it for DHCP. When you want to talk to a PLC you want to set it fixed. So the first step is to pick an address range to use for the PLCs - you want this to be something different than what your office uses simply to avoid confusion. So first lets find out what address range your office uses. While you are connected to your office network, open a command line (Start -> Run -> then type CMD). At the command line type IPCONFIG. You will see the IP address assigned to your computer. Make a note of it. For your PLCs you will want to choose something different. For private networks you will see that your IP address is something like 10.10.XXX.XXX or 192.168.XXX.XXX, or 177.177.XXX.XXX. It really doesn't matter what these are, we just want to choose something different. So if you see 192.168.XXX.XXX as your computer's IP address, then choose to use 10.10.XXX.XXX for your PLCs, or vice versa. I'll use 10.10.xxx.xxx. If your office computer network is using 10.?.?.? then change 10.10 in my example below to 192.168. Now connect your computer to the PLC network. Set the computer IP address to 10.10.0.10. The subnet is 255.255.255.0. I always reserve xxx.xxx.xxx.10 for my programming PC. You can reserve any address you want, but I recommend that you choose something and stick with it. Make your panel view 10.10.0.2. Open a command line on your computer and PING 10.10.0.2 and you should get a reply from the panel view. Now find out the MAC ID of your compact logix. It should be on a sticker on the side of the processor board. Write it down. Next launch Rockwell's Boot-P/DHCP server (it came with your Rockwell software and should already be installed). When you see the mac address of the PLC in the request history panel click on it and set the PLC to 10.10.0.1. Click the disable BOOTP button so that BOOTP is disabled in the PLC. Now the PLC has a fixed address of 10.10.0.1. You should now be able to ping 10.10.0.1 from a command line and see it responding. From there you should be able to see the PLC and the panel view in RSLinx. Don't forget though to put your computer back on DHCP when you go to hook back up to the plant network. Because some days it is necessary to change back and forth several times I use the following batch files. I have put shortcuts on my start menu for them. @echo off Echo Setting IP address to static 10.10.0.10 netsh interface ip set address name="Local Area Connection" source=static addr=10.10.0.10 mask=255.255.255.0 ipconfig pause @echo off echo Setting IPaddress to DHCP netsh interface ip set address name="Local Area Connection" source=dhcp ipconfig pause As a final note, I write the IP address of every device in a system on a sticker and apply the sticker directly to the device. Nothing is more frustrating than trying to figure out what the IP address is when its already assigned and you have no idea what it might be. There are tools to find them, but a measly simple sticker will save you loads of grief down the road.
  8. T flip-flop

    IIRC, this kind of programmable relay scans differently than a PLC does. It scans vertically, solving everything in column 1 of the entire ladder first, then returning to the top of the ladder and solving everything in column 2. Keep that in mind as you review your program.
  9. Apple for Systems Integrators?

    Interesting blog. So in a nutshell, Vista's problems are because the project management sucked. No surprises there, thats often the case behind many product disasters, not just software ones. However its encouraging to see them admit it. Win7 project management was different, and it sound like it was much better for those working on it, but the judgement on whether it produced a better product remains to be seen, although initially it seems to be better.
  10. Well structured ST should be the fastest. It is however the least visual - which might be an issue for Bubba. I ran a test some time ago for linearizing a non-standard thermocouple using six different fifth order polynomials. ST kicked Ladder's butt. The disadvantage ladder has for large computations is the necessity of storing every intermediate result in memory and then fetching that result again just to continue the computation. ST allows you to craft equations that don't need intermediate storage. Granted, ladder has the CPT instruction. Another advantage is branching control and comparisons. IF (A>B) THEN do_this ELSE do_that END_IF requires only one comparison. In ladder two comparison would be required. GRT A B and LEQ A B.
  11. 208 V Heating Elements

    I recommend an upstream contactor, with the upstream contactor hardwired in with the over temperature protection device (required for FM approval). A shunt-trip breaker can be used instead, but that usually costs a lot more. SSRs nearly always fail in the ON state. That means runaway heating when one does fail. The upstream contactor is usually switched on/off when the SSR is off so that it is not switching load but it still needs to be rated to switch the full load current. With the upstream contactor you can switch just one leg to control the flow of heating current.
  12. wire labeling question

    Are you planning on building lots of panels, or is this an isolated build and you might not build another for a long time? How large is the panel? If you are going to build lots of them then invest in a Brady TLS2200. I use the TLS2200 and it is a sweet labeler. They aren't cheap but well worth it if you are doing lots of panels or large panels. Brady has some other less expensive products that might be worth the cost if building a couple of panels. Check the website. Panduit also makes a hand held labeler. If you are establishing a panel building shop then I suggest both a desktop wire label printer and computer software and a hand-held printer. http://www.bradyid.com/ http://www.panduit.com If its a one panel build for yourself and its not a large panel then I suggest you buy a roll of heat shrink wire markers and neatly hand letter them with a fine point permanent marker. Its not worth the expense for a single panel unless you have deep pockets. Or talk to a panel builder who has a label printer and see if he will print them for you for a fee. I've got one system here where the control builder printed the numbers on plain paper, cut them into strips and stuffed the strips and wire into short pieces of clear heat shrink tubing. It was probably labor intensive, but the panel is 20+ years old and all the labels are still there and legible.
  13. Since 2647 * .07324 = 193.86628 and the value stored at N56:614 should then be 194 but the display shows 204 its quite clear that some asynchronicity exists somewhere between the BTR update (as well as possibly with the display update on RSLogix). The best solution is to buffer the value as Bernie and others have suggested. If your not convinced and you still think that the GRT instruction doesn't work like it should (it does, I just tested it on a PCL/5 to make sure) you can prove this to yourself if you modify the code as follows. First off you are using a floating point multiply by .07324 so if N10:7 is less than 7 then N56:614 is going to be zero with the way the PLC/5 rounds. So there isn't any difference in the answer when comparing to see if N10:7 is greater than zero, greater than or equal to zero, or greater than 1. So all you really need to do is a negative check, and thats easy. If bit N10:7/15 is set then the value is negative. The logic is simple and there is no mystery to it. Now if a multiply still occurs then it must be because an asynchronous update of N10:7 is occuring at just the right time. One caveat, this will execute quite a bit faster so the frequency of an an asynchronous update occurring at the right instant will be less, but without buffering it is still possible. Edit: Heres another thought... when you don't do the multiply then no update of the value is occuring at all, ie, your value isn't getting zeroed when when maybe it should be. In that case you could just do an unconditional multiply and then zero the result if its negative. Clearing after the fact has the net effect of using N56:614 as both the buffer and the result. SOR MUL N10:7 .07324 N56:614 EOR SOR XIC N10:7/16 CLR N10:7 EOR
  14. rsview32 datalogging

    See technote 39707 in AB Knowledgebase at http://www.rockwellautomation.com/knowledgebase/
  15. Wich is the best inverter brand?

    I love the ABB drives... But I'm going to go with 504bloke, its the one that has the best support in your area and thats going to require some legwork on your part. The best inverter in the world is worthless to you if you can't get it and/or there is no support in your area.
  16. If you use a subroutine again with conditional RETurns then you can pretty easily set it up to always use the first available slot and then return. If it is any consolation, one plus to brute force is that someone else can come along and pretty easily decipher what you were intending. That tends to minimize 3:00 am phone calls from Bubba. Its a little more work for the programmer, but the PLC often executes brute force repetitive rungs better than loops. Given the chance however, I myself would still prefer to use a loop and indirect addressing. Unfortunately AB seems to have an obsessive/compulsive need to dumb down its bricks in ways that make little sense and make life difficult for their customers.
  17. Rockwell and C++

    There is nothing subjective at all about that statement. It is an honest objective undeniable hard fact.
  18. With only 25 entries a brute force comparison against all 25 will take less system overhead and time than any kind of indexed search. Using cut and paste you can probably program it all in under five minutes. You can use a subroutine and RETurn when found so that you only check until a match is found. A091409FINDSTRING.pdf
  19. Tank level program

    Even though this is an exercise, in a real world application a second type sensor would be used if there were machinery protection or environmental concerns about the pump running dry in the event of a failure. One common way is to monitor the load on the pump motor. Once the tank is empty the pump motor load will drop dramatically because it is no longer doing any work, ie, it is not moving any fluid. In fact, there are sensors on the market made specifically for this purpose. Something to keep in mind when you encounter an actual application.
  20. Online Edits failure

    Mickey, I wonder if its related to technote 32963 and the CIP configuration? Here is another thread with a similar issue where the technote wasn't much help. To the OP, please let us know, it might be really helpful to a lot of people.
  21. How does multiplying X by 1/N stack up against dividing by N when both X and N are integers since 1/N forces a floating point calculation? I'm not a guru on the inner tickings of the processor (I promptly forgot most of the processor design lectures because I was never the least bit interested in that aspect of EE) however I suspect some FP processors might do it pretty dang fast. But would the FP operation be faster than integer division?
  22. Design the Logic

    Many PLCs have a high speed counter (HSC) input which will give you the frequency of input pulses. Check your PLC manual to see how to use HSC functions. Since you are in the AB forum I'll assume that you have an AB PLC. You can get AB manuals at http://literature.rockwellautomation.com Which model of PLC are you using?
  23. X * X will execute considerably faster (as much as 20x faster) than X**2.
  24. You can use the DH+ port of you SLC5/04 to connect to a 1756DHRIO card in a four slot ControlLogix chassis. In the same ControlLogix chassis put a 1756-CNB control net card. This will function as a bridge between DH+ and CNET. No CLX processor or Logix5K will be required. I'll assume you have Networx for Cnet.
  25. Don't set up the NET-ENI as part of the CLX IO configuration. Instead, you need to program a message instruction to the NET-ENI on a rung as part of your CLX program. In the CLX message configuration designate B3:0 as your source word and make it 1 element long. Your destination tag INT will then contain all the bits in B3:0. Refer to technote 24269 at AB's knowldedgebase at http://www.rockwellautomation.com/knowledgebase/ for an example of how to set this up. It might seem daunting at first but its actually pretty straight forward and not difficult to do. Once you've done one you're a pro.