Docsity

ECET 456 Lab: Distributed System Design with Multiprocessing - USB-1024LS App, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
Purdue University Calumet Department of Electrical and Computer Engineering Technology
ECET 456 Distributed System Design with Multiprocessing
Page 1 of 4
Lab #5-B
Lab Objective:
Design an application program for PC. The program is to demonstrate the interface between
measurement computing’s USB-1024LS board and PC.
The task is to receive 8 bit input from digital trainer into port B and display on the
monitor.
Print the poem (8 lines), If nth bit is ‘0’, omit the nth line or if nth bit is ‘1’ print the nth
line.
And output the data value on port A also.
Schematic:
D1 D2 D3 D4 D5 D6 D7 D8
0
KEYBOARD
PC
USB
USB-1024LS
DIGITAL TRAINER
PORT B
PORT A
pf3
pf4

Partial preview of the text

Download ECET 456 Lab: Distributed System Design with Multiprocessing - USB-1024LS App and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

ECET 456 Distributed System Design with Multiprocessing

Lab #5-B

Lab Objective:

Design an application program for PC. The program is to demonstrate the interface between measurement computing’s USB-1024LS board and PC.

The task is to receive 8 bit input from digital trainer into port B and display on the monitor.

Print the poem (8 lines), If nth bit is ‘0’, omit the nth line or if nth bit is ‘1’ print the nth line.

And output the data value on port A also.

Schematic:

D1 D2 D3 D4 D5 D6 D7 D

0

KEYBOARD

PC

USB

USB-1024LS

DIGITAL TRAINER

PORT B

PORT A

ECET 456 Distributed System Design with Multiprocessing

#include <iostream.h> #include <windows.h> #include <stdio.h> #include <conio.h> #include <iomanip.h> #include #include <C:\Program Files\Measurement Computing\Examples\C\cbw.h> #include <dos.h> //------------------------------------------------------------------------- void input( int ); void output (int); void print_poem(int *); //------------------------------------------------------------------------- void main (void)

{ int BoardNum = 0; int PortNum, Direction; int key ;

PortNum = FIRSTPORTB; Direction = DIGITALIN; cbDConfigPort (BoardNum, PortNum, Direction);

PortNum = FIRSTPORTA; Direction = DIGITALOUT; cbDConfigPort (BoardNum, PortNum, Direction); for(int i = 0 ; i<1 ; i++) { input(&key); print_poem(&key); cout <<key; output (&key); } //cout << "The loop is finished"; char c1; cin >> c1; }

//-------------------------------------------------------------------------

void input (int *pk1) {

ECET 456 Distributed System Design with Multiprocessing