How-to
Scale MicroLogix analog inputs to Pascals over DF1 reads
Short answer
Stage the analog word into an N7 integer with a MOV and read that register over DF1; the driver does not serve the physical input word. Scale counts to volts linearly, apply the gauge exponent in one place, and check two injected points, because 10 mV of voltage error moves the reading 2 to 4 percent.
On this page
Read the vacuum channel in three staged steps: move the analog word (I:3.1 on that panel) into an integer register with a MOV, read that register over DF1, and run the gauge equation once, in one place. The DF1 driver serves data-table registers such as N7:0 and does not serve the physical input word, which is why the direct read failed. Scale the register's contents to volts with a two-point linear equation, then apply 10^(V-3.5) or 10^(1.667V-9.333): at 2.000 V those give 3.16E-02 Pa and 1.00E-06 Pa. Prove one plain read of N7:0 before touching a formula.
Why won't the DF1 driver read the analog word I:3.1? #
Because the driver serves data-table files, not the physical input image: a read of N7:0 returns a value while a read of I:3.1 returns nothing. Move the channel word into an integer with a MOV and point the HMI at that staged register instead.
The channel's value is a whole word addressed with the dot: I:3.0 for word 0 of that module's input data, I:3.1 for word 1. The slash form I:3/0 is a bit reference and returns one bit, never the analog value. Where the words land depends on the hardware: on a MicroLogix 1400 the embedded analog inputs occupy I:0.4 through I:0.7, and on the compact high-density analog input modules, input words 0 through 15 hold the input data for channels 0 through 15.
Prove the path before the math, with one read of a known integer from the driver's documented call pattern:
Dim value As String = SerialDF1forSLCMicroCom1.Read("N7:0")
Change N7:0 from the PLC and repeat the read; the returned text must follow. If the call errors or returns nothing, the fault is the communication layer, not scaling: the channel-configuration failure seen when a MicroLogix 1000 disappears from RSLinx after a channel change, or controller-to-controller differences like why DF1 reads work on an SLC 500 but not a PLC-5. Classify the symptom before changing the project - the discipline of a fishbone cause becoming the answer to Why #1 in a 5-why: a blank value is a path fault, an integer that tracks the signal is a math fault.
Which register should the HMI read instead? #
An integer element of the default integer file, with the PLC moving the channel word into it every scan. Integer file N7 is created 256 words long in the MicroLogix data table, so elements such as N7:0 and N7:1 are available unless the program already uses them; pick ones nothing else touches.
- Identify the channel's word address - I:3.1 in the vacuum panel - and assign one integer per gauge channel.
- Add an unconditional MOV with the word as source and the integer as destination, so the register mirrors the module every scan.
- Point the HMI reads at the staged integers: N7:0 for the first gauge, N7:1 for the second.
- Vary the signal at the terminals and confirm the staged integers follow in the data table.
- Repeat the single driver read against the staged register, and only then bind display controls to it.
Test the write path separately, after the read works, using a spare integer the logic never touches: SerialDF1forSLCMicroCom1.Write("N7:10", "99"), then read N7:10 and expect 99. One safety note: test writes go only to a spare internal register - never to the input image and never to an output address, where a written value can move the machine.
How do I scale the raw counts to volts and Pascals? #
Linearly, then exponentially: convert counts to volts with a two-point equation, then feed volts to 10^(V-3.5) or 10^(1.667V-9.333). With a 0-10 V range and raw counts 0-32760 (example endpoints), 6552 counts is 2.000 V, which is 3.16E-02 Pa on the first gauge.
First confirm what the staged register holds: raw counts, or data the module already scaled. The channel configuration decides. The gauge formulas take volts, and counts fed to the exponent produce a number that looks like pressure and is not.
Voltage = Vmin + (Raw - RawMin) * (Vmax - Vmin) / (RawMax - RawMin)
Worked example, on the example endpoints of 0.000 to 10.000 V over 0 to 32760 counts, reading 6552:
Voltage = 0.000 + (6552 - 0) * (10.000 - 0.000) / (32760 - 0) = 65520 / 32760 = 2.000 V
Then the gauge equations, which are not interchangeable:
Gauge 1: P = 10^(2.000 - 3.5) = 10^(-1.5) = 3.16E-02 Pa
Gauge 2: P = 10^(1.667 * 2.000 - 9.333) = 10^(-5.999) = 1.00E-06 Pa
The same 2.000 V gives answers four and a half decades apart, because the constants encode each gauge's own calibration.
Where should the Pascals equation run? #
In the PLC, as the default: one scaling chain with one owner, and every consumer - control logic, alarms, trends, extra screens - reads the same finished register. Keep the equation in the HMI only when the value is presentation for one screen and nothing else.
In the PLC, the chain is MOV to N7, convert to a floating-point value in volts, apply the exponent with the controller's floating-point power math, and store Pascals in a float register the HMI reads. You can then watch every intermediate online - raw word, volts, Pascals - which is what you need on a bad reading.
If the HMI owns the equation, convert the driver's returned string to a floating-point number before any math, use the same constants, and run the conversion on a timer. Never compute the pressure in both places: two hand-scalings drift, and one sensor ends up with two pressures.
How do I verify the scaling with two known points? #
Inject two known voltages at the channel terminals and compare the displayed Pascals against the formulas: 0.000 V must read 3.16E-04 Pa on gauge 1 and 4.64E-10 Pa on gauge 2, and 2.000 V must read 3.16E-02 Pa and 1.00E-06 Pa.
| Injected voltage | Gauge 1: 10^(V-3.5) | Gauge 2: 10^(1.667V-9.333) |
|---|---|---|
| 0.000 V | 3.16E-04 Pa | 4.64E-10 Pa |
| 1.000 V | 3.16E-03 Pa | 2.16E-08 Pa |
| 2.000 V | 3.16E-02 Pa | 1.00E-06 Pa |
| 5.000 V | 3.16E+01 Pa | 1.00E-01 Pa |
- Inject the first point and read the staged integer: on the example endpoints, 0.000 V is 0 counts and 2.000 V is 6552.
- Read the display: the Pascals must match the row for that voltage on that gauge.
- Counts right, Pascals wrong: the fault is the equation, its constants, or the format - not the driver and not the wiring.
- Counts wrong at both points: the assumed endpoints or the wiring is at fault, so fix the linear step before touching the exponent.
Exponentiation punishes small voltage errors: 10 mV moves gauge 1 by 2.3 percent and gauge 2 by 3.9 percent. A reading off by a full decade means wrong endpoints or wrong constants, not noise.
What number format shows 3.55E-03? #
A scientific numeric format on a label-style display: the format string 0.00E+00 renders 0.00355 as 3.55E-03, two decimals in the mantissa and a signed two-digit exponent. Fixed-decimal formats cannot span the decades these gauges cover.
A meter-style control with two fixed decimals turns 3.16E-04 Pa into 0.00, so bind a text or label control and set its numeric format to 0.00E+00. Formatting changes presentation only: it will not repair a read that fails or create a value the scaling never produced.
Questions asked
Do the raw endpoints 0 to 32760 apply to every MicroLogix analog channel?
No. Those numbers are the worked example's inputs for a 0 to 10 V configuration. The endpoints for a given channel come from its configured range in the module setup and the module documentation; a channel configured for a different span produces different counts at the same voltage. Read the configured range for the exact channel, then use those endpoints in the linear conversion before any exponent math.
Why do the two gauges show different pressures at the same voltage?
Because each formula encodes one gauge's own voltage-to-pressure curve: the constant 3.5 in the first and the constants 1.667 and 9.333 in the second come from each gauge's calibration and are not interchangeable. At 2.000 V the first gauge reads 3.16E-02 Pa and the second 1.00E-06 Pa, four and a half decades apart, so each display must run its own equation on its own channel.
Can I test the write path against the input register?
No. The input image is produced by the module, so a test write there proves nothing about a working write. Write to a spare integer the program never uses, read it back, and confirm the same number returns - for example write 99 to N7:10 and read N7:10. Test writes only after the read path already works, and never to an output address.
Why does the display show 0.00 instead of a small vacuum value?
Because a fixed-decimal control rounds to its last shown digit: 3.16E-04 Pa formatted with two decimals is 0.00. These gauges cover several decades of Pascals, so use a label or text display with a scientific format string such as 0.00E+00, which shows that value as 3.16E-04. Formatting changes presentation only and cannot create a value the scaling never delivered.