This system should be fixed so that you do not have to enter the same information in before and after you log on!!!!
I am getting unusual results from the attached code in Labwindows cvi 7.1 using Traditional NI-DAQ with an AT-MIO-16E card. If I read the voltages one at a time using AI_Read (1, 0, 1, &bpoint); the results are as expected. However, if I read into an array using DAQ_Op (1, 0, 1, bdata, 100, 100.0); The values are much larger and go negative and positive. A program that ran fine under CVI 4.1, NIDAQ 6.8, and win 95 on the same machine ran fine, now it reads the wrong values.
John Bernard
#include
#include
#include
#include "DAQtest.h"
int mainhandle,i;
double vdata[1000],volt;
short bdata[1000], boardcode, bpoint;
/*======================== MAIN PROGRAM ======================================================*/
main()
{
mainhandle = LoadPanel (0, "DAQtest.uir", PANEL);
Init_DA_Brds (1, &boardcode);
DisplayPanel(mainhandle);
RunUserInterface();
}
int CVICALLBACK QuitCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event) {
case EVENT_COMMIT:
QuitUserInterface (0);
break;
case EVENT_RIGHT_CLICK:
break;
}
return 0;
}
int CVICALLBACK Start (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
short bpoint;
switch (event) {
case EVENT_COMMIT:
for(i=0;i100;i++){
AI_Read (1, 0, 1, &bpoint);
AI_VScale (1, 0, 1, 1.0, 0.0, bpoint, &volt);
// AI_VRead (1, 0, 1, &volt);
vdata[i]=volt;
bdata[i]=bpoint;
Delay(0.01);
}
// DAQ_Op (1, 0, 1, bdata, 100, 100.0);
// DAQ_VScale (1, 0, 10, 1.0, 0.0, 100, bdata, vdata);
// YGraphPopup ("Input Voltage", vdata, 100, VAL_DOUBLE);
YGraphPopup ("Input Voltage", bdata, 100, VAL_SHORT_INTEGER);
break;
case EVENT_RIGHT_CLICK:
break;
}
return 0;
}