Hello Josh,
Nice to hear from you. Here are answers for your questions:
Question 1:
My PC 1.8GHz Intel Pentium 4 512MB of RAM
operating system WINDOW XP
VMEcrate 5 slots VME crate from
Solflower Computer Inc.
VMEController VME-MXI-2
Question 2:
PC and VME controller connected via MXI-2 cable
with "MXI-2" card (sorry I do not know the name
of the card which installed at PC).
Question 3:
NI-VISA 2.5.2
NI-VXI 3.2
I did not use NI-DAQ
Question 4:
No error is returned when VXIpeek is excuted
Question 5:
It depends on the VME address (card?). For my card
it occurs at 2x10-5 level. It seems it occurs more
often when VME controller is accessed.
Question 6:
I have not used NI-Spy. I am afraid that NI-Spy may
cause additional delay for VXIpeek due to competation
of CPU. If you think that it will help, I could try
to provide NI-Spy file for you. But you have to tell
me how to do it. Thanks.
Question 7:
Yes, the problem can be repoduced by using a small
code. See attachment. I did not try with VXI
interactive Control where I may unable to get time
information.
Question 8:
Yes, I have removed all cards and only left VME
controller, the problem is still there. See the
results of attachment where only VME controller is
installed in the VME crate.
Sorry, I was unable to add attachment. The code and
output are listed belew:
int main(int argc, char *argv[])
{
int initial;
///////////////////////////////
uint32 timeout, trlWindow, count, i, resp;
int16 status;
double time0, time1, timeDiff;
void *trlAddr;
///////////////////////////////
// Needed if linking in external compiler; harmless otherwise out of memory
if (InitCVIRTE(0, argv, 0) == 0) return -1;
// Initializes VXIlibrary, allows handling of VXI reads and writes
initial = InitVXIlibrary();
if (initial < 0) {
MessagePopup("MiniDAQ Error", "VXI library initialization failed.");
return (1);
}
SetSleepPolicy(VAL_SLEEP_NONE);
////////////////////////////////
count = 0;
timeout = 1000L; // Timeout of 1 second
//trlAddr = (void *)MapVXIAddress(0x3, 0x40, timeout, &trlWindow, &status);
trlAddr = (void *)MapVXIAddress(0x3, 0x800000, timeout, &trlWindow, &status);
printf("trlWindow = %u status = %d\n", trlWindow, status);
//Timing Check
time0 = Timer();
for(i = 0; i < 10000000; i++) {
VXIpeek(trlAddr, 2, &resp);
time1 = Timer();
timeDiff = time1 - time0;
if(timeDiff >= 0.002) {
printf("i = %u timeDiff = %f\n", i, timeDiff);
count++;
time0 = Timer();
if (count > 100) break;
}
else time0 = time1;
}
printf("count = %u # VXIpeek calls = %u\n", count, i);
UnMapVXIAddress(trlWindow);
return 0;
}
Output of above program is following, where the unit of timeDiff is in second
as one can see, sometimes it takes few ms to excute VXIpeek
trlWindow = 0 status = 0
i = 4311 timeDiff = 0.003000
i = 9292 timeDiff = 0.005000
i = 18710 timeDiff = 0.004000
i = 41546 timeDiff = 0.004000
i = 64712 timeDiff = 0.003000
i = 87550 timeDiff = 0.004000
i = 94511 timeDiff = 0.004000
...
i = 507335 timeDiff = 0.002000
i = 511628 timeDiff = 0.002000
i = 520272 timeDiff = 0.005000
i = 522846 timeDiff = 0.003000
i = 524782 timeDiff = 0.013000
i = 528826 timeDiff = 0.009000
i = 530637 timeDiff = 0.003000
i = 547681 timeDiff = 0.004000
i = 556325 timeDiff = 0.004000
i = 560569 timeDiff = 0.012000
count = 101 # VXIpeek calls = 560569
Tiesheng