# Configuring Digital Outputs

To make a Local I/O Channel operate as a digital output, first click the channel in the sidebar to go to the channel settings view:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-0667df6ab5e38107743f7c5300b5bbf75715eefd%2Flocalhost_50000_channel_1%20(12).png?alt=media" alt=""><figcaption></figcaption></figure>

Then click **Digital Output** in the view that appears:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-3fea93a92232328591d1d7e7fc7332ff54468df4%2Flocalhost_50000_channel_1%20(21).png?alt=media" alt=""><figcaption></figcaption></figure>

Finally, click **Save**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-a402b3412e41f6e38114ff98a27896e9fc43939c%2Flocalhost_50000_channel_1%20(22).png?alt=media" alt=""><figcaption></figcaption></figure>

### Control Mode: Output a Tag

After the preceeding steps, we've configured Channel 1 to output a tag, but the configured tag (**channel1**) doesn't currently have a value (**Control Value: NA**), so the configured **Safe State** is being sent to the output:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-4cc921db36764c6bbcc368dc5e9f027f6c220e8c%2Flocalhost_50000_channel_1%20(26).png?alt=media" alt=""><figcaption></figcaption></figure>

This is because there's currently no source for the **channel1** tag, which is why Clarity Gateway reports **There is currently 1 mapping problem:**

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-0e98e2d365c6e189972060f622f3c5769ca6a4ea%2Flocalhost_50000_channel_1%20(27).png?alt=media" alt=""><figcaption></figcaption></figure>

If you click that link you'll see that **channel1** is listed under **Output Tags with no source** in the mapping problems view:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-3812201615f3972f18476f406d4e0027a1916cac%2Flocalhost_50000_channel_1%20(28).png?alt=media" alt=""><figcaption></figcaption></figure>

If you change the **Safe State** to **Output On** and click **Save**, the **Safe State** and **Raw Output** will change to **1**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-889b18430f3a80ff33171f8d8399e16bea298255%2Flocalhost_50000_channel_1%20(32).png?alt=media" alt=""><figcaption></figcaption></figure>

Let's configure Channel 1 to output the **channel2** tag, which is currently being set from Channel 2, which is configured as a digital input in this example. Go back to the settings for Channel 1 and change **Tag** to **channel2**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-9d67822dcacd2038990819f4d207742b2c30c5ce%2Flocalhost_50000_channel_1%20(29).png?alt=media" alt=""><figcaption></figcaption></figure>

Then click **Save**. After you do, you should see the arrow leading from the **Control Value** to the **Raw Output,** and **Raw Output** should have the same value as **Control Value**, which corresponds to the state of Channel 2 in the sidebar:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-8883684ed10dc4f5be249a27d986731de9af148b%2Flocalhost_50000_channel_1%20(33).png?alt=media" alt=""><figcaption></figcaption></figure>

You can also output values coming from other sources like Modbus, MQTT, and EtherNet/IP connections by setting the **Tag** to a connection channel's configured **System Tag**.

### Control Mode: Condition

This control mode allows you to use boolean logic on other tags to control the output value. For example, let's say **channel2** is a digital input, **channel3** is an analog input, and we want to output **1** when **channel2** is **1** or **channel3** is **> 5**.

First make sure **Tag** is **channel1**. The value determined by the condition will be written to this tag:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-61fa7d2200a34e9f616dc207aaaf1618e9e794c8%2Flocalhost_50000_channel_1%20(49).png?alt=media" alt=""><figcaption></figcaption></figure>

Then change the **Control Mode** to **Condition**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-c51a429c83e1118abde5516c0b23bcb32dd73c32%2Flocalhost_50000_channel_1%20(50).png?alt=media" alt=""><figcaption></figcaption></figure>

In the **Control Logic** table that appears, click **Add Condition**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-ab6aef5b59dac2638885543c26fbf763cfa2bebf%2Flocalhost_50000_channel_1%20(41).png?alt=media" alt=""><figcaption></figcaption></figure>

In the row that appears below, enter **channel2** for the tag:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-8a1e99260ebce1da808c851620dbe5de24c90705%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

And **= 1** in the following fields:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-31f03bfb76284c4d11744f64e541885c47b3bd70%2Flocalhost_50000_channel_1%20(42).png?alt=media" alt=""><figcaption></figcaption></figure>

Now we need to add the condition for **channel3**. Click **Add Condition** again:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-ab75a6b565c4463c5c50d7e8931a2f36c8ffe173%2Flocalhost_50000_channel_1%20(43).png?alt=media" alt=""><figcaption></figcaption></figure>

In the second row will appear with an **AND** operator:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-2245b419cb1dab6972cb2644ecbe78e6a6dfa765%2Flocalhost_50000_channel_1%20(44).png?alt=media" alt=""><figcaption></figcaption></figure>

Change this to **OR**, and enter **channel3 > 5** in the following fields:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-97d3e8c206d6146c36aef91ce842037443685a18%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Finally, click **Save**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-a65cf6b5cce31d2706321ace8eb9b429bb1e9560%2Flocalhost_50000_channel_1%20(45).png?alt=media" alt=""><figcaption></figcaption></figure>

The following screenshots show how the **Control Value** and **Raw Output** now apply this control logic:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-12fcb4ac0de95ccec8465ae409e83f04487720ad%2Flocalhost_50000_channel_1%20(47).png?alt=media" alt=""><figcaption><p><strong>channel2 = 0, channel3 &#x3C;= 5</strong></p></figcaption></figure>

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-eb5ec1fc41136dc5c261b8d54037eb44e1603686%2Flocalhost_50000_channel_1%20(46).png?alt=media" alt=""><figcaption><p><strong>channel2 = 1</strong></p></figcaption></figure>

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-fbe93813ad0e278bcff6cf88546bd4f857852aa1%2Flocalhost_50000_channel_1%20(48).png?alt=media" alt=""><figcaption><p><strong>channel3 > 5</strong></p></figcaption></figure>

### Control Mode: Force Off/Force On

These modes force the **Control** **Value** to be **0** or **1** and don't read or write any tags.

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-086920f4c2a6893a880209ee0fd0df439c1662d7%2Flocalhost_50000_channel_1%20(51).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-4b0858322fcd86a236a9bc0accc160666fe5c781%2Flocalhost_50000_channel_1%20(52).png?alt=media" alt=""><figcaption></figcaption></figure>

Note that **Reversed Polarity** can still cause the **Raw Output** to be the opposite of the **Control Value**:

<figure><img src="https://1557066017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSPy42kVbNL57hubF20gF%2Fuploads%2Fgit-blob-eb749beff58fa64f1121797cb9d7f3f3cf0304f4%2Flocalhost_50000_channel_1%20(53).png?alt=media" alt=""><figcaption></figcaption></figure>
