KEPCO TMA VXI-27 User Manual
Page 73
F-2
TMA VXI-27 101602
/**************************************************************************
* Test Program for TMA VXI-27 using NI-VXI library *
**************************************************************************/
#include “c:\lw\include\formatio.h”
/* global variables */
char idn_buf[6],resp_buff[80],rp_buff[80];
int ret,ret_val1,cmmd,ret_val2,ret_val3,la_find,find_ret,slot,found,bb[12];
long prot_adr,vxi_adr,retcount;
int MySroute ; /* global variable for storing the routes */
int TestOk ;
void main (void)
{
int i,adr_tst,fit,value,ret_value,controller,retval,levels,retsignal;
long modemask,signalmask,retsignalmask,timeout;
cls();
/* Initializes the VXI library at the begining of the application */
if (InitVXIlibrary() != 0){
FmtOut(“\n **ERROR in InitVXIlibrary TEST STOPED”);
exit(0); /* error in InitVXIlibarry */
}
else
FmtOut(“ ***** TEST PROGRAM for the KEPCO TMA VXI-27 ****”);
/* Test INTERRUPT LINES status */
ret = GetVXIbusStatusInd (-2, 5, &value);
if (value)
FmtOut(“\n **ERROR ** INTERRUPTS ASSERTED”);
/* initialise TestOk variable */
TestOk = 1;
found=0;
fit = 0;
/* clear the table with all the TMA VXI-27 addresses found */
for (i=0;i<=11;i++)
bb[i] = 0;
for (i=0;i<80;i++){
resp_buff[i] = 0;
rp_buff[i] = 0;
}
/* search for the TMA VXI-27 (manufacturer code 3804 hex) in all slots */
for (slot=1; slot<=12; slot++){
find_ret = FindDevLA (““, 3804, -1, -1, slot, -1, -1, &la_find);
if (find_ret == 0){
FmtOut(“%s<\n** Address for TMA VXI-27 from slot %i[w2] is %i[w3] “
,slot,la_find);
bb[found] = la_find;
found++;
}
else
FmtOut(“%s< \nNot a TMA VXI-27 in slot %i[w2] “,slot);
}
if (found == 0)
FmtOut(“\n****NO BITBUS_INTERFACES FOUND IN THIS MAINFRAME”);