Digital Inputs and Outputs
ECT274 Week 2 Lab A Page 2 of 7
Name: _________________ Grade: __________
Title: Introduction to ECT274 I/O Board
1. OBJECTIVES
Create an ARM project to control the LEDs on the ECT274 I/O board using virtual toggle switches on front panel.
1. DESCRIPTION
Eight switches will the placed on the front panel. These eight switches will independently light eight red LEDs on the I/O board. The IOBOARD Library will be used to output to the LEDs.
III. PROCEDURE
1. Create a folder with the following path C:\DeVry\ECT274\Week2\W2LA
2. Follow the steps in the Week 2 Lab A Tutorial to set up the VI for the I/O Board (steps 1-10 of the tutorial). Save the project as “FiLastNameLab2-A.lvproj” and the VI as “FiLastNameLab2-A.vi” to the folder created in step 1.
3. Switch to the front panel.
4. Add eight Boolean switches. Label the switches Bit 0–Bit 7 as shown below. The Boolean switches can be found on the Boolean palette.
Figure 1
6. Add a While loop. Right-click on the Loop Condition input, then select Create Control.
7. Add the IOBOARD Library VI inside the While loop. From the block diagram, right-click in the block diagram, then select “Select a VI...”, Select the ReadWriteIOBoard (SubVI).vi located in the C:\DEVRY\IOBOARD folder. As in tutorial, expand the icon to show all input/output ports.
Figure 2
8. Right-click on the Board Component input of the I/O Board icon and then Create Constant, as LEDs. If something else pops up, use the selector to change it to LEDs. Remember, this lab will write to LEDs.
9. Right-click on the Operation input of the I/O board icon and then Create Constant. Your VI should look similar to the figure below.
Figure 2
10. Now a binary-to-decimal conversion is needed. The I/O board input, Data To Board, is an unsigned 8-bit integer number. Therefore, eight individual bits need to combine into an 8-bit number. This will be done with an Insert Into Array function. The Insert Into Array function is located on the Array subpalette of the Programming palette.
Figure 3
11. Extend the bottom of the Insert Into Array to show eight new elements/subarrays as shown in figure below.
Figure 4
12. Wire the eight Boolean switches to the eight new element inputs of the Insert Into Array function.
Figure 5
13. Right-click on the array input of the Insert Into Array function, then select Create Constant.
14. Right-click on the index input of the Insert Into Array function, then select Create Constant.
Figure 6
15. Now, the array of Boolean is constructed. Next, the array will be converted to a number using the Boolean Array to Number function. The Boolean Array to Number function is located on the Boolean subpalette of the Programming palette. Place the Boolean Array to Number function on the block diagram.
16. Wire the output of the Insert Into Array function to the input of the Boolean Array to Number function.
17. Convert the number for the I/O board to unsigned 8-bit integer (U8) using the U8 conversion function. The U8 conversion function is located on the Numeric, Conversion subpalette of the Programming palette.
18. Complete the wiring of the VI by connecting the Boolean Array to Number to the U8 Conversion function.
19. Connect the output of the U8 Conversion function to the Data To Board input of the I/O board icon.
20. Add a half-second wait to the While loop. The Wait (ms) function is located on the Time, Dialog… subpalette of the Programming palette. Create a constant of 500 for an input of 500 ms or one half second.
21. The final VI is shown in Figure 7 below.
Figure 7
22. Save the project.
23. Connect power to the ARM I/O Board and the USB cable between the ARM Board and a USB port on your computer. Run the VI. When a Boolean switch on the front panel in on, the corresponding LED should go on. Verify VI and board operations.
24. Stop the program by pressing the Reset button on the ARM board or by pressing the Stop button on the front panel.
25. Exit LabVIEW.
26. From the project folder, zip the files with the following name and extensions into a folder and name it FiLastNameLab2-A.zip.
.aliases
.lvlps
.lvproj
.vi
27. Upload the zipped files to the appropriate Dropbox.
Note: Please zip only the four files shown above and not an associated folder that may be very large.
Modified by John Golzy 7/17/2013