2 / 2 6 / 2 0 0 2 2 : 0 6 P M 2 / 2 6 / 2 0 0 2
1 2 5
N M I L - 7 0 0 1 1 6 - C H A N N E L O P T O O U T P U T
C S A M P L E P R O G R A M
#include c:\NMIY0031\clib\common51.c
#include c:\NMIY0031\clib\syslib51.c
#include c:\NMIY0031\clib\stdio.h
#include c:\NMIY0031\clib\atoi.c
#include c:\NMIY0031\clib\fgetc.c
#include c:\NMIY0031\clib\fprintf.c
#include c:\NMIY0031\clib\fputc.c
#include c:\NMIY0031\clib\fscanf.c
#include c:\NMIY0031\clib\is.c
#include c:\NMIY0031\clib\itoa.c
#include c:\NMIY0031\clib\itoab.c
#include c:\NMIY0031\clib\peekpoke.c
#include c:\NMIY0031\clib\reverse.c
#include c:\NMIY0031\clib\strlen.c
#include c:\NMIY0031\clib\ungetc.c
#include c:\NMIY0031\clib\utoi.c
#define PORTA 0xFFE0
#define PORTB 0xFFE1
int porta_out, portb_out;
/***************************************************************************/
/*
*/
/* Program to interface the NMIL-7001 16-Channel OPTO
*/
/* Output Card with the NMIY-0031. The NMIL-0031 COM1
*/
/* port is used to allow the user to set the values of the
*/
/*
OPTO
outputs.
*/
/*
*/
/* Outputs are inverted and polarized. For example, when
*/
/* a value of '55' is output, even numbered outputs turn on
*/
/* odd numbered outputs turn off. Be certain you have the
*/
/* correct polarity connection for each output also. Out-
*/
/* put connections with the wires reversed will not appear
*/
/* to be on when they should be. If a particular output
*/
/* does not seem to turn on, be sure to check the hookup
*/
/* polarity as well as the external power for the output.
*/
/* As with all opto output devices, the output power must
*/
/* be supplied externally.
*/
/*
*/
/***************************************************************************/
main ()
{
while (1)
{
get_user_data();
output();
};
/* end while */
}
/* end main */
get_user_data()
{
printf("\n\nNMIL-7001 outputs are inverted. Setting a bit to 1\n");
printf("turns the output off, setting a bit to 0 turns the\n");
printf("corresponding output on.\n\n");
printf("Please enter a hex value for port A output: ");
fscanf(stdin, "%x", &porta_out);
printf("Please enter a hex value for port B output: ");
fscanf(stdin, "%x", &portb_out); printf("\n");
}
/* end get user data */
output() { pokeb(PORTA, porta_out); pokeb(PORTB, portb_out); }
Summary of Contents for NMIY-0031
Page 1: ...2 2 6 2 0 0 2 2 0 6 P M 1 NMIY 0031 Single Board Computer Covers NMIY 0031 V1 0 4 22 96 ...
Page 2: ...2 2 6 2 0 0 2 2 0 6 P M 2 ...
Page 6: ...2 2 6 2 0 0 2 2 0 6 P M 6 ...
Page 8: ...2 2 6 2 0 0 2 2 0 6 P M 8 ...
Page 14: ...2 2 6 2 0 0 2 2 0 6 P M 1 4 ...
Page 30: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 0 ...
Page 32: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 2 ...
Page 50: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 0 ...
Page 52: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 2 ...
Page 54: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 4 ...
Page 56: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 6 ...
Page 58: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 8 ...
Page 60: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 0 ...
Page 62: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 2 ...
Page 68: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 8 ...
Page 70: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 0 ...
Page 72: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 2 ...
Page 76: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 6 ...
Page 82: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 2 ...
Page 84: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 4 ...
Page 86: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 6 ...
Page 88: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 8 ...
Page 90: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 9 0 ...
Page 102: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 2 ...
Page 108: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 8 ...
Page 110: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 0 ...
Page 114: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 4 ...
Page 118: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 8 ...
Page 126: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 6 ...
Page 128: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 8 ...
Page 134: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 3 4 ...
Page 148: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 4 8 ...
Page 150: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 0 ...
Page 152: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 2 ...
Page 154: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 4 ...
Page 156: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 6 ...
Page 168: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 6 8 ...
Page 170: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 0 ...
Page 172: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 2 ...
Page 174: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 4 ...
Page 178: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 8 ...