diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/compatibility.yml b/content/hardware/07.opta/opta-family/opta-digital-exp/compatibility.yml new file mode 100644 index 0000000000..956972eba6 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/compatibility.yml @@ -0,0 +1,5 @@ +software: + - arduino-ide + - arduino-cli + - iot-cloud + - plc-ide \ No newline at end of file diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/AFX0005-6-new.png b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/AFX0005-6-new.png new file mode 100644 index 0000000000..a4b7ebe560 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/AFX0005-6-new.png differ diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg new file mode 100644 index 0000000000..b010539f45 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/dimensions.png b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/dimensions.png new file mode 100644 index 0000000000..e3c1771394 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/dimensions.png differ diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/featured.png b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/featured.png new file mode 100644 index 0000000000..ae4bd658b9 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/assets/featured.png differ diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/datasheet.md b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/datasheet.md new file mode 100644 index 0000000000..6da5225f72 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/datasheet/datasheet.md @@ -0,0 +1,290 @@ +--- +identifier: AFX00005-AFX00006 +title: Arduino Opta® Digital Expansion +type: pro +variant: 'Collective Datasheet' +author: Christopher Mendez +--- +![](assets/featured.png) + +# Description +Arduino Opta® Digital Expansions are designed to multiply your Opta® micro PLC capabilities with the addition of 16 programmable inputs for connecting your digital sensors and 8 more relays to operate your machines. Designed in partnership with leading relay manufacturer Finder®, it allows professionals to scale up industrial and building automation projects while taking advantage of the Arduino ecosystem. + +The Arduino Opta® Digital Expansion comes in two variants: the Opta Ext D1608E (with Electromechanical Relays) and the Opta Ext D1608S (with Solid State Relays), both of them described in this document. + +# Target Areas: +Industrial IoT, Building automation, Electrical loads management, Industrial automation + +# CONTENTS +## Product Variants +There are two variants of the Arduino Opta® Digital Expansion created to fit the different needs of each industry and application. The difference between each of the variants can be found in the following table: + +| Name | Arduino Opta® Ext D1608E | Arduino Opta® Ext D1608S | +| ------- | -------------------------------------------------- | -------------------------------------------------- | +| SKU | AFX00005 | AFX00006 | +| Inputs | 16 x programmable (0-24 V digital / 0-24 V analog) | 16 x programmable (0-24 V digital / 0-24 V analog) | +| Outputs | 8 x Electromechanical Relays (250 VAC - 6 A) | 8 x Solid State Relays (24 VDC - 2 A) | + + +## Application Examples +Arduino Opta® Expansion is designed for industrial standard machinery control alongside the Opta® micro PLC. It is readily integrated into the Arduino hardware and software ecosystem. + +- **Automated Production Line:** Arduino Opta® can manage the overall flow of goods in manufacturing. For example, by integrating a load cell or a vision system, it can ensure each phase of a packing process is performed correctly, automatically discard faulty parts, ensure the appropriate amount of goods is present within each box and interact with production line printers, also adding timestamp information synchronized via Network Time Protocol (NTP). + +- **Real-time Monitoring in Manufacturing:** Production data can be visualized locally via an HMI or even by connecting to the Arduino Opta® via Bluetooth® Low Energy. The simplicity of Arduino Cloud allows to remotely display custom dashboards; this product is also compatible with other major Cloud providers. + +- **Automated Anomaly Detection:** Its computing power allows the Arduino Opta® to deploy Machine Learning algorithms that are capable to learn when a process is drifting from its usual behavior on the production line and activating/deactivating processes to prevent equipment damage. + +## Features +### General Specifications Overview + +| Characteristics | Details | +| ----------------------- | ----------------------------------------------------------------------------------------------------- | +| Supply Voltage | 12...24 V | +| Antipolarity protection | Yes | +| Overvoltage protection | Yes (+20%) | +| Inputs | 16x Digital (0-24 V) / Analog (0-24 V) inputs | +| Outputs | AFX00005: 8x Electromechanical Relays (250 VAC - 6 A), AFX00006: 8x Solid State Relays (24 VDC - 2 A) | +| Degree of Protection | IP20 | +| Certifications | FCC, CE, UKCA | + +### Inputs + +| Characteristics | Details | +| ----------------------------- | ------------------------- | +| Number of inputs | 16x Digital/Analog inputs | +| Inputs overvoltage protection | Yes (Up to 40 V) | +| Antipolarity protection | No | +| Input impedance | 5.85 kΩ | + + +#### Analog Inputs +| Characteristics | Details | +|---------------------------|----------------------------------| +| Analog Input voltage | 0...24 V | +| Analog Input resolution | 14 bit | +| Analog Input LSB value | 1.733 mV | +| Accuracy | +/- 5%, repeatability +/- 2% | + + +#### Digital Inputs +| Characteristics | Details | +| --------------------------------- | -------------------------------- | +| Digital Input voltage | 0...24 V | +| Digital Input voltage logic level | VIL Max: 4 VDC. VHL Min: 5.9 VDC | +| Digital Input current | 4.12 mA at 24 V, 2.05 mA at 10 V | +| Digital Input frequency | 300 Hz | + + +### Outputs (AFX00005 Only) + +| Characteristics | Details | +| ------------------------------------------- | ---------------------------------------------- | +| Number of outputs | 8x Electromechanical Relays (NO - SPST) | +| Max current per relay | 6 A | +| Max peak current per relay | 10 A | +| Continuous current per terminal | 6 A | +| Short-circuit protection | No, external fuse required | +| Relay rated voltage | 250 VAC | +| Relay Max voltage | 400 VAC | +| Rated load AC1 | 1500 VA | +| Rated load AC15 (230 VAC) | 300 VA | +| Breaking capacity DC1: 24/110/220 V | 6/0.2/0.12 A | +| Minimum switching load | 500 mW (12 V/10 mA) | +| Max output line length (unshielded) | 100 m | +| Relay response time from state 0 to state 1 | 5 ms for relay output | +| Relay response time from state 1 to state 0 | 3 ms for relay output | +| Bounce time NO | 1 ms | +| Bounce time NC | 6 ms | +| Relay mechanical durability | 10 million cycles (DC) | +| Relay electrical durability | 60 thousand cycles with a resistive load (AC1) | + + +### Outputs (AFX00006 Only) + +| Characteristics | Details | +| ------------------------------------------- | --------------------------------- | +| Number of outputs | 8x Solid State Relays (NO - SPST) | +| Max current per relay | 2 A | +| Max peak current per relay | 50 A (10 ms) | +| Continuous current per terminal | 2 A | +| Short-circuit protection | No, external fuse required | +| Relay rated voltage | 24 VDC | +| Switching voltage range | 1.5...30 VDC | +| Maximum blocking voltage | 33 VDC | +| Rated load DC13 | 36 W | +| Minimum switching current | 1 mA | +| Max "OFF-state" leakage current | 0.001 mA | +| Max "OFF-state" voltage drop | 0.4 V | +| Relay response time from state 0 to state 1 | 0.02 ms for relay output | +| Relay response time from state 1 to state 0 | 0.2 ms for relay output | +| Electrical life at rated load | > 10 million cycles | + +## Ratings +### Recommended Operating Conditions + +| Description | Value | +| --------------------------- | ------------------------- | +| Temperature Operating Range | -20...50 °C | +| Protection degree rating | IP20 | +| Pollution degree | 2 conforming to IEC 61010 | + +### Power Specification (Ambient Temperature) + +| Property | Min | Typ | Max | Unit | +| ----------------------- | ---- | --- | ---- | ---- | +| Supply voltage | 12 | - | 24 | V | +| Permissible range | 10.2 | - | 27.6 | V | +| Power consumption (12V) | - | - | 3 | W | +| Power consumption (24V) | - | - | 3 | W | + +## Functional Overview + +### Product View + +![Arduino Opta® Expansion EMR and SSR variants](assets/AFX0005-6-new.png) + +| Item | Feature | +| ---- | --------------------------------------------------------------------------------- | +| 3a | Power Supply Terminals 12...24 VDC | +| 3b | I1...I16 digital/analog input terminals (0-24 V) configurable via IDE | +| 3c | Power Status LED | +| 3d | Relay Output Terminals 1...8, NO contact (SPST), EMR 6 A 250 VAC - SSR 2 A 24 VDC | +| 3e | Status LEDs 1...8 | +| 3f | Port for communication and connection of auxiliary modules | + + +### Block Diagram + +The following diagram explains the relation between the main components of the Opta® Digital Expansion: + +![Block diagram](assets/Opta_Digital_EXP_Block_Diagram.svg) + +### Relay Outputs +Arduino Opta® Digital Expansions has eight *Normally Open* (NO) relays. For the **EMR** variant, eight powerful 6 A electromechanical relays capable of actuating on loads at a rated voltage of 250 VAC and up to a maximum switching voltage of 400 VAC, and for the **SSR** variant, eight fast 2 A solid state relays which are capable of actuating on DC loads at a rated voltage of 24 VDC. + +The relay *Maximum Peak Current* is defined as the highest value of inrush current that the relay can endure without undergoing any permanent degradation of its characteristics due to the generated heat. The relay has to be able to hold up that maximum using a duty cycle of less or equal to 10% and for a time equal to or less than 0.5 s. + +In the case of Arduino Opta® Digital Expansions, the EMR and SSR variants have a *Maximum Peak Current* of 10 A and 50 A respectively. + +The *Rated Load* is the maximum resistive load that a contact can make, carry and break repeatedly. +- For resistive or slightly inductive loads (AC1 classification), **EMR variant's** *Rated Load* is 1500 VA. +- For small electromagnetic loads (> 72 VA) (AC15 classification) like power contactors, magnetic solenoid valves, electromagnets and AC single-phase supplies, **EMR variant's** *Rated Load* is 300 VA. This value assumes a peak inrush current of approximately 10 times the rated current and keeps it within the maximum peak current. + +For controlling DC loads (DC1 classification), the **EMR variant's** *Breaking Capacity* or maximum value of DC resistive current that a contact can make, carry and break repeatedly, is 6/0.2/0.12 A for respectively 24/110/220 V. + +For controlling DC electromagnetics loads (DC13 classification), the **SSR variant's** *Rated Load* is 36 W. + +In the case of the minimum switching load parameters, the minimum values of power, voltage and current that the **EMR variant** relays can reliably switch, are 500 mW/ 12 V / 10 mA. This implies that with 12 V the current must be at least 42 mA, with 24 V, it must be at least 21 mA, and with 10 mA the voltage must be at least 50V. + +For the **SSR variant**, the minimum switching voltage and current are 1.5 VDC and 1 mA respectively. + +The **EMR variant** relays on Arduino Opta® Digital Expansions provide a very fast response time of 6/4 ms to change state for closing/reopening. The **SSR variant** provides an even faster response of 0.02/0.2 ms to change state for closing/reopening. + +### Expansion Port +The expansion port can be used to daisy-chain several Opta® Expansions and additional modules. To be accessed needs to be freed up from its breakable plastic cover and the connection plug added between each device. + +## Device Operation +### Getting Started - IDE +If you want to program your Arduino Opta® Digital Expansions while offline you need to install the Arduino® Desktop IDE **[1]** and the Arduino_Opta_Blueprint using the Library Manager. To connect the Arduino Opta® to your computer, you will need a USB-C® cable. + +### Getting Started - Arduino Web Editor +All Arduino® devices work out-of-the-box on the Arduino® Web Editor **[2]** by just installing a simple plugin. + +The Arduino® Web Editor is hosted online, therefore it will always be up-to-date with the latest features and support for all boards and devices. Follow **[3]** to start coding on the browser and upload your sketches onto your device. + +### Getting Started - Arduino PLC IDE +Arduino Opta® Digital Expansions can be also programmed using the industrial-standard **_IEC 61131-3_** programming languages. Download the Arduino® PLC IDE **[4]** software, attach the Opta® Expansion through the Aux Connector and connect your Arduino Opta® to your computer using a simple USB-C® cable to start creating your own PLC industrial solutions. The PLC IDE will recognize the expansion and will expose the new available I/Os in the resources tree. + +### Getting Started - Arduino Cloud +All Arduino® IoT enabled products are supported on Arduino Cloud which allows you to log, graph and analyze sensor data, trigger events, and automate your home or business. + +### Sample Sketches +Sample sketches for Arduino Opta® Digital Expansions can be found in the **Arduino_Opta_Blueprint** library “Examples” in the Arduino® IDE or the “Arduino Opta® Documentation” section of Arduino® **[5]**. + +### Online Resources +Now that you have gone through the basics of what you can do with the device, you can explore the endless possibilities it provides by checking exciting projects on ProjectHub **[6]**, the Arduino® Library Reference **[7]** and the online store **[8]** where you will be able to complement your Arduino Opta® product with additional extensions, sensors and actuators. + +## Mechanical Information +### Product Dimensions +![Arduino Opta® Expansion Outline. Dimensions are in mm](assets/dimensions.png) + +***Note: Terminals can be used with both solid and stranded core wire (min: 0.5 mm2 / 20 AWG).*** + +## Certifications + +### Certifications Summary + +| Cert | Arduino Opta® Digital Expansion EMR (AFX00005) | Arduino Opta® Digital Expansion SSR (AFX00006) | +| ---------- | ---------------------------------------------- | ---------------------------------------------- | +| CE (EU) | EN IEC 61326-1:2021, EN IEC 61010 (LVD) | EN IEC 61326-1:2021, EN IEC 61010 (LVD) | +| CB (EU) | Yes | Yes | +| WEEE (EU) | Yes | Yes | +| REACH (EU) | Yes | Yes | +| UKCA (UK) | EN IEC 61326-1:2021 | EN IEC 61326-1:2021 | +| FCC (US) | Yes | Yes | +| cULus | UL 61010-2-201 | UL 61010-2-201 | + + +### Declaration of Conformity CE DoC (EU) +We declare under our sole responsibility that the products above are in conformity with the essential requirements of the following EU Directives and therefore qualify for free movement within markets comprising the European Union (EU) and European Economic Area (EEA). + +### Declaration of Conformity to EU RoHS & REACH 211 01/19/2021 + +Arduino boards are in compliance with RoHS 2 Directive 2011/65/EU of the European Parliament and RoHS 3 Directive 2015/863/EU of the Council of 4 June 2015 on the restriction of the use of certain hazardous substances in electrical and electronic equipment. + +| Substance | **Maximum limit (ppm)** | +|----------------------------------------|-------------------------| +| Lead (Pb) | 1000 | +| Cadmium (Cd) | 100 | +| Mercury (Hg) | 1000 | +| Hexavalent Chromium (Cr6+) | 1000 | +| Poly Brominated Biphenyls (PBB) | 1000 | +| Poly Brominated Diphenyl ethers (PBDE) | 1000 | +| Bis(2-Ethylhexyl) phthalate (DEHP) | 1000 | +| Benzyl butyl phthalate (BBP) | 1000 | +| Dibutyl phthalate (DBP) | 1000 | +| Diisobutyl phthalate (DIBP) | 1000 | + +Exemptions: No exemptions are claimed. + +Arduino Boards are fully compliant with the related requirements of European Union Regulation (EC) 1907 /2006 concerning the Registration, Evaluation, Authorization and Restriction of Chemicals (REACH). We declare none of the SVHCs (https://echa.europa.eu/web/guest/candidate-list-table), the Candidate List of Substances of Very High Concern for authorization currently released by ECHA, is present in all products (and also package) in quantities totaling in a concentration equal or above 0.1%. To the best of our knowledge, we also declare that our products do not contain any of the substances listed on the "Authorization List" (Annex XIV of the REACH regulations) and Substances of Very High Concern (SVHC) in any significant amounts as specified by the Annex XVII of Candidate list published by ECHA (European Chemical Agency) 1907 /2006/EC. + +### Conflict Minerals Declaration +As a global supplier of electronic and electrical components, Arduino is aware of our obligations with regards to laws and regulations regarding Conflict Minerals, specifically the Dodd-Frank Wall Street Reform and Consumer Protection Act, Section 1502. Arduino does not directly source or process conflict minerals such as Tin, Tantalum, Tungsten, or Gold. Conflict minerals are contained in our products in the form of solder, or as a component in metal alloys. As part of our reasonable due diligence Arduino has contacted component suppliers within our supply chain to verify their continued compliance with the regulations. Based on the information received thus far we declare that our products contain Conflict Minerals sourced from conflict-free areas. + +## FCC Caution +Any Changes or modifications not expressly approved by the party responsible for compliance could void the user’s authority to operate the equipment. + +This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: + +(1) This device may not cause harmful interference + +(2) this device must accept any interference received, including interference that may cause undesired operation. + +**Note:** This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction manual, may cause harmful interference to radio communications. Operation of this equipment in a residential area is likely to cause harmful interference in which case the user will be required to correct the interference at his own expense. + +## Company Information + +| Company name | Arduino S.r.l | +| --------------- | ----------------------------------------------- | +| Company Address | Via Andrea Appiani, 25 - 20900 MONZA ( Italy ) | + + +## Reference Documentation +| **Ref** | **Link** | +|:---------------------------------:|---------------------------------------------------------------------------------------------| +| Arduino IDE (Desktop) | https://www.arduino.cc/en/Main/Software | +| Arduino IDE (Cloud) | https://create.arduino.cc/editor | +| Arduino Cloud - Getting started | https://docs.arduino.cc/arduino-cloud/getting-started/iot-cloud-getting-started | +| Arduino PLC IDE | https://www.arduino.cc/en/Main/Software | +| Arduino Opta® Documentation | https://docs.arduino.cc/hardware/opta | +| Project Hub | https://create.arduino.cc/projecthub?by=part&part_id=11332&sort=trending | +| Library Reference | https://www.arduino.cc/reference/en/ | +| Online Store | https://store.arduino.cc/ | + +## Revision History + +| Date | **Revision** | **Changes** | +|------------|--------------|------------------- | +| 06/05/2024 | 1 | First Release | diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/downloads/AFX00005-AFX00006-step.zip b/content/hardware/07.opta/opta-family/opta-digital-exp/downloads/AFX00005-AFX00006-step.zip new file mode 100644 index 0000000000..2278b62921 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta-digital-exp/downloads/AFX00005-AFX00006-step.zip differ diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/features.md b/content/hardware/07.opta/opta-family/opta-digital-exp/features.md new file mode 100644 index 0000000000..ead0e973bb --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/features.md @@ -0,0 +1,45 @@ + + +**Arduino Opta® Digital Expansions** are designed to multiply your Opta® micro PLC capabilities with the addition of 16 programmable inputs for connecting your digital sensors and 8 more relays to operate your machines. + +Designed in partnership with leading relay manufacturer Finder®, it allows professionals to scale up industrial and building automation projects while taking advantage of the Arduino ecosystem. + +Arduino Opta® Digital Expansion is available in two variants: +* AFX00005 - Arduino Opta® Ext D1608E: Electromechanical Relay outputs +* AFX00006 - Arduino Opta® Ext D1608S: Solid State Relay outputs + + + + + + + + Up to 5 snap-on modules managed to multiply and mix your set of I/Os with seamless detection. + + + + + + Arduino Opta® Digital Expansion has a highly reliable design operating at industrial temperature ranges (-20 °C to +50 °C). + + + + + + * Arduino sketch + * IEC-61131-3: + * Ladder (LD) + * Sequential Function Chart (SFC) + * Function Block Diagram (FBD) + * Structured Text (ST) + * Instruction List (IL) + + + + + + Thanks to its form factor, it can be attached to a Din Rail mount system, providing a quick access to all the I/O ‘s. + + + + diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/image.svg b/content/hardware/07.opta/opta-family/opta-digital-exp/image.svg new file mode 100644 index 0000000000..8c7b6861cf --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/image.svg @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/product.md b/content/hardware/07.opta/opta-family/opta-digital-exp/product.md new file mode 100644 index 0000000000..c6f5183ad9 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/product.md @@ -0,0 +1,13 @@ +--- +title: Opta Digital Expansion +url_shop: https://store.arduino.cc/collections/pro-family +url_guide: /tutorials/opta-digital-exp/user-manual +primary_button_url: /tutorials/opta/user-manual#opta-digital-expansions +primary_button_title: User Manual +secondary_button_url: /tutorials/opta/opta-expansions-plc-ide +secondary_button_title: Digital Expansions with PLC IDE +core: arduino:mbed_opta +certifications: [FCC, CE, UKCA] +--- + +The **Arduino Opta® Digital Expansion** is a plug-and-play extension to the **Opta® PLC Controller** that expands its capabilities with more inputs and outputs. Two variants are available: the AFX00005 - Opta Ext D1608E (with Electromechanical Relays) and the AFX00006 - Opta Ext D1608S (with Solid State Relays), both of them fully compatible with the Arduino Ecosystem. \ No newline at end of file diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.md b/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.md new file mode 100644 index 0000000000..cc2259dab3 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.md @@ -0,0 +1 @@ +These are the technical specifications for Arduino Opta® Digital Expansion. diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.yml b/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.yml new file mode 100644 index 0000000000..c172542c9a --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/tech-specs.yml @@ -0,0 +1,38 @@ +Board: + SKUs: + Arduino Opta® Ext D1608E: AFX00005 + Arduino Opta® Ext D1608S: AFX00006 +Microcontroller: + ID: Renesas R7FA4M1AB3CFM ARM® Cortex®-M4 + Cortex-M4 core: Up to 48 MHz +Input: + Configurable digital / analog input: 16 + Digital Operational Range: 0-24 V + Digital VIL Max: 4 V + Digital VIH Min: 5.9 V + Analog Operational Range: 0-24 V + Analog Resolution: 14 bit +Relays: + Arduino Opta® Ext D1608E (AFX00005): + Nº of relays: 8 + Relay rated voltage: 250 VAC + Relay maximum switching voltage: 400 VAC + Maximum current per relay: 6 A + Maximum peak current per relay: 10 A + Arduino Opta® Ext D1608S (AFX00006): + Nº of relays: 8 + Relay rated voltage: 24 VDC + Relay maximum switching voltage: 33 VDC + Maximum current per relay: 2 A + Maximum peak current per relay: 50 A +Power: + Input voltage: 12-24 VDC +Dimensions: + Weight: 190 g + Width: 70 mm + Length: 89 mm + Height: 62 mm +IP Protection: IP20 +Programming: + Arduino programming language: Via Arduino IDE, Arduino CLI, Arduino Cloud + IEC-61131-3: Ladder Diagram (LD), Function Block Diagram (FBD), Sequential Function Chart (SFC), Structured Text (ST), Instruction List (IL) diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/01.user-manual b/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/01.user-manual new file mode 120000 index 0000000000..0202ed4bf5 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/01.user-manual @@ -0,0 +1 @@ +../../../../07.opta/opta-family/opta/tutorials/01.user-manual/ \ No newline at end of file diff --git a/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/17.opta-expansions-plc-ide b/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/17.opta-expansions-plc-ide new file mode 120000 index 0000000000..35047c2c88 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-digital-exp/tutorials/17.opta-expansions-plc-ide @@ -0,0 +1 @@ +../../../../07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/ \ No newline at end of file diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/16-inputs-new.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/16-inputs-new.png new file mode 100644 index 0000000000..6c480b937e Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/16-inputs-new.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/analog-inputs.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/analog-inputs.png new file mode 100644 index 0000000000..863f121437 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/analog-inputs.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/emr-output.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/emr-output.png new file mode 100644 index 0000000000..00cbf30475 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/emr-output.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial-2.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial-2.png new file mode 100644 index 0000000000..ea9186fd65 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial-2.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial.png new file mode 100644 index 0000000000..fded847e17 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update-serial.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update.png new file mode 100644 index 0000000000..b6d8f8ddac Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/fw-update.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install-2.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install-2.png new file mode 100644 index 0000000000..8a3681d95a Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install-2.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install.png new file mode 100644 index 0000000000..f14ba468bd Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/library-install.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/limit-switch.gif b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/limit-switch.gif new file mode 100644 index 0000000000..a42f0c5b88 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/limit-switch.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/outputs-animation.gif b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/outputs-animation.gif new file mode 100644 index 0000000000..8356f68b20 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/outputs-animation.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/power-expansion.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/power-expansion.png new file mode 100644 index 0000000000..d5e87098f3 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/power-expansion.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/snapping.gif b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/snapping.gif new file mode 100644 index 0000000000..3949c3d461 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/snapping.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/ssr-output.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/ssr-output.png new file mode 100644 index 0000000000..16bc8ef67e Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/ssr-output.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants-emr-ssr-new.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants-emr-ssr-new.png new file mode 100644 index 0000000000..0a489154a3 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants-emr-ssr-new.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants.png b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants.png new file mode 100644 index 0000000000..40bafc178d Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/assets/variants.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/content.md b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/content.md index 8ebc5936c1..4217848666 100644 --- a/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/content.md +++ b/content/hardware/07.opta/opta-family/opta/tutorials/01.user-manual/content.md @@ -7,7 +7,7 @@ tags: - Cheat sheet - User manual - Opta -author: 'José Bagur and Julián Caro Linares' +author: 'José Bagur, Christopher Méndez and Julián Caro Linares' hardware: - hardware/07.opta/opta-family/opta software: @@ -1699,6 +1699,892 @@ To learn more about Opta™ and the Arduino IoT Cloud, check out the following r - [Opta™ Relay Management template](https://create.arduino.cc/iot/templates/relay-management) - [Using PLC IDE With Arduino® IoT Cloud](https://docs.arduino.cc/tutorials/opta/plc-ide-cloud-support) + +## Opta Digital Expansions + +Arduino Opta™ Digital Expansions are designed to multiply your Opta™ micro PLC capabilities with the addition of 16 programmable inputs for connecting your industrial sensors and 8 more relays to operate your machines. Designed in partnership with leading relay manufacturer Finder®, it allows professionals to scale up industrial and building automation projects while taking advantage of the Arduino ecosystem. + +The Opta™ Digital Expansions come in two variants: the D1608E (with Electromechanical Relays), and the D1608S (with Solid State Relays). + +The Opta Expansions can be controlled by any Opta controller variant: Opta Lite, Opta RS485 or Opta WiFi. + +![Opta Expansion variants](assets/variants.png) + +***The Opta™ expansions firmware must be updated to the latest version to ensure proper functioning. See this [section](#update-expansion-firmware) for a guided step-by-step.*** + +### Snapping the Expansion + +You can snap up to five expansions to your Opta™ Base module to multiply and mix your set of I/Os with seamless detection. + +After removing the expansion port breakable plastic cover marked as AUX, from the Opta™ controller and from the expansion to expose the expansion port, plug the expansions on the right side of your Opta™ controller making sure to correctly align the **Aux connector** and the connection clips as shown in the image below: + +![Snapping Opta expansions](assets/snapping.gif) + +### Powering Expansions + +The Opta™ Digital Expansions must be externally powered to work. See the power specifications in the table below: + +| Property | Min | Typ | Max | Unit | +|--------------------------|------|-----|------|------| +| Supply voltage | 12 | - | 24 | V | +| Permissible range | 10.2 | - | 27.6 | V | +| Power consumption (12 V) | - | - | 3 | W | +| Power consumption (24 V) | - | - | 3 | W | + +In the image below there is an example of the power wiring of the expansions: + +![Powering the Opta Digital Expansions](assets/power-expansion.png) + +***The expansions must be externally powered to be operated and detected by the Opta™ controller.*** + +### Library Installation + +To use the Opta™ Digital Expansion with your Opta™ PLC, you need to install the `Arduino_Opta_Blueprint` library. To do so in the Arduino IDE, select the **Library Manager** from the left side menu, now search for _Opta Expansions_ and click on the install button. + +![Opta expansions library installation](assets/library-install.png) + +Install all the **library dependencies** suggested by clicking the **Install All** button: + +![Library dependencies installation](assets/library-install-2.png) + +Once installed, you will have access to a variety of sketch examples showcasing the expansions capabilities and how to use them. + +#### Update Expansion Firmware + +With the library properly installed, we will update the expansion firmware to ensure proper functioning and seamless detection. + +In the Arduino IDE, navigate to **File > Examples > Arduino_Opta_Blueprint > updateExpansionFw**. + +![Firmware update example](assets/fw-update.png) + +Upload the program to the Opta™ controller and open the Arduino IDE Serial Monitor. + +![Firmware update process](assets/fw-update-serial.png) + +If your expansion is updatable, in the Serial Monitor you will see its current firmware version and the new one to which it will be updated. + +Type `Y` in the Serial Monitor to confirm the update and wait for it to be completed. + +![Firmware update running](assets/fw-update-serial-2.png) + +Finally, your Opta™ expansion will be updated with the latest firmware version. + +### Programmable Inputs + +The Opta™ Expansions have **16 analog/digital programmable inputs** accessible through terminals `I1` to `I16`. + +Both Ext D1608E and Ext D1608S variant inputs can be used as **digital** with a 0-24 VDC range or as **analog** inputs with a 0-24 VDC range. The inputs are capable of operating with 0-10V analog sensors as well as 0-24V sensors. + +***The inputs are marked on plastic as DGT/0-10 V to maintain uniformity with the main Opta module and as conventionally the majority of industrial analog sensors work in the 0-10 V range.*** + +![Opta Digital Expansions Inputs](assets/16-inputs-new.png) + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacteristicsDetails
Number of inputs16x Digital/Analog inputs
Inputs overvoltage protectionyes (up to 40 V)
Reverse protectionno
Input impedance5.85 kΩ
+ +Analog/digital input terminals are mapped as described in the following table: + +| **Opta Digital Expansion Terminal** | **Arduino Pin Mapping** | +|:-----------------------------------:|:-----------------------:| +| I1 | 0 | +| I2 | 1 | +| I3 | 2 | +| I4 | 3 | +| I5 | 4 | +| I6 | 5 | +| I7 | 6 | +| I8 | 7 | +| I9 | 8 | +| I10 | 9 | +| I11 | 10 | +| I12 | 11 | +| I13 | 12 | +| I14 | 13 | +| I15 | 14 | +| I16 | 15 | + +#### Digital + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacteristicsDetails
Digital Input voltage0...24V
Digital Input voltage logic levelVIL Max: 4 VDC. VHL Min: 5.9 VDC
Digital Input current4.12mA at 24V | 2.05mA at 10V
Digital Input frequency300 Hz
+ +The state of an input terminal, configured as digital, can be read using the built-in function `digitalRead()` as shown below: + +```arduino +PinStatus state = .digitalRead(); +``` +The following example will let you read all the digital inputs of every expansion connected at once, it can be found in the Opta Digital Expansions library by navigating to **File > Examples > Arduino_OptaBlueprint > getDigital**: + +```arduino +#include "OptaBlue.h" + +using namespace Opta; + +/* -------------------------------------------------------------------------- */ +void printExpansionType(ExpansionType_t t) { +/* -------------------------------------------------------------------------- */ + if(t == EXPANSION_NOT_VALID) { + Serial.print("Unknown!"); + } + else if(t == EXPANSION_OPTA_DIGITAL_MEC) { + Serial.print("DIGITAL [Mechanical]"); + } + else if(t == EXPANSION_OPTA_DIGITAL_STS) { + Serial.print("DIGITAL [Solid State]"); + } + else if(t == EXPANSION_DIGITAL_INVALID) { + Serial.print("DIGITAL [!!Invalid!!]"); + } + else if(t == EXPANSION_OPTA_ANALOG) { + Serial.print("ANALOG"); + } + else { + Serial.print("Unknown!"); + } +} + +/* -------------------------------------------------------------------------- */ +void printExpansionInfo(uint8_t index, ExpansionType_t type, uint8_t i2c_address) { +/* -------------------------------------------------------------------------- */ + Serial.print("Expansion[" + String(index) + "]:"); + Serial.print(" type "); + printExpansionType(type); + Serial.print(", I2C address: "); + Serial.println(i2c_address); + +} + +/* -------------------------------------------------------------------------- */ +/* SETUP */ +/* -------------------------------------------------------------------------- */ +void setup() { + Serial.begin(115200); + delay(2000); + + OptaController.begin(); +} + +/* -------------------------------------------------------------------------- */ +/* LOOP */ +/* -------------------------------------------------------------------------- */ +void loop() { + + OptaController.update(); + + Serial.println(); + + for(int i = 0; i < OPTA_CONTROLLER_MAX_EXPANSION_NUM; i++) { + /* ask for a digital expansion + * just one of these will be a valid expansion */ + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); + /* always check for the validity of the expansion */ + if(mechExp) { + /* get and print information about expansion */ + printExpansionInfo(mechExp.getIndex(), mechExp.getType(), + mechExp.getI2CAddress()); + + /* this will update the status of all the digital input + * the same can be achieved using digitalRead() function + * with the second parameter equal true, however in this + * case multiple i2c transaction are performed without + * reason */ + mechExp.updateDigitalInputs(); + + for(int k = 0; k < OPTA_DIGITAL_IN_NUM; k++) { + /* this will return the pin status of the pin k */ + PinStatus v = mechExp.digitalRead(k); + + if(v == HIGH) { + Serial.print("HH"); + } + else { + Serial.print("LL"); + } + Serial.print(' '); + } + Serial.println(); + } + + + /* always check for the validity of the expansion */ + if(stsolidExp) { + /* get and print information about expansion */ + printExpansionInfo(stsolidExp.getIndex(), stsolidExp.getType(), + stsolidExp.getI2CAddress()); + + /* this will update the status of all the digital input + * the same can be achieved using digitalRead() function + * with the second parameter equal true, however in this + * case multiple i2c transaction are performed without + * reason */ + stsolidExp.updateDigitalInputs(); + + for(int k = 0; k < OPTA_DIGITAL_IN_NUM; k++) { + /* this will return the pin status of the pin k */ + PinStatus v = stsolidExp.digitalRead(k); + + if(v == HIGH) { + Serial.print("HH"); + } + else { + Serial.print("LL"); + } + Serial.print(' '); + } + Serial.println(); + } + } + delay(1000); + +} +``` +Please take into account that `OptaController.update()` must be called cyclically to support the hot plug of new expansions. In other words, by calling the update() function cyclically, the controller will discover new expansions when they are plugged in while the controller is already running. + +Thanks to this function, the action of plugging in a new expansion will cause the controller to start a completely new discovery process and a new I2C address assignment. + +`OptaController.update()` function DOES NOT: +* Check if an expansion has been removed and remove their objects +* Update any data from or to the expansion + + +The expansion object in the example above is defined using the `OptaController.getExpansion(i);` function, as follows: + + +```arduino +for(int i = 0; i < 5; i++) { // check all the five available expansion slots + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); +} +``` +The above method will check if there is an Ext D1608E or Ext D1608S expansion connected in the `i` index from the five admitted. If any is found in the asked index, the expansion `mechExp` or `stsolidExp` turns to true. This will ensure which expansion the read state belongs to. + +The function `.updateDigitalInputs();` updates all the inputs with their current states to prepare them to be read. + +After the Opta™ controller is programmed with the example sketch, open the Arduino IDE Serial Monitor and you will see each input state as follows: + +``` +Expansion[0]: type DIGITAL [Mechanical], I2C address: 11 +LL LL LL LL LL HH LL LL LL LL LL LL LL LL LL LL +``` + +![Digital Input wiring example](assets/limit-switch.gif) + +***General note: +The library supports the OptaController.getExpansionNum() + +This function always returns the number of expansions discovered during the last discovery / assign I2C address process. +Since the discovery process is NOT performed if an expansion is removed or powered down, the value returned by this function DOES NOT change in case of the removal of one Expansion. + +To know if an expansion is missing, register a callback using setFailedCommCb(cb) (available on all the Expansion classes). +The callback will be called any time an I2C expected answer is not received by the controller, allowing the user to know that expansion is missing. + +No "heartbeat" function is provided to understand if an expansion is missing since having an expansion and not regularly communicating with it is not a behavior meant by design.*** +#### Analog + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacteristicsDetails
Analog Input voltage0...24V
Analog Input resolution14 bits
Analog Input LSB value1.733 mV
Accuracy+/- 5%, repeatability +/- 2%
+ +The state of an input terminal, configured as analog, can be read using the built-in function `analogRead()` as shown below: + +```arduino +uint16_t raw_adc = .analogRead(); +``` +The following example will let you read all the analog inputs of every expansion connected at once, it can be found in the Opta Digital Expansions library by navigating to **File > Examples > Arduino_OptaBlueprint > getAnalog**: + +```arduino +#include "OptaBlue.h" + +using namespace Opta; + +/* -------------------------------------------------------------------------- */ +void printExpansionType(ExpansionType_t t) { +/* -------------------------------------------------------------------------- */ + if(t == EXPANSION_NOT_VALID) { + Serial.print("Unknown!"); + } + else if(t == EXPANSION_OPTA_DIGITAL_MEC) { + Serial.print("DIGITAL [Mechanical]"); + } + else if(t == EXPANSION_OPTA_DIGITAL_STS) { + Serial.print("DIGITAL [Solid State]"); + } + else if(t == EXPANSION_DIGITAL_INVALID) { + Serial.print("DIGITAL [!!Invalid!!]"); + } + else if(t == EXPANSION_OPTA_ANALOG) { + Serial.print("ANALOG"); + } + else { + Serial.print("Unknown!"); + } +} + +/* -------------------------------------------------------------------------- */ +void printExpansionInfo(uint8_t index, ExpansionType_t type, uint8_t i2c_address) { +/* -------------------------------------------------------------------------- */ + Serial.print("Expansion[" + String(index) + "]:"); + Serial.print(" type "); + printExpansionType(type); + Serial.print(", I2C address: "); + Serial.println(i2c_address); + +} + +/* -------------------------------------------------------------------------- */ +/* SETUP */ +/* -------------------------------------------------------------------------- */ +void setup() { + Serial.begin(115200); + delay(2000); + + OptaController.begin(); +} + +/* -------------------------------------------------------------------------- */ +void printUint16(uint16_t v) { +/* -------------------------------------------------------------------------- */ + if(v < 10) { + Serial.print(" "); + } + else if(v < 100) { + Serial.print(" "); + + } + else if(v < 1000) { + Serial.print(" "); + + } + else if(v < 10000) { + Serial.print(" "); + } + Serial.print(v); +} + + +/* -------------------------------------------------------------------------- */ +/* LOOP */ +/* -------------------------------------------------------------------------- */ +void loop() { + + OptaController.update(); + + for(int i = 0; i < OPTA_CONTROLLER_MAX_EXPANSION_NUM; i++) { + /* ask for a digital expansion + * just one of these will be a valid expansion */ + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); + /* always check for the validity of the expansion */ + if(mechExp) { + /* get and print information about expansion */ + printExpansionInfo(mechExp.getIndex(), mechExp.getType(), + mechExp.getI2CAddress()); + /* get and print information about analog input status */ + for(int k = 0; k < OPTA_DIGITAL_IN_NUM; k++) { + /* this will return the ad converter bits */ + uint16_t v = mechExp.analogRead(k); + printUint16(v); + Serial.print(" "); + /* this will return the voltage at the pin k in Volts + * we pass false as the last argument since we have + * just read the analog value with the previous analogRead */ + float V = mechExp.pinVoltage(k,false); + Serial.print("(" + String(V) + "V) "); + } + Serial.println(); + } + + + /* always check for the validity of the expansion */ + if(stsolidExp) { + /* get and print information about expansion */ + printExpansionInfo(stsolidExp.getIndex(), stsolidExp.getType(), + stsolidExp.getI2CAddress()); + + /* get and print information about analog input status */ + for(int k = 0; k < OPTA_DIGITAL_IN_NUM; k++) { + uint16_t v = stsolidExp.analogRead(k); + printUint16(v); + Serial.print(" "); + /* this will return the voltage at the pin k in Volts + * we pass false as the last argument since we have + * just read the analog value with the previous analogRead */ + float V = stsolidExp.pinVoltage(k,false); + Serial.print("(" + String(V) + "V) "); + } + Serial.println(); + } + } + delay(1000); + +} +``` +The expansion object in the example above is defined using the `OptaController.getExpansion(i);` function, as follows: + +```arduino +for(int i = 0; i < 5; i++) { // check all the five available expansion slots + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); +} +``` +The above method will check if there is an Ext D1608E or Ext D1608S expansion connected in the `i` index from the five admitted. If any is found in the asked index, the expansion `mechExp` or `stsolidExp` turns to true. This will ensure which expansion the read value belongs to. + +After the Opta™ controller is programmed with the example sketch, open the Arduino IDE Serial Monitor and you will see each input voltage as follows: + +``` +Expansion[0]: type DIGITAL [Mechanical], I2C address: 11 + 4320 (7.51V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) 0 (0.00V) +``` + +![Analog Input wiring example](assets/analog-inputs.png) + +### Outputs + +The Opta™ Expansions have **8 relay outputs** accessible through terminals pairs `1` to `8`. + +![Opta Digital Expansions outputs](assets/variants-emr-ssr-new.png) + +The **Ext D1608E (EMR)** variant features 8 electromechanical relays with the following characteristics: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacteristicsDetails
Number of outputs8x Electromechanical Relays (Normally Open - SPST)
Max current per relay6A
Max peak current per relay10A
Continuous current per terminal6A
Short-circuit protectionNo, external fuse required
Relay rated voltage250 VAC
Relay Max voltage400 VAC
Rated load AC11500 VA
Rated load AC15 (230 VAC)300 VA
Breaking capacity DC1: 24/110/220V6/0.2/0.12A
Minimum switching load500mW (12V/10mA)
Max output line length (unshielded)100 m
Relay response time from state 0 to state 15 ms for relay output
Relay response time from state 1 to state 03 ms for relay output
Bounce time NO1 ms
Bounce time NC6 ms
Relay mechanical durability10 million cycles (DC)
Relay electrical durability60 thousand cycles with a resistive load (AC1)
+ +The **Ext D1608S (SSR)** variant features 8 solid state relays with the following characteristics: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacteristicsDetails
Number of outputs8x Solid State Relays (Normally Open - SPST)
Max current per relay2A
Max peak current per relay50A (10 ms)
Continuous current per terminal2A
Short-circuit protectionNo, external fuse required
Relay rated voltage24 VDC
Switching voltage range1.5...30 VDC
Maximum blocking voltage33 VDC
Rated load DC1336 W
Minimum switching current1 mA
Max "OFF-state" leakage current0.001 mA
Max "OFF-state" voltage drop0.4 V
Relay response time from state 0 to state 10.02 ms for relay output
Relay response time from state 1 to state 00.2 ms for relay output
Electrical life at rated load> 10 million cycles
+ +The state of an output terminal, in the Ext D1608S or Ext D1608E variant, can be set using the built-in function `digitalWrite()` as shown below: + +```arduino +.digitalWrite(, ); +``` +The following example will let you control all the relay outputs of every expansion connected at once, it can be found in the Opta Digital Expansions library by navigating to **File > Examples > Arduino_OptaBlueprint > setDigital**: + +```arduino +#include "OptaBlue.h" + +using namespace Opta; + +/* -------------------------------------------------------------------------- */ +void printExpansionType(ExpansionType_t t) { +/* -------------------------------------------------------------------------- */ + if(Serial) { + if(t == EXPANSION_NOT_VALID) { + Serial.print("Unknown!"); + } + else if(t == EXPANSION_OPTA_DIGITAL_MEC) { + Serial.print("DIGITAL [Mechanical]"); + } + else if(t == EXPANSION_OPTA_DIGITAL_STS) { + Serial.print("DIGITAL [Solid State]"); + } + else if(t == EXPANSION_DIGITAL_INVALID) { + Serial.print("DIGITAL [!!Invalid!!]"); + } + else if(t == EXPANSION_OPTA_ANALOG) { + Serial.print("ANALOG"); + } + else { + Serial.print("Unknown!"); + } + } +} + +/* -------------------------------------------------------------------------- */ +void printExpansionInfo(uint8_t index, ExpansionType_t type, uint8_t i2c_address) { +/* -------------------------------------------------------------------------- */ + if(Serial) { + Serial.print("Expansion[" + String(index) + "]:"); + Serial.print(" type "); + printExpansionType(type); + Serial.print(", I2C address: "); + Serial.println(i2c_address); + } + +} + +/* -------------------------------------------------------------------------- */ +/* SETUP */ +/* -------------------------------------------------------------------------- */ +void setup() { + + Serial.begin(115200); + delay(2000); + + OptaController.begin(); +} + + +/* -------------------------------------------------------------------------- */ +/* LOOP */ +/* -------------------------------------------------------------------------- */ +void loop() { + + OptaController.update(); + + static long int start_m = millis(); + static bool st = true; + /* non blocking delay, this will run every 1000 ms */ + if(millis() - start_m > 500) { + start_m = millis(); + + for(int i = 0; i < OPTA_CONTROLLER_MAX_EXPANSION_NUM; i++) { + /* ask for a digital expansion + * just one of these will be a valid expansion */ + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); + /* always check for the validity of the expansion */ + if(mechExp) { + /* get and print information about expansion */ + printExpansionInfo(mechExp.getIndex(), mechExp.getType(), + mechExp.getI2CAddress()); + + /* this implement 2 states in the first one + * pin 0 2 4 6 are turned off and pin 1 3 5 7 are turned on */ + if(st) { + mechExp.digitalWrite(0,LOW); //turn off pin 0 + mechExp.digitalWrite(1,HIGH); //turn on pin 1 + mechExp.digitalWrite(2,LOW); //turn off pin 2 + mechExp.digitalWrite(3,HIGH); //turn on pin 3 + mechExp.digitalWrite(4,LOW); //turn off pin 4 + mechExp.digitalWrite(5,HIGH); //turn on pin 5 + mechExp.digitalWrite(6,LOW); //turn off pin 6 + mechExp.digitalWrite(7,HIGH); //turn on pin 7 + + /* once all pin are set send the new status to the + * expansion */ + mechExp.updateDigitalOutputs(); + + /* pin status can be sent to the expansion also setting the + * last parameter of digitalWrite to true (default is false) + * however this involves a lot of unnecessary I2C transaction */ + } + else { + /* in the second state + * pin 0 2 4 6 are turned on and pin 1 3 5 7 are turned off */ + mechExp.digitalWrite(0,HIGH); //turn off pin 0 + mechExp.digitalWrite(1,LOW); //turn on pin 1 + mechExp.digitalWrite(2,HIGH); //turn off pin 2 + mechExp.digitalWrite(3,LOW); //turn on pin 3 + mechExp.digitalWrite(4,HIGH); //turn off pin 4 + mechExp.digitalWrite(5,LOW); //turn on pin 5 + mechExp.digitalWrite(6,HIGH); //turn off pin 6 + mechExp.digitalWrite(7,LOW); //turn on pin 7 + + /* once all pin are set send the new status to the + * expansion */ + mechExp.updateDigitalOutputs(); + + /* pin status can be sent to the expansion also setting the + * last parameter of digitalWrite to true (default is false) + * however this involves a lot of unnecessary I2C transaction */ + } + } + + + /* always check for the validity of the expansion */ + if(stsolidExp) { + /* get and print information about expansion */ + printExpansionInfo(stsolidExp.getIndex(), stsolidExp.getType(), + stsolidExp.getI2CAddress()); + + /* if present state solid expansion will use a different pattern */ + if(st) { + stsolidExp.digitalWrite(0,HIGH); + stsolidExp.digitalWrite(1,LOW); + stsolidExp.digitalWrite(2,LOW); + stsolidExp.digitalWrite(3,HIGH); + stsolidExp.digitalWrite(4,HIGH); + stsolidExp.digitalWrite(5,LOW); + stsolidExp.digitalWrite(6,LOW); + stsolidExp.digitalWrite(7,HIGH); + + /* once all pin are set send the new status to the + * expansion */ + stsolidExp.updateDigitalOutputs(); + + /* pin status can be sent to the expansion also setting the + * last parameter of digitalWrite to true (default is false) + * however this involves a lot of unnecessary I2C transaction */ + } + else { + /* in the second state + * pin 0 2 4 6 are turned on and pin 1 3 5 7 are turned off */ + stsolidExp.digitalWrite(0,LOW); + stsolidExp.digitalWrite(1,HIGH); + stsolidExp.digitalWrite(2,HIGH); + stsolidExp.digitalWrite(3,LOW); + stsolidExp.digitalWrite(4,LOW); + stsolidExp.digitalWrite(5,HIGH); + stsolidExp.digitalWrite(6,HIGH); + stsolidExp.digitalWrite(7,LOW); + + /* once all pin are set send the new status to the + * expansion */ + stsolidExp.updateDigitalOutputs(); + } + } // if(stsolidExp[i]) { + } + if(st) { + st = false; + } + else { + st = true; + } + } +} +``` +The expansion object in the example above is defined using the `OptaController.getExpansion(i);` function, as follows: + +```arduino +for(int i = 0; i < 5; i++) { // check all the five available expansion slots + DigitalMechExpansion mechExp = OptaController.getExpansion(i); + DigitalStSolidExpansion stsolidExp = OptaController.getExpansion(i); +} +``` +The above method will check if there is an Ext D1608E or Ext D1608S expansion connected in the `i` index from the five admitted. If any is found in the asked index, the expansion `mechExp` or `stsolidExp` turns to true. This will ensure which expansion is going to be controlled. + +First, the desired relay states need to be defined with the `digitalWrite()` function, then with the `.updateDigitalOutputs()` the states are sent to the expansion to control the relays with the defined states. + +After the Opta™ controller is programmed with the example sketch, the relays of your expansions will be controlled as follows: + +![Opta Digital Expansion outputs control demo](assets/outputs-animation.gif) + +Here is an example of how to connect an AC load to the Opta Digital Ext D1608E (EMR): + +![EMR expansion wiring example](assets/emr-output.png) + +Here is an example of how to connect a DC load to the Opta Digital Ext D1608S (SSR): + +![SSR expansion wiring example](assets/ssr-output.png) + +You can buy and find more information about the Opta™ Digital Expansions on the links below: + +- [Opta™ Digital Expansion Product Page](https://docs.arduino.cc/hardware/opta-digital-ext) +- [Buy the Opta™ Digital Ext D1608E (EMR)](https://store.arduino.cc/products/Opta-Ext-D1608E) +- [Buy the Opta™ Digital Ext D1608S (SSR)](https://store.arduino.cc/products/Opta-Ext-D1608S) + ## Support If you encounter any issues or have questions while working with Opta™ devices, we provide various support resources to help you find answers and solutions. diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/animation.gif b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/animation.gif new file mode 100644 index 0000000000..a659f6efab Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/animation.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/demo.gif b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/demo.gif new file mode 100644 index 0000000000..b7195c31e8 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/demo.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-1.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-1.png new file mode 100644 index 0000000000..01cbe882b3 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-1.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-10.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-10.png new file mode 100644 index 0000000000..67056538d6 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-10.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-11.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-11.png new file mode 100644 index 0000000000..679eda7baf Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-11.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-12.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-12.png new file mode 100644 index 0000000000..627cf26623 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-12.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-2.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-2.png new file mode 100644 index 0000000000..c28d87c671 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-2.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-3.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-3.png new file mode 100644 index 0000000000..7ae3119932 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-3.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-4.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-4.png new file mode 100644 index 0000000000..63da4871b1 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-4.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-5.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-5.png new file mode 100644 index 0000000000..43f3d93910 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-5.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-6.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-6.png new file mode 100644 index 0000000000..8fde8c8d72 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-6.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-7.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-7.png new file mode 100644 index 0000000000..456ae54ee7 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-7.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-8.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-8.png new file mode 100644 index 0000000000..09fd4a138f Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-8.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-9.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-9.png new file mode 100644 index 0000000000..b1a6d79ac8 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/plc-ide-9.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/power-expansion.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/power-expansion.png new file mode 100644 index 0000000000..2be630c395 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/power-expansion.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/snapping.gif b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/snapping.gif new file mode 100644 index 0000000000..3949c3d461 Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/snapping.gif differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/wiring-ext.png b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/wiring-ext.png new file mode 100644 index 0000000000..2cbac4e31b Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/assets/wiring-ext.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/content.md b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/content.md new file mode 100644 index 0000000000..4da87cfb2d --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/content.md @@ -0,0 +1,217 @@ +--- +title: 'Opta™ Expansions Usage with the PLC IDE' +difficulty: beginner +description: "Learn how to use the Opta™ expansions to extend your solution capabilities with the Arduino® PLC IDE." +tags: + - Expansions + - IEC-61131-3 + - PLC-IDE + - Opta™ +author: 'Christopher Mendez' + +hardware: + - hardware/07.opta/opta-family/opta + - hardware/07.opta/opta-family/opta-digital-ext +software: + - plc-ide +--- + +## Overview +In this tutorial, you will learn how to use Opta™ Digital Expansions AFX00005 and AFX00006 alongside an Opta™ controller. + +![Final application showcase](assets/animation.gif) + +We will create a demo application from scratch, in which we will read the voltage from an analog sensor and control the expansion relay outputs based on the voltage level measured. + +## Goals + +- Learn how to use Opta™ Digital Expansions with the PLC IDE +- Learn how to enhance your Opta™ controller's capabilities using Opta™ expansions +- Leverage Arduino Pro products for real industrial applications + +## Hardware and Software Requirements + +### Hardware +- [Opta™](https://store-usa.arduino.cc/collections/opta-family) (x1) +- [AFX00005 - Opta Ext D1608E](https://store.arduino.cc/products/Opta-Ext-D1608E) (x1) +- [AFX00006 - Opta Ext D1608S](https://store.arduino.cc/products/Opta-Ext-D1608S) (x1) +- 12-24 VDC/0.5 A power supply (x1) +- [USB-C® cable](https://store-usa.arduino.cc/products/usb-cable2in1-type-c) (x1) + +### Software +- The [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide) + +## Instructions + +### Snapping the Expansion + +You can connect up to five expansions to your Opta™ controller module to multiply and diversify your I/O set with seamless detection. + +Remove the breakable plastic cover marked as AUX from the expansion port on the Opta™ controller and the expansion module to expose the ports. + +Attach the expansions to the right side of your Opta™ controller. Ensure that the **Aux connector** and the connection clips are correctly aligned, as shown in the image below: + +![Snapping Opta™ expansions](assets/snapping.gif) + +The expansions must be powered externally in order to be detected and properly work. + +![Powering the expansions](assets/power-expansion.png) + +### Solution Wiring + +The following wiring setup will be used for the solution explained in this tutorial. + +![Solution example wiring](assets/wiring-ext.png) + +- In the **Opta™**, connect the power supply to the respective inputs on the screw terminals. +- From the **Opta™** power screw terminals, wire the power to the Opta™ expansion. +- Connect the sensor output to the **I1** input of the Opta™ expansion, specifically the variable tap of the potentiometer. +- Power the sensor using its respective power source, which in this case is the power screw terminals of the expansion. + +### Opta™ Micro PLC Setup + +After downloading the [PLC IDE](https://www.arduino.cc/en/software#arduino-plc-ide), follow the installation process from the following [guide](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/). + +Open the PLC IDE and create a new project for the Opta™. + +![New project for the Opta™](assets/plc-ide-1.png) + +Connect the Opta controller to your PC using a USB-C® cable. Then, upload the runtime for Opta™ by selecting its Serial Port and clicking on the **Download** button. + +![Uploading the runtime to the Opta™](assets/plc-ide-2.png) + +Once the runtime is flashed, navigate to **On-line > Set up communication**. With the **Modbus** protocol selected, open its properties and select the new virtual serial port (different from the one used in the previous step). Click "OK" to confirm. + +![Opta™ communication setup](assets/plc-ide-3.png) +![Opta™ serial port selection](assets/plc-ide-4.png) + +***Modbus is the default serial protocol used to communicate the Opta™ with the PC.*** + +Next, click the **Connect** button in the upper left corner and wait for the base program to upload. A green **Connected** flag will appear in the lower right corner if the connection is successful. + +![Connecting the board](assets/plc-ide-5.png) + +***The Opta™ is pre-licensed, meaning no additional license purchase is required for use with the PLC IDE.*** + +If the Opta™ status displays **No License**, click the **Activate PLC runtime** button to activate it. For more details, refer to this [guide](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license/#7-license-activation-with-pre-licensed-products-opta). + +### Solution Setup + +To enable the Opta™ Digital Expansion features in the PLC IDE, navigate to the **Resources** tab and select **I/O Expansions** in the configuration tree. Then click **Scan** to allow the IDE to search for connected expansions. + +![Scanning for expansions](assets/plc-ide-6.png) + +Once the available expansion appears in the **Detected config** column, enable it by clicking on **Apply detect config**. Verify that the **Project config** column is updated. + +![Adding the expansion to the environment](assets/plc-ide-7.png) + +To set up the sensor input for the potentiometer, navigate to **Programmable Inputs** under your desired expansion in the left resources menu. Define a **variable** name, **sensor** in this case, and set the **IOType** to **Analog**. + +![Setting up the sensor input](assets/plc-ide-8.png) + +To set up the Opta™ expansion outputs, proceed to **Relay Outputs** under your desired expansion in the left resources menu. In this instance, define **variable** names for each output, **out_1** to **out_8**. + +![Setting up the relay outputs](assets/plc-ide-9.png) + +For the main code of our solution, navigate to the **Project** tab in the left panel, select **Main** in the project tree, and right-click on the **Local variables** window to insert some variables. + +![Configuring the main project](assets/plc-ide-10.png) + +Insert the following three variables with their respective _type_ and _attribute_: + +| Name | Type | Init value | Attribute | +|-------|------|------------|-----------| +| VSTEP | REAL | - | - | +| VCC | REAL | 12 | CONSTANT | +| VIN | REAL | - | - | + +![Defining the local variables](assets/plc-ide-11.png) + +- **VSTEP** will store the voltage step threshold to activate the relay outputs sequentially. +- **VCC** is a constant representing the 12 VDC used to power the Opta™ Digital Expansion. +- **VIN** will store the voltage read at the sensor input. + +Copy and paste the following sketch to the **Main code** text editor: + +``` +VSTEP := VCC/8; + +VIN := sensor*1.733E-3; + +IF VIN >= VSTEP*1 THEN + out_1 := TRUE; +ELSE + out_1 := FALSE; +END_IF; + +IF VIN >= VSTEP*2 THEN + out_2 := TRUE; +ELSE + out_2 := FALSE; +END_IF; + +IF VIN >= VSTEP*3 THEN + out_3 := TRUE; +ELSE + out_3 := FALSE; +END_IF; + +IF VIN >= VSTEP*4 THEN + out_4 := TRUE; +ELSE + out_4 := FALSE; +END_IF; + +IF VIN >= VSTEP*5 THEN + out_5 := TRUE; +ELSE + out_5 := FALSE; +END_IF; + +IF VIN >= VSTEP*6 THEN + out_6 := TRUE; +ELSE + out_6 := FALSE; +END_IF; + +IF VIN >= VSTEP*7 THEN + out_7 := TRUE; +ELSE + out_7 := FALSE; +END_IF; + +IF VIN >= VSTEP*8 THEN + out_8 := TRUE; +ELSE + out_8 := FALSE; +END_IF; +``` + +Compile the project by clicking on the compilation button found in the upper left corner of the IDE. If no errors are shown, upload the program to the Opta™ controller by clicking the upload button highlighted next to it. + +![Main program in structured language](assets/plc-ide-12.png) + +You can monitor the project variables in real-time while the project is running by dragging and dropping the desired variables from the left project panel to the **Watch** window: + +![Live variable monitoring](assets/demo.gif) + +Finally, your solution is ready. The Opta™ expansion relay outputs will activate sequentially as the sensor output increases. + +Turn the potentiometer and observe how the **VIN** variable displays the voltage being read. The outputs activate as their respective thresholds are reached: + +![Final application showcase](assets/animation.gif) + +### Conclusion + +In this tutorial, you have learned how to use an Opta™ Digital Expansion by demonstrating a simple application that reads an analog input and controls the expansion relay outputs. + +As you can see, the configuration process is straightforward, and the results are as expected. This serves as an excellent starting point for adapting the techniques covered here to develop your professional solutions. + +#### Next Steps + +Extend your knowledge about the Opta™ controller and the PLC IDE by following these tutorials: + +- [Arduino PLC IDE Setup & Device License Activation](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license/) +- [Programming Introduction with Arduino PLC IDE](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-programming-introduction/) +- [Tank Level Monitoring with the Opta™](https://docs.arduino.cc/tutorials/opta/tank-level-app-note/) +- [Modbus TCP with Portenta Machine Control & Opta™](https://docs.arduino.cc/tutorials/portenta-machine-control/pmc-opta-modbus-tcp/) diff --git a/content/software/plc-ide/tutorials/opta-expansions-plc-ide b/content/software/plc-ide/tutorials/opta-expansions-plc-ide new file mode 100644 index 0000000000..79c4039dd3 --- /dev/null +++ b/content/software/plc-ide/tutorials/opta-expansions-plc-ide @@ -0,0 +1 @@ +../../../hardware/07.opta/opta-family/opta/tutorials/17.opta-expansions-plc-ide/ \ No newline at end of file