paxforme.blogg.se

Gx works 2 read only
Gx works 2 read only





We could just as easily do scientific notation in hexadecimal (123.ABC x 16 2) or even binary ( 1.0101 x 2 2, this binary one becomes important later on).

gx works 2 read only gx works 2 read only

(Just a heads up, in the PLC you may be able to use scientific notation but in a different form like 1.23456E2 which is the same as a first example.) The number 10 here means we're dealing in decimal. That little -2 indicates we move the decimal point in the opposite direction to the left. That 10 with a little 2 above is telling us to move the decimal two spaces to the right to get the real number. Oh yeah? What's scientific notation? Scientific notation represents numbers as a base number and an exponent. Sinking Deeper into Floating Point Numbersįloating point is basically a representation of scientific notation. If you're still staying afloat in all these concepts and want to understand more then read on. The resulting ladder logic would look like below. Then we use the special DIVR instruction to divide it with a real number and get our reading. So the BTOR instruction is used to convert the decimal number to a real number format. This is easily done with real numbers but our reading is in decimal. So essentially to get our real world reading we would need to divide 4095 by 16.38 (4095 reading / 250 max pressure). In our PLC the max number is represented by 4095 (FFF in hex). Our PLC is reading a pressure transducer input whose max reading is 250 psi. In this case we're using an Automation Direct DL250 PLC which conveniently has the ability to handle real numbers (floating point). Real Numbers in the Real WorldĪt this point let's deal with an example. The trick is to get some sort of format where the decimal point can "float" around the number. This might be all we need but it can get a bit tricky when it comes to math where we want to retain a remainder. For instance, a number like 2300 in a word could be taken to represent 23.00 if the decimal point is "implied" to be in the 1/100th place. We'd have to use some tricks to maybe imply a decimal point. Before, a word could only represent an integer, that is, a whole number.

gx works 2 read only

It allows for such large numbers that we can even keep track of the US national debt.įloating point gives us an easy way to deal with fractions. Up until this point the range of numbers we were able to represent with a double word would be from 0 to 4,294,967,295. Floating point numbers (also known as 'real numbers') give a certain freedom in being able to represent both very large and very small numbers in the confines of a 32 bit word (that's a double word in our PLCs).







Gx works 2 read only