Productivity 2000: Can It Process Test Data in Real Time?

Brian Holt10 min read
AutomationDirectData AcquisitionTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

The described Productivity 2000 test station needs to detect excessive pressure change during a 45-minute test, so the P2-550 should make the immediate stop decision. Keep the existing Python regression on a separate computer unless the calculation is rewritten in PLC logic; the PLC must retain authority over the solenoids and test state.

Assign the P2-550 the immediate stop decision

A file logger and a real-time trip serve different purposes. Logging preserves a test record for later analysis; the PLC reads live input values and can act on them in its control logic. Writing samples to microSD does not by itself make those samples available to the control program for a pass/fail decision. Treat the PLC's live input path as the control path and the card as a record path.

Do not make the 45-minute regression the only way to stop a test when the requirement is to stop as soon as pressure changes too quickly. A full-run line fit averages behavior over its entire window. A brief rapid rise can be diluted by thousands of otherwise normal samples. The P2-550 should monitor the pressure-rate condition during the test and command the application's defined stop state; use regression for an overall trend or a separately defined acceptance check.

Symptom or quick fix Likely cause Correction
The program treats microSD logging as the only acquisition route. Persistent logging and live control data are being confused. Read the analog input values in PLC logic; retain card logging for records if needed.
A full-test fit passes even though pressure briefly changed too fast. The long regression window hides local behavior. Use a PLC rate check over a defined short window for the stop condition.
A Python result directly controls an output. The external computer has been placed in the control path. Have the PLC validate the result and own the solenoid outputs and test state.

Set the trip's direction explicitly: compare signed slope if only rising or falling pressure matters, or compare its magnitude if either direction must stop the test. Check that a simulated threshold crossing drives the PLC into the defined stop state before proceeding.

Set and verify the pressure sample interval

The reported one-point-per-second figure is a planning assumption, not a confirmed limit for the installed system. Sampling capability depends on the analog input hardware, its configured conversion and update behavior, and when the PLC program reads the value. A logic routine that executes faster than a channel updates may simply read the same conversion repeatedly.

  1. Record the catalog numbers and configuration of the pressure and thermocouple input modules. In the current product documentation, identify their conversion and update behavior and any channel filters that affect response.
  2. Choose a sampling interval that can resolve the fastest pressure change relevant to the trip. Confirm that the application can meet this interval while performing the rest of its control work.
  3. Record elapsed time with each sample, or verify the configured interval against a time reference. Use measured time if the interval varies; do not calculate a physical rate from sample count alone when timing is irregular.
  4. Record pressure and temperature against the same sample index or timestamp if the test analysis compares them.

Filtering can reduce noise, but it also delays a detected change. Set and validate the filter with the required trip response in mind. Do not adopt a sample rate solely because it matches an earlier logging setup. Check the recorded timestamps and values during a controlled test to prove the actual interval and input update rate.

Size the record buffer for a 45-minute test

At exactly one sample per second over 45 minutes, the record contains 2,700 samples per channel because 45 x 60 = 2,700. The actual total depends on the chosen interval, the number of pressure channels, whether temperature is included, and whether the program records both endpoints. Calculate the storage requirement from the installed test configuration:

samples_per_channel = test_duration_seconds / sample_interval_seconds
record_bytes = samples_per_channel * channel_count * bytes_per_value + timestamp_and_record_overhead

Use the actual storage type and program memory allocation when estimating bytes; the formula does not include array or record overhead unless you add it. If memory cannot hold the complete raw record, options include retaining only the values needed for a calculation, processing bounded windows, or streaming batches to a separate computer. Keep a raw record when the test needs later review or reanalysis.

A straight-line least-squares fit can be computed from running sums, so it does not require retaining every sample solely for that fit. That does not preserve the raw trace, however, and it does not support arbitrary post-test analysis. Decide whether the requirement is just a pass/fail value or also a complete dataset before choosing the buffer size.

Check the memory estimate against the actual PLC project allocation and run a full-duration capture while confirming that the sample count, timestamps, and final record are complete.

Match the trend calculation to the trip condition

For an overall straight-line fit, let t be elapsed time and p be pressure in engineering units. Accumulate the sample count and four sums as each sample arrives; then calculate the fitted pressure slope:

slope = (N * sum(t*p) - sum(t) * sum(p)) / (N * sum(t*t) - sum(t) * sum(t))

The result is pressure units per second when t is measured in seconds. Require at least two distinct timestamps and a nonzero denominator. If samples use a fixed interval, a sample index can represent time only when the interval is included in the conversion to pressure per second. If timing varies, use the measured timestamps in the sums.

For a continuously updated trip, calculate a local rate over a bounded recent window or compare pressure change against elapsed time over that window. A short window responds sooner but is more sensitive to sensor noise; a long window smooths noise but delays detection and can hide a fast transient. Set the window and any filtering from the process acceptance requirement, then verify response using representative pressure ramps and disturbances. Do not substitute a 45-minute fit for this local check.

Keep each pressure channel's rate separate unless the test specification defines a combined value. Set the threshold, units, comparison direction, and response to invalid input explicitly. If the PLC uses running sums, clear them at the start of each test and select numeric types that can hold the sums for the full test; validate the calculation against known input data and the existing Python output. Check that PLC and Python slopes agree within the test's accepted tolerance before using the calculation for production pass/fail.

Keep the PLC in charge of pass/fail

The fastest restore is to keep immediate trip logic in the P2-550 and remove an external Python response from the stop path. If the PLC can implement the required local rate check, it can act on the input without waiting for a network message or computer process. This is a temporary restore when the acceptance criterion still requires the existing full-data regression.

For the permanent design, choose between moving the required regression into PLC logic and retaining Python on a separate computer. A running-sum straight-line fit is a compact PLC option when the acceptance test only needs a slope and pass/fail. Keep Python external when its existing operations or data handling are required; communicate the inputs and result through a defined exchange, while the PLC continues to enforce pressure limits, timeouts, and the application's defined safe output state.

A computer-based analysis result can be delayed, lost, repeated, or stale. Define what the PLC does if the result does not arrive within the test's configured response time, and do not let a missing message leave the test running indefinitely. Check the result against a known test case, then prove the PLC's timeout behavior with the computer disconnected.

Connect the Python computer through a supervised Ethernet exchange

The proposed external-computer path uses Ethernet and the Productivity 2000 Custom Protocol over Ethernet. The existing Python script can run on a Raspberry Pi or another computer that supports the required connection. Confirm the protocol details and data representation for the installed PLC and programming environment in current AutomationDirect documentation before building the client.

  1. Define a project-specific message containing the test identity, sample count or batch sequence, elapsed time, pressure values, and temperature values needed by the analysis. Agree on units, numeric representation, and how the receiver detects a complete batch.
  2. Choose a supported transport and implement the message framing expected by the PLC protocol. TCP provides an ordered byte stream but requires the application to frame complete messages and manage connection loss. UDP preserves datagram boundaries but does not provide delivery or retransmission; the application must detect missing or repeated batches.
  3. Have the computer return a result with the matching test identity and sequence, plus an explicit completion or error state. The PLC should reject a result that belongs to a previous test or does not pass the project's validity checks.
  4. Define the PLC response to a lost connection, malformed message, delayed result, or computer restart. Keep the local PLC trip active during every communication failure.

Batching samples avoids making a separate exchange for each input update. Choose batch size from the buffer available and the response time the test can tolerate; there is no need to guess a packet layout or timing value before checking the documented protocol. Check a captured exchange in both directions and confirm the PLC accepts only a complete, current result.

Commission the complete pressure test

Commission in stages so the input, calculation, and output path each have a known result before running the device test unattended.

  1. With the process in a controlled commissioning state, apply known input values or a safe simulated pressure trace. Verify channel scaling, units, sample timing, and temperature alignment.
  2. Test rates below, at, and above the configured threshold in both relevant directions. Verify the exact comparison behavior at the boundary and confirm that the P2-550 commands the defined stop state.
  3. Run the full 45-minute data capture. Compare sample count and timestamps with the configured rate, check that memory use remains within the project allocation, and inspect the final samples for gaps or repeats.
  4. If Python is part of the acceptance path, compare its result with the PLC or a known calculation. Then test lost, stale, repeated, and malformed responses and confirm the PLC's timeout and stop behavior.
  5. Repeat a complete test with all production inputs and outputs connected, and confirm that a pass advances the process only after a valid result while a fail or communication fault prevents the next action.

Release the setup only after the recorded trace, rate decision, and output response agree with the acceptance requirement. Check the final test record and PLC state after both a passing run and a deliberately induced failing condition.

FAQ

Can I run Python on the P2-550 CPU?

Keep the existing Python script on a separate computer. Implement the real-time trip in PLC logic, or exchange test data and a result with a Raspberry Pi or PC over the documented Ethernet protocol.

Does the Productivity 2000 need microSD for live data processing?

No. The PLC can use live input values in its control logic; microSD logging is a separate way to retain test data. Confirm the installed project's supported logging and file handling before designing any readback workflow.

Can the P2-550 hold 45 minutes of pressure data?

At one sample per second, 45 minutes is 2,700 samples per channel. Calculate memory from the actual interval, channel count, data type, and project overhead, then verify capacity with a full-duration capture.

Can a Raspberry Pi calculate pass or fail for the PLC?

Yes, as an external analysis computer exchanging data and a result over Ethernet using the supported Custom Protocol over Ethernet. Keep the PLC responsible for the immediate pressure trip and for rejecting stale or missing results.

When should I stop and contact AutomationDirect support?

Stop commissioning if input updates, sample timing, or PLC stop behavior fail the acceptance checks, or if the installed CPU and protocol configuration cannot exchange valid data. Contact AutomationDirect support with the CPU and I/O module catalog numbers, programming environment version, acquisition interval, memory estimate, and a captured protocol exchange.

Back to blog