-
Shawn Tierney commented on lesson Lesson 36: Download and Use AOIs 4 years ago
Good morning Jose.
When it comes to the period numbers ( .# ) those are the individual bits of the DINT they belong to.
Since the analog value “Local:3:O.Ch0Data” is a double integer (aka DINT,) it has 32 bits under it:
– Local:3:O.Ch0Data.00
– Local:3:O.Ch0Data.01
…
– Local:3:O.Ch0Data.30
– Local:3:O.Ch0Data.31Here's an exercise to see exactly what I mean:
– Create a new Double Integer named “MyDINT” in your controller tags.
– Now expand this double integer and notice under it you'll find bools .0 through .31, which are the 32 bits that make up the Double Integer
– Now create a new Integer called “MyINT”
– Now expand this integer and notice under it you'll find .0 through .15, or the 15 bits that make up the IntegerAs far as what bits would be on or off if you had a number of 3074, we cover how to make this conversion back in the prerequisite PLC Basics Second Edition course, and this is the bit pattern that would result:
1100 0000 0010
This equals:
1000 0000 0000 (2048)
+
0100 0000 0000 (1024)
+
0000 0000 0010 (2)Or put another way: 2048+1024+2 equals 3074.
So as you can see above, with a decimal value of 3074, you will have bits .01, .10 and .11 on.
Hope this helps,
Shawn Michael Tierney
Instructor at The Automation School