


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



ECET 456 Distributed System Design with Multiprocessing
Lab #5-B
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
DIGITAL TRAINER
ECET 456 Distributed System Design with Multiprocessing
#include <iostream.h> #include <windows.h> #include <stdio.h> #include <conio.h> #include <iomanip.h> #include
{ 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