TConnolly

MrPLC Member
  • Content count

    934
  • Joined

  • Last visited

Everything posted by TConnolly

  1. File Name: TRUNCATE IEEE754 FLOAT File Submitter: Alaric File Submitted: 7 Feb 2008 File Category: PLC Sample Code Sometimes is necessary to truncate (remove the fraction) or round a floating point number that is outside the range of -32678 to +32767 - making it impossible to use a MOV to an integer to make the conversion. This is a program I worte that shows how to perform a truncation directly on the floating point number by copyng the 32 bit pattern of the float and then determining which bits of the mantissa to keep and clearing all the rest. It includes three subroutines two of which show two different methods of truncating the float and a third which rounds the float to the nearest whole float. An understanding of the IEEE-754 float format is helpful in understanding how this program works but its not necessary to use it. Click here to download this file
  2. Inputs are scanned and copied into a location in memory called the input image table. While the program is scanned the PLC uses the input image table in memory. It doesn't go back out to the inputs, it goes to the table in memory. As it solves the rungs it writes the result back to memory. Bits that are addressed to an ouput are written to a memory location called an output image table. If an -] [- or -]\[- instruction addresses an output the PLC looks in memory, it doesn't look at the physical outputs. So if a 1 is written into memory location Q1, then a 1 will be there when Q1 is read later on in the program scan. After the end of the program the output image table in memory is copied to the physical outputs. Be aware that not all PLCs use synchronous IO updates. Some PLCs will do periodic IO updates, which means that the image table of the IO in memory can change in the middle of a scan.
  3. Let me add my voice to using a delta motion controller as well. However, for just two axes the RMC 70 may be a more economical approach. http://www.deltamotion.com/products/motion/rmc70/ I've been using these for several years now and they are super easy to set up and program. We synchronize six axis to better than .01 mm.
  4. Ignition - any review?

    I've been using Ignition for about a year now and have been very pleased with it. There were several tricks that I picked up by attending the training courses but the new Inductive University is an awesome tool. There are also a lot of youtube videos out there. We began looking at Ignition due to the then pending retirement of WinXP operating systems. Corporate IT policy called for the replacement of all XP machines with Win7-64 by year end last year, however the HMI software we were using was 32 bit and would not run on Win7-64. The manufacturer had no plans to move the _____32 product line forward. We had deployed six HMI station using the manufacturer's next generation of HMI software but there were several substantial differences and we found the software to be a lot more unstable and difficult to work. (Can I just say it was rubbish and that they broke a good product when they created the new version?) I had heard of Ignition and seen it discussed on various forums so we checked it out. We downloaded the software and pretty much developed most of our first project in trial mode with a Dell laptop computer for a server. Now we are running about twenty five full time clients and launching more. We've also developed a number of additional clients that are tools for reporting and supervisor overviews. We are preparing to deploy a backup gateway server. Inductive Automation's tech support is fantastic. As a price comparison point, I recently received the quote for renewal of our annual web only tech support package from the HMI software supplier we have been using. The price for the web only tech support for one year only was higher than the purchase price of the Ignition Works package. We won't be renewing.
  5. Many hydraulic proportional valves need a high frequency dither on the valve driver current. I strongly suggest you check with the valve manufacturer's offerings. Most have amplifiers for their valves.
  6. Solid state IO modules have leakage currents. If the output is unwired or wired to an open circuit or very high impedance device then you may measure line voltage at the terminal even when the output is off. The manual for this module states that it has a 2.25mA leakage current when the output is off, which can be enough to marginally illuminate low power indicators like LEDs and even enough to hold in a mini din rail type relay. A high impedance digital multimeter will register line voltage when the output is off unless something like a contactor or solenoid coil offers a drain path for the leakage current. If you do not have the manual which discuses this then go to the literature library at the AB website and search for your part number. The manual will also link to this document which I recommend you download and read.
  7. energy management

    You can get a commercial TED system including the software and the hardware for considerably less money than you can set up your own. We're talking between $800 and $1500US. You can't touch it for anywhere near that low with a piecemeal system.
  8. best way to program a ripple start

    A sequencer (AB SQO) is a nice generic tool to do what you want. The sequencer can be any length and you can set up the source words to accomplish any sequence of start up you desire. Advance the sequencer with a timer to move the next word from the source array to the destination word. The disadvantage of the sequencer is that Otis might call you at 3:00 AM because he is looking at the program and doesn't have a clue how the motors are being switched on when the real problem is something else. This example starts the motors in the order 10, 9, 8, 7, 6, 5, 1, 2, 3, 4.
  9. New Forum look !

    Just logged on with my new laptop. For a second I thought it must be something different with my new gear. Nice new crisp look Chris.
  10. The formula for at horizontal flat ended tank is V = l * (pi*r^2/2 - r^2*arcsin(1-h/r) - (r-h)*sqrt(h(2r-h))) where V is volume, l is the interior horizontal length of the tank cylinder r is the interior tank radius, h is the height of fluid in the tank as measured from the bottom of the horizontal cylindrical tank interior and must be less than 2*r. Precalculate pi*r^2/2 and r^2 and and 2r and supply them to the equation as constants, especially since the ML1500 has limited math abilities. If this is a situation involving commerce then the simple tank volume equation may not be adequate because no tank is perfect. In this case you'll need a dip table calibrated specifically to the tank to satisfy metering regulations.
  11. I suggest you use a load cell under the tank. If the water level in the tank is always constant then a load cell will tell you how much of that mass is salt. Load cells are a common solution (pun intended) to tricky tank contents control problems and can be less expensive than some other measurement technologies.
  12. You will all be happy to know that Harrison wrote a really well designed program and I gave him an A. edit - j/k. I know Harrison and had to rib him.
  13. embedded c versus PLC (fun topic)

    I've done both. Would you care to guess which controllers eventually got removed and replaced by the other? Would you care to guess which one had the nicer HMI and better datalogging? Use the tools that are best suited for the job. The only justification for an embedded controller now is something that is massed produced where low cost is required and the application does not change. That, and government contracts where the justification is reversed and the contractor wants high billability.
  14. Arrays

    Lets say you have a temperature setpoint profile for an oven that has 20 ramp/soak times and 20 setpoints. You might store that in a 2D array [2][20] with one column for the times and the other for the setpoints. Now lets say you wanted to store 10 different setpoint profiles in memory. Here you could use a 3D array [10][2][20]. If you still have a hard time picturing it then go back to the fact that all the memory in a computer is just a 1-D array. Anything higher is just a mathematical form for accessing a 1-D memory address. Lets say that MyArray is a 10x10x10 3D array. We have defined it as a 3-D array but in the computer MyArray is a chunk of contiguous 1-D memory with 1000 words in it. If in our program, we want to access address MyArray[5][3][7] then the processor will compute the address as 7 + (3*10) + (5*100), or MyArray[537], and go fetch that address. Do you think you could construct an array in a PLC/5 that is addressed with three dimensions using its memory file architecture? The answer is yes, it wouldn't be as easy as a controllogix makes it, but its not really hard either. Now, are you ready for a real mind bender? Assume that you have 5 different ovens. You could use a 4-D array [5][10][2][20] to keep ten sets of profiles for each of the five ovens. I don't know of a PLC compiler that supports a 4-D (or more) array but other computer programming languages can support 4-D, 5-D,or even higher.
  15. RSView 32 Expression Problems

    List only the tagname. Tagname should be an analog integer. When the tag changes value the event triggers.
  16. Cyclic trigger

    Create a free running timer of your own. TON FreeRunningTimer 2147483647 0 OTU FreeRunningTimer.ACC.30 Making the preset 2147483647 and unconditionally unlatching bit 30 of the timer ACC guarantees that the timer will never time out, it will run for as long as the PLC program runs. Each bit of the timer toggles at a rate equal to 2^postion*.001 seconds. FreeRunningTimer.ACC.0 toggles every .001 seconds. ACC.1 is .002 ACC.2 is .004 ACC.3 is .008 ACC.4 is .016 ACC.5 is .032 ACC.6 is .064 ACC.7 is .128 ACC.8 is .256 ACC.9 is .512 ACC.10 is 1.024 ACC.11 is 2.045 and so on. FreeRunningTimer.ACC.7 or FreeRunningTimer.ACC.8 would meet the criteria you have listed.
  17. RSView 32 Expression Problems

    Try using events instead. Define an analog memory tag, lets call it timetag1.Now define an event that uses the tag in the PLC for the count. The event will occur whenever this tag changes value. The action expression for this event will be to zero timetag1, timetag1=0.Now define an event that uses the everysecond system tag. Use this event to increment timetag1. timetag1 = timetag1+1.When timetag1==300 you have gone five minutes without producing a part. You can use timetag1==300 as another event to run a macro.Use timetag1>300 or timetag1<300 as a visibility animation expression for something on a display, as part of an if statement in another expressionYou can create a multi-state string display with the expression if timetag1<300 then "ON" Else "OFFYou can configure an alarm for timetag1.
  18. Apply touch animation to the object.
  19. Another very simple way is to use a counter. Your flip flop bit is the least significant bit of the counter accumulator: C5:0.ACC/0. When the value is odd bit ACC/0 is on. When the value is even bit ACC/0 is off. Notice how the LSB toggles in binary. 0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 Don't concern yourself with the preset, just leave it 0. Don't use the DN bit either. The counter will continue to function as a flip flop even when it rolls over. It does not ever need to be reset. It doesn't matter what the value of ACC is either, only whether it is even or odd. One difference to be concerned about is that a counter is retentive.
  20. RSView32 Works 100k

    Nowhere. RSView32 is a licensed product that requires activation. Activation is accomplished with an internet connection to Rockwell servers that verify you are using a licensed copy. You may purchase a licensed version from your nearest Rockwell/Allen Bradley distributor.
  21. effect of branching

    Just so you know, it is the number .1 that is giving you the problem. Any number that is 1/10, 1/100th, 1/1000th, etc, or any multiple that is not equal to 1/2, cannot be represented exactly, eg .2, .3, .4. 6. , etc. However, 1/2, 1/4, 1/8, 1/16, etc. and any multiples of them can be represented exactly. This is because each bit in the mantissa represents 1/(2^n) where n is the bit position in the mantissa.
  22. NFPA 79 13.2.4.1 The color ORANGE shall be used to identify ungrounded conductors that remain energized when the main supply circuit disconnecting means is in the off position. This color identification shall be strictly reserved for this application only. If he brings 120V from the MCC bucket to a control panel then those wires are still energized even when the control panel supply is off. This isn't a new code requirement, however a long time ago yellow or orange was allowed, but yellow had been depricated to eliminate confusing with the IEC yellow/green ground standard. The requirement doesn't apply to low voltage.
  23. And to meet code, your wires to the main control panel are to be orange. The 24V interposing relay placed in the bucket is safer and simpler.
  24. Put the interposing relay in the bucket and bring 24VDC from the PLC panel. Do not take the bucket 120 voltage back to the PLC panel. The 120 from the bucket control transformer stays only in the bucket.
  25. Cube Root

    Swap it out for a ControlLogix PLC. OK, seriously, A cube root is the same thing X^(1/3). Unfortunately the 984LL exponent function EMTH(34) only support integer exponents. If you are computing the cube root of an integer and the integer has a limited range then use a table. Otherwise read the Wikipeida article on cube root - it has a few methods that you might be able to convert to 984LL, but its not going to be easy. Can you shove it off to your HMI, have the HMI computer X^.3333333 and then read it back? Good luck.