Skip to main content

Set Digital Output Logic

This guide shows you how to configure the OV80i's digital outputs to control external devices based on inspection results. The camera has 2 digital outputs that operate with True/False logic to trigger sorting mechanisms, indicator lights, alarms, or other automation equipment.

When to Use Digital Outputs: Automated sorting systems, pass/fail indicator lights, reject mechanisms, alarm systems, PLC communication, or any external device that needs to be triggered based on inspection results.

Prerequisites

  • OV80i camera system set up and connected
  • Active recipe with inspection logic configured
  • External device to control (optional for testing)
  • Basic understanding of digital I/O concepts

Digital Output Specifications

The OV80i provides 2 digital outputs accessible via the M12 connector:

OutputPin #Wire ColorFunction
Digital Output 011Configurable output
Digital Output 112Configurable output

Operating Logic:

  • True = Output ON (24V)
  • False = Output OFF (0V)

Step 1: Access Node-RED Editor

1.1 Navigate to IO Block

  1. Open your active recipe in Recipe Editor
  2. Click "IO Block" in breadcrumb menu
  3. Click "Configure IO" to enter Node-RED editor

1.2 Verify Node-RED Interface

Checkpoint: You should see the Node-RED flow editor with the node palette on the left side.

Step 2: Add Digital Output Node

2.1 Locate Output Node

  1. Find "Output" node in the left panel (Overview section)
  2. Drag "Output" node onto the flow canvas
  3. Double-click node to configure

image.png

2.2 Configure Output Settings

Node Configuration:

SettingOptionsDescription
Output PinDO0, DO1Select which physical output to control
Initial StateOFF, ONStarting state when system boots
NameCustom textOptional label for identification

2.3 Output Configuration Steps

  1. Select Output Pin:
    • DO0 = Digital Output 1 (Pin 11)
    • DO1 = Digital Output 2 (Pin 12)
  2. Set Initial State:
    • OFF = Output starts in OFF state (recommended)
    • ON = Output starts in ON state
  3. Name the Node:
    • Use descriptive names like "Reject_Signal" or "Pass_Light"
  4. Click "Done" to save configuration

Step 3: Connect Logic to Output

3.1 Basic Pass/Fail Output

For simple pass/fail indication:

  1. Add "Final Pass/Fail Output" node (if not already present)
  2. Connect: Final Pass/Fail → Output Node
  3. Result: Output activates when inspection passes

3.2 Inverted Logic (Fail Signal)

To trigger output on inspection failure:

  1. Add "function" node between pass/fail and output
  2. Configure function node:
// Invert pass/fail signal - ensure boolean output
msg.payload = !msg.payload;
return msg;

  1. Connect: Final Pass/Fail → Function → Output Node
  2. Result: Output activates when inspection fails

3.3 Custom Logic from Classification Results

When using classification or other inspection data:

  1. Add "function" node to convert results to boolean
  2. Configure function for your logic:
// Convert classification result to boolean
// Example: Activate output for specific class
if (msg.payload.class === "Defective") {
msg.payload = true; // Turn output ON
} else {
msg.payload = false; // Turn output OFF
}
return msg;

  1. Connect: Data Source → Function → Output Node

3.4 Boolean Conversion Examples

For different data sources, always convert to boolean:

From confidence values:

// Activate if confidence below threshold
msg.payload = (msg.payload.confidence < 0.8);
return msg;

From ROI results:

// Activate if any ROI failed
msg.payload = msg.payload.roi_results.some(roi => !roi.pass);
return msg;

note

The Output node requires boolean input (true/false). Always ensure your logic produces boolean values before connecting to the Output node.

4.1 Why Use Pulse Output

Pulse output is recommended because:

  • Provides clear signal indication
  • Prevents output from staying ON indefinitely
  • Better for triggering external equipment
  • Easier to troubleshoot signal timing

4.2 Add Trigger Node

  1. Add "trigger" node from Function section
  2. Place between logic source and output node
  3. Double-click trigger node to configure

4.3 Configure Trigger Settings

Pulse Configuration:

SettingRecommended ValueDescription
SendTrueInitial signal to send
Then wait500msPulse duration
Then sendFalseSignal after delay
Extend delayDisabledDon't extend on new messages

image.png

4.4 Trigger Configuration Steps

  1. First Output:
    • Send: booleantrue
    • This turns the output ON
  2. Delay Settings:
    • Then wait for: 500 milliseconds
    • Then send: booleanfalse
    • This turns the output OFF after delay
  3. Advanced Options:
    • Extend delay if new message arrives: Unchecked
    • Stop existing delay if new message arrives: Checked
  4. Click "Done" to save

Digital output

Noderedflow

4.5 Wire Pulse Configuration

Connect nodes in this order: Logic Source → Trigger → Output Node

Example flow: Final Pass/Fail → Trigger → Output (DO0)

Step 5: Deploy and Test Configuration

5.1 Deploy Flow

  1. Click "Deploy" button (top-right corner)
  2. Verify deployment success message
  3. Check node status indicators

5.2 Monitor Digital I/O Status

Use the built-in I/O monitoring screen:

  1. Navigate to "Digital I/O" page in main interface
  2. Observe output status in real-time
  3. Check "Last state change" timestamps

image.png

I/O Status Screen shows:

  • Current output state (ON/OFF)
  • Last state change timestamp
  • Real-time status updates

![Digital I/O Status Screen - Insert your I/O monitoring interface screenshot here showing Digital Output 1 and Digital Output 2 status with timestamps]

5.3 Test Output Activation

Manual Testing:

  1. Add "inject" node for testing
  2. Configure inject node:
    • Payload: booleantrue
    • Name: "Test Output"
  3. Connect: Inject → Trigger → Output
  4. Click inject button to test output
  5. Verify output activation in I/O status screen

Step 6: Advanced Output Configurations

6.1 Multiple Output Control

Control both outputs simultaneously:

  1. Add separate output nodes for DO0 and DO1
  2. Connect same logic source to both outputs
  3. Use different trigger delays if needed

6.2 Conditional Output Selection

Route to different outputs based on conditions:

  1. Add "switch" node from Function section
  2. Configure routing rules:
// Route based on classification result
if (msg.payload.class === "Large") {
return [msg, null]; // Send to first output (DO0)
} else if (msg.payload.class === "Small") {
return [null, msg]; // Send to second output (DO1)
}
return [null, null]; // No output

  1. Connect switch outputs to respective output nodes

6.3 Delayed Output Sequences

Create timed output sequences:

  1. Add multiple trigger nodes with different delays
  2. Configure sequence timing:
    • First trigger: 100ms pulse
    • Second trigger: 500ms delay, then 200ms pulse
  3. Connect in series for sequential activation

Step 7: Integration Examples

7.1 Sorting System Integration

Two-way sorting setup:

  • DO0 (Output 1): Good parts conveyor
  • DO1 (Output 2): Reject bin actuator
Final Pass/Fail → Switch Node → Trigger → DO0 (Pass)
→ Trigger → DO1 (Fail)

7.2 Alarm System Integration

Multi-level alarm system:

  • DO0: Warning light (minor defects)
  • DO1: Alarm horn (major defects)
Classification Logic → Function (Check severity) → Appropriate Output

7.3 PLC Communication

Simple PLC handshake:

  • DO0: Inspection complete signal
  • DO1: Part reject signal
All Block Outputs → Format for PLC → Trigger → DO0
→ Reject Logic → Trigger → DO1

Step 8: Troubleshooting Output Issues

8.1 Output Not Activating

ProblemCheckSolution
No output signalNode connectionsVerify all wires are connected
Logic never triggersInput conditionsCheck pass/fail logic configuration
Timing issuesTrigger settingsAdjust pulse duration
Wrong pin activeOutput pin selectionVerify DO0/DO1 configuration

8.2 Using I/O Status for Troubleshooting

The Digital I/O screen helps identify:

  1. Current Output State: See if output is actually changing
  2. Last State Change: Verify timing of output activation
  3. State History: Track output behavior over time

Troubleshooting with I/O Screen:

  • Output shows "OFF" always: Logic may not be triggering
  • Output shows "ON" always: Missing pulse configuration
  • No timestamp updates: Check Node-RED connections
  • Rapid state changes: Logic may be triggering too frequently

8.3 External Device Issues

ProblemCauseSolution
Device doesn't respondVoltage mismatchVerify 24V compatibility
Intermittent operationWiring issuesCheck M12 connector wiring
Delayed responseExternal device timingAdjust pulse duration

Step 9: Testing and Validation

9.1 Systematic Testing

Test each output systematically:

TestExpected ResultStatus
Manual trigger DO0Output 1 activates for pulse duration
Manual trigger DO1Output 2 activates for pulse duration
Pass conditionCorrect output activates
Fail conditionCorrect output activates
I/O status updatesTimestamps show state changes

9.2 Production Validation

Before deploying to production:

  1. Test with actual parts and inspection conditions
  2. Verify output timing meets external device requirements
  3. Confirm electrical connections are secure
  4. Document output assignments for maintenance

9.3 Performance Verification

Monitor these aspects:

  • Response time: Output activation delay after inspection
  • Reliability: Consistent output behavior over time
  • Timing accuracy: Pulse duration matches configuration

Success! Your Digital Outputs are Ready

Your digital output system can now:

  • Control external devices based on inspection results
  • Provide pulse signals for reliable triggering
  • Support multiple output configurations for complex automation
  • Integrate with PLCs and sorting systems for production automation
  • Monitor output status through the built-in I/O interface

Ongoing Maintenance

Regular System Checks

  • Monitor I/O status screen for consistent operation
  • Verify output timing remains within specifications
  • Check electrical connections at M12 connector
  • Test manual triggers periodically to ensure system health

Troubleshooting Resources

  • Use I/O status screen for real-time diagnostics
  • Check Node-RED debug panel for logic issues
  • Verify external device specifications match output capabilities
  • Document any configuration changes for future reference

Next Steps

After configuring digital outputs:

  1. Set up digital input triggers if needed for external control
  2. Configure PLC communication for integrated automation
  3. Implement safety interlocks for production environments
  4. Create automated monitoring for system health

🔗 See Also