4.4 - Descriptive text components for textual display (Applies to T-Series and UD-Series)
The variable value component is great for analog data, but less so for digital data where the only values are 0 and 1. For this, the Descriptive Text Component is useful to allow you to display a word or message for 0 and 1 instead.
To show this, let's use the "Output" D to A channel we created in the last chapter and pretend it is a digital channel.
1) On a page, right click and select Displays - Descriptive Text.
2) Once the new component is on the screen, right click on it and select Properties....
3) For the Expression type: Output[0]
4) By default, the component already will display the word "Text". Double-click on the word yellow highlighted word Text in the table at the bottom left of the properties to select it and replace it with the word Off.
This will cause the component to display the word Off when Output is 0.
5) Next, click on the Add button to create a new row in the table, and put 1 for the Threshold and On for the Text.
This will cause the component to display the word On when Output is 1. It doesn't matter what the order of the rows are in the table. DAQFactory will sort them once you close the window.
![](../__attachments/49514784/dfappguide-44-descriptivetext.png?inst-v=53c3afbe-b679-4ae4-ad8c-e895cddff14e)
6) Click OK. Then go to the command / alert window and type Output = 0 and hit Enter and watch the new component display Off. Type Output = 1 and hit Enter and the component will change to On.
DAQFactory actually provides a quicker way to set this up.
7) Right click on our text component and select Properties....
8) Click on the button towards the bottom right labeled Digital In. This will pop up a window requesting a channel. Type Output and click OK. Then click OK to close the properties.
This button essentially did steps 3 through 5 in one step. It also setup the colors so that Off displays in red, and On displays in green. Go ahead and type Output = 0 and Output = 1 in the Command / Alert window to watch it change.
As you may have noticed, there is also a button labeled Digital Out, which does almost the exact same thing as the Digital In button, except that it makes the descriptive text component into a clickable component that will toggle the output between 0 and 1. It does this by changing the component's Action. You can see this by clicking on the Action tab of the components properties. Feel free to create a new Descriptive Text component then go into the component's properties, click Digital Out, enter Output, then on closing simply click on the component to toggle Output instead of going to the command alert window.
Sample file: LJGuideSamples\DescriptiveText.ctl