TConnolly

MrPLC Member
  • Content count

    934
  • Joined

  • Last visited

Everything posted by TConnolly

  1. Power Loss Notification

    Sola makes a smallish din rail mounted UPS that is ideal for that.
  2. Unless you are using the bottom dwelling Micrologix 1000, consider using the Micrologix HSC function file (look under +Controller -Function files in the project tree in Logix500). Use the HSC to count pulses and an STI to compute flow rate. Your flowmeter will have a gallons/pulse specification. Multiply that by the number of pulses to find how much fluid has passed. Example: My flow meter is 1 cu. in/pulse. Since there are 231 cu. inches in a gallon then each pulse = 1/231 of a gallon. So by multiplying the number of pulses in one second by 1/231 I can get my flow in gallons per second. To convert to gallons per minute I then multiply by 60. By combining terms 1/231 and 60 I get 60/231. If I configure a 1 second STI then in the STI subroutine I multiply the HSC accumulator by .25974 to get GPM and then reset the HSC accumulator. If your pulses are coming at the PLC faster than two times the PLC scan time then the HSC, which is a hardware counter instead of a software counter, has the advantage that you don't have to worry about missed pulses. The STI will run at exactly the interval you specify so you don't have to worry about the scan time considerations of a software timer.
  3. As soon as you said drives and device net I could picture a disaster. The local residential electricians were in way over their head. The real moron in the story is the owner/boss for the residential electricians - he should have known they were in way over his head and told the customer so. Even some electricians that install the typical canned home automation systems will get in over their heads on a control system. I have a panel builder friend who decided to automate his new home he was having built with a ControlLogix and Panelviews. He built a big control panel, put it in his basement and home ran everything to it. When the city building inspector came to inspect the house he opened the panel doors, saw what was inside, and threw up his hands and said "I give up." He passed it solely because the work was neat, but he had no idea what he was looking at.
  4. The untold story is still untold. Bob, how long are you going to keep us waiting?
  5. Compactlogix Scan Time

    Consider using the Logix 5000 Task Monitor under the tools menu in RSLoigx5000. It will give you a lot more information about your tasks and what is using processor resources and how much. If you really need to know how long it is between start of rung 0 to next start of rung 0 then use a periodic task. Don't be afraid of using one in lieu of the continuous task. Some programs actually can actually gain a speed benefit by deleting the main continuous task and running everything in a periodic task. The same program that takes four mS to run in a continuous task might execute is less than 1mS in a periodic task since it is not subject to interruption to the degree the continuous task is. If your program can be taken offline you might want to play around with it. Check the task monitor to see how fast your continuous task is. Now change the task to a periodic task with a similar period. You should see in the task monitor that the program is executing faster now and CPU has gone down. Now increase the task rate for the task. You should be able to get more scans per second for the program that way.
  6. Mower Drive Belt Test

    A micrologix 1000 is a bottom dweller. Also the free software works only with the 10 point version. I suggest that a Micrologix 1100 would be a better choice. The free AB software will still program it, but you can add up to four expansion modules, including analog IO.
  7. The number has even more digits after the decimal than just the five shown by the Logix500 software. The number of decimal places is dictated by the IEEE 754 floating point number format used to represent real numbers in binary. The number will be represented as accurately as possible within a 32 bit frame. You can multiply the number by 100 and store it in and integer or long integer and infer the two decimal places. However, IIRC, your T/C module is capable of returning the temperature in .1 degree units, so the two decimal point resolution is basically meaningless. You might think you are seeing higher resolution but you are not. For example, the number .2 cannot be represented exactly in a computer. If can be .1999999999999999999 but not .20. The software that displays the number on your computer screen contains sophisticated algorithms to recognize this shortcoming and display .2, but in memory you still have .1999999999999999999. Logix500 software dutifully reports what is in memory, so you may be under the illusion that you have higher resolution. This is where your judgment as a programmer to recognize meaningful resolution comes in. If you set the HMI to display the correct amount of decimal places (in this case just 1) it can reflect the fact that you only have .1 degree resolution. For simple one operand addition the ADD instruction is much more efficient than the CPT instruction. It executes considerably faster - and unlike the CPT instruction it shows what is in each register, which can be handy sometimes during troubleshooting and debugging. Use the CPT instruction when you have multiple operations ((A-B)/(C-D)) to do - CPT is more efficient then because it doesn't have to do any intermediate writes to memory.
  8. And if you don't want it to round the result then use a CPT instruction with the expression TRN(MyRealTag*.001) and a DINT tag as the destination.
  9. wire duct cutters

    http://www.amazon.co...66&sr=8-1-spell Its what I use for both din rail and for duct.
  10. Without seeing the form my first guess is that your UserForm_Initialized code should be Private Sub UserForm_Initialize() StartMonitor PPRbox.Text = value1.value Diabox.Text = value2.value GBRbox.Text = value3.value StopMonitor End Sub Also, I'm not so sure you have the tag object variables value1, etc. declared correctly, but I'm not sure exactly what you are trying to accomplish so I can't say for sure. I would declare it as RSVIew32.Tag, not just tag, just to make sure you are explicitly defining it at the right kind of tag object.
  11. Micrologix 1100 question

    Two possibilities that come to mind: 1) By chance was the timer in a conditional subroutine? If the subroutine logic is not being called then the timer instruction won't execute. 2)The same timer address is used in two different TON instructions in different parts of the program. A timer can be duplicated in the logic and you won't get any warnings about it.
  12. order of operation for 5000

    Double click on the rung number. This will open the mnemonic editor. Instructions will execute in the order shown in the mnemonic editor. The BST instruction marks the beginning of a branch. NXB moves execution to the next branch, BND marks the end of a branch. All of the other instructions should be self evident.
  13. ST still cycles just the same as ladder does. If fact, if you were to write a program that did not have a cyclic scan your processor would fault. So it is necessary to wrap your head around it. Don't worry, you'll get it. I came to the PLC world as a C programmer. Think of OTU and OTL are IF/THEN instructions while OTE is an IF/THEN/ELSE instruction. OTU is If (Rung_Condition == 1) then TagName = 0; OTL is If (Rung_Condition == 1) then TagName = 1; OTE is IF (Rung_Condition == 1) Then TagName = 1 Else TagName = 0 Hopefully that will help. The rung can be unconditional - that is, an OTU on a rung with no conditional instructions on it will unconditioanlly write a 0 to a boolean tag.
  14. Bob, I wouldn't recommend using the 1771 control net scanner card at this point. It is marked as silver series and is slated for discontinuance in 2012. See http://www.ab.com/silver/io/1771.html My guess is there isn't enough demand. The DHRIO upgrade path is the one that I've seen most often and none of those components have been designated as silver series. Also see this thread for a similar discussion: http://www.plctalk.net/qanda/showthread.php?t=61937
  15. If you are using RSLogix5 or RSLogix 500, right click in any blank area of the ladder display. Select Properties. From there you can set your address display preferences. If you are using RSLogix5000 then addresses are tag based, meaning that there is no file:word/bit addressing scheme. Tags are created as needed on the fly and the necessary memory is allocated and structured when the tag is created. Where physical inputs and outputs are used the address is shown below the tag name. You can select any tag, right click, and click properties to view the tag properties. Or you can look up all the tags under controller tags or program tags in the project tree pane.
  16. ML1400 Two Integers to LONG

    Tim, swap the high and low words using three XOR statements A := A XOR B. B:= A XOR B A:= TagA XOR TagB. Then copy.
  17. "Anthropomorphic" Robot: What does it mean?

    Joking aside... IMO, the need for an anthropomorphic robot in an industrial environment is somewhat limited - the robot is a machine and it should fit the task. I read an article just a few days ago that mentioned that anthropomorphic robots are being used in Japan in one market to help elderly people shop. An accompanying photo showed an anthropomorphic robot accompanying an elderly woman in a store while carrying her selected merchandise in its arms. It was clear that a robotic shopping cart would have been better suited to the task, but in a service sector application the customer might be more comfortable with a human like assistant -vs- a motorized computerized shopping cart with a bug like pick arm attached, even though the robotic shopping cart is better suited for the task than a robot trying to carry a load of groceries in its human like arms. In an industrial setting however the focus should be on making the machine fit the job.
  18. M/L 1000 and analog

    I wanted to ask the same thing Tim. Since the replies were IMHBMAO actually good information I was left to wonder if Sammy was really inferring that the replies were NOT great and were stupid, or if he was meaning that the replies were great and the "NOT" was intended to negate the stupid smiley as some kind of obfuscated reverse compliment. Either way it didn't come across very well and probably deprived Sammy of additional answers by putting others off. I was put off when I first saw it I didn't have any desire to reply, but decided to wait and see what happened.
  19. The MicroLogix supports 32 bit integers. Is there a reason you can't use them? Create a new data file select the Long data type.
  20. I'm not sure how many of you have followed the flash mob craze, or even witnessed one, but some are fun to watch. Flash mobs are unannounced but organized events where a large number of people will suddenly do something extraordinary without advance warning. They can occur at malls, train stations, parks, just about anywhere you might find a large number of people congregated. The performance is done and then all the participants fade back into the crowd as if nothing had happened. A youtube search for "Flash Mob" will return a large number of video clips. Some are definitely lame, some are amazing and fun to watch. In this one unsuspecting shoppers eating in a mall food court are suddenly and out of the blue treated to performance of Handel's Messiah organized by a photographer and theatrical group. Whether you are religious or not, this is a treat. Enjoy.
  21. ML1400 lookup table

    If it is getting long and ugly then why not go with a brute force approach? If you cheat you can program 50 rungs, even 100 or 150, in less than two minutes (more later). It won't take very long to program and the execution time will be less time on average than a loop. By now you may have wasted more time that it would have taken to just program the 50 rungs (especially if you cheat). One thing you should do is place the lookup in a subroutine and use the RET instruction to return the subroutine once the corresponding entry in the table is found. There is no need to keep looking after you find the answer. You can also do a quick check on the first rung of the subroutine to find what half of the table to look in and jump ahead if it is in the last half of the table. If my statement that you can program 50 rungs in under two minutes got your attention, look in the attached zip file. There is a MSWord document on how to use MS Excel to create large numbers of similar rungs very quickly. I've been wanting to make a tutorial on this so I threw one together for this post. The example program is very simple, but its enough to convey the general idea. Using the method shown in the word document in the attached zip file, I started a stop watch and programmed 50 rungs into RSLogix500 in 1 minute 49 seconds. Then I added a rung to jump to the second half of the table if the variable was greater than the table's middle entry and deleted the RET instruction from the final rung because it was not necessary. The look up will have to do at most 26 comparisons. Granted, I've used the Excel cheat several times so I've gotten fast at it, but even the first time through you'll be surprised at how fast it is. Once you've done it once the next time will be a snap. There is sometimes a lot to be said for brute force methods, even though a For/Next loop is a good way to do this. For/Next loops can be elegant and they can save the experienced programmer some time and work. But a lot of programmers have difficulty with them and they completely confound maintenance tech Bubba on the graveyard shift. In the end the For/Next loop makes the program only a tiny bit smaller but it does not decrease the amount of work the processor will do, in fact it increases it. For some programmers loops ultimately mean more work and more time. But when you find yourself really struggling to get it to work and you consider how fast and easy it is to create 50 rungs in under two minutes using Excel then that For/Next loop is not only making more work for the processor, its making more work for you. A for/next loop will have to perform up to 100 comparisons to do the same work. (A binary search can be programmed with a nested loops to dramatically speed things up but those are a lot more involved and take a lot more time to program and really aren't worth the effort for a 50 element look up). You might want to see this thread http://www.plctalk.n...ead.php?t=53235 on another forum where I showed how to use Excel to solve a similar problem. Later on in the thread Ron Beaufort offers some really good advice. Fast Programming.zip
  22. Analog filter code

    After reading Paul's response, and having a little more time to think it over, I've got a simpler four rung implementation that does not use indirect addressing. Hopefully it is a little easier for the novice programmer to understand without the indirect addressing. It uses two queues, one ten element queue to select likely good readings from the laser, and one four element queue to compute a running average of the likely good readings over a twenty second period. The first rung provides a single scan timing pulse every 1/2 second.In the second rung the FFL instruction is used to load a ten element stack with new data every 1/2 second. (A FAL would have worked just as well here)On the third rung, once the stack is full (five seconds) then it is sorted in ascending order.On the fourth rung an element is selected from the sorted stack that is likely to be a good reading. I chose the second lowest for the example but any statistically significant element could be chosen. Choose the one that works best for your process. The selected element is stored into a four element averaging stack to provide a running average over 20 seconds. The second stack also uses the FFL instruction, coupled with the FFU instruction, to implement a first-in-first-out (FIFO) queue of the readings to compute the running average. The twenty second running average will update every five seconds. Finally the first stack is reset so that it will start from the beginning and load ten new data points. Note that upon start up the running average queue won't read right until the averaging FIFO queue is filled -it may be necessary to pre-initialize the queue or program the controls to not respond to the average until after the queue is filled. BUNKER.zip
  23. +1 on MSE. http://www.microsoft.com/security_essentials/
  24. Analog filter code

    Here is one way Peter's suggestion could be implemented. It is fairly simple and is just six rungs long. A timer triggers storing a data sample every half second. Then after ten samples are stored (5 seconds) the data is sorted, then averaged using only the five lowest values and ignoring the five highest values. If you actually want to average the five highest values instead of the five lowest then change the AVE instruction to start at #N11:6 instead of #N11:1. BUNKER.zip
  25. Wire for analog sensors

    +1 on Belden 8760. We use it almost exclusively.