With real number capability and transcendental functions one could incorporate a sunrise/sunset algorithm in the PLC to turn off or on lights in the morning or evening without having to use a photocell or pre set time clock.

PLC - Real Math

Eugene Kowch | P.I.D. Consultants Inc

Programmable Logic Controller
---- Real Math ----
By Eugene Kowch, P.I.D. Consultants Inc

With real number capability and transcendental functions one could incorporate a sunrise/sunset algorithm in the PLC to turn off or on lights in the morning or evening without having to use a photocell or pre set time clock.


Programmable logic controllers (PLCs) have the capability of working with real numbers. A real number, in mathematics, is a quantity that can be expressed as an infinite decimal expansion.  In other words, very large numbers or very small numbers can be expressed as real numbers using an exponential notation. For example; 5.3 x 106 or 5.3E6 is a real number representation for 5.3 million ( 5,300,000 ).

These real numbers are in the IEEE 32-bit floating point format when stored in the PLC.

They occupy two consecutive word registers regardless of how big or small the number may be. If you view the register of a stored real number it would be very difficult to decipher. Just like the other number types; binary, hex or even BCD, you must keep track of real number registers, so they can be read by their proper numerical functions.

The typical numerical functions are; add, subtract, multiply and divide. The PLC have special numerical functions to complement its real number capability. The transcendental functions include the trigonometric sine, cosine, and tangent and also their inverses (arc sine, arc cosine, and arc tangent). The square root function is also grouped with these other functions. The square root function operates on the full range of positive real numbers. The transcendental math instructions operate on real numbers only, not binary, hex or BCD. The sine, cosine and tangent functions require numbers expressed in radians. You can work with angles expressed in degrees by first converting them to radians.

The following example takes the sine of 45 degrees. Since these transcendental functions operate only on real numbers, we do a LDR (load real) 45. The trig functions operate only in radians, so we must convert the degrees to radians by using the RADR function.

After using the SINR (Sine Real) instruction, the result must be stored in two word registers because the resultant is a 32-bit real number.

With real number capability and transcendental functions one could incorporate a sunrise/sunset algorithm in the PLC to turn off or on lights in the morning or evening without having to use a photocell or pre set time clock.


Comments (0)

This post does not have any comments. Be the first to leave a comment below.


Post A Comment

You must be logged in before you can post a comment. Login now.

Featured Product

Octava -4K UHD Video Over LAN Matrix Switch. Video Wall Processor

Octava -4K UHD Video Over LAN Matrix Switch. Video Wall Processor

The Octava PRO DSX is a simple to use, powerful video distribution solution designed to deliver HD video including 4k UHD from multiple sources to multiple displays. The PRO DSX also functions as a Video Wall processor to create n x m video walls. The PRO DSX delivers HD video over standard CATx LAN cables allowing for simple integration in virtually any infrastructure. The PRO DSX was specifically designed for ease of use for residential installations and engineered for scalability to accommodate large video distribution systems such as education, corporate , and hospitality applications. Easy to configure and customize for your video system - Build virtually any size video matrix switch system. The Pro DSX is a scalable platform enabling easy system growth. Simply add PRO DSX TX for each video sources required and a PRO DSX-RX per display. Video Wall Support- The PRO DSX features a built-in video wall processor that enables you to create custom video walls.