[foxboro] AIMAPI
- From: "Schouten, Frits JF" <Frits.Schouten@xxxxxxxxxxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Fri, 19 Jun 2009 14:37:26 +1200
Hello listers,
Anyone care to share a example program that uses an_hist_values() in the
windoze environment?
Up till now I've not been able to get it to work.
I get -1 in ret and strangely I get 1013 returned as time.
This looks suspiciously like an error code (AN_INVALARG Null pointer as
argument or invalid argument.)
Where am I going wrong?
Here is the code snipped I use:
void get_hist_data(){
char hist[AN_DBNM_NPSIZ] = "k0hs02";
char aname[AN_DBNM_NPSIZ] = "";
char gname[AN_GPID_NPSIZ] = "common";
char colnam[AN_CNAM_NPSIZ] = "avg";
char pname[AN_PTID_NPSIZ] = "K01FCP_STA:STATION.MINUTE";
time_t start = 1245363934;
time_t end = 1245371143;
int direction = 0;
long numpts = 0;
long maxnum = 1;
int ret = 0;
long more = 0;
long actnum = 0;
float *value;
time_t *time;
int *status;
int reterr = 0;
value = calloc(maxnum, sizeof(float));
time = calloc(maxnum, sizeof(time_t));
status = calloc(maxnum, sizeof(float));
ret = an_hist_values(
hist, aname, gname, colnam, pname,
start, end, direction, numpts, maxnum, &more, &actnum,
value, time, status, &reterr);
printf("value: %f, ret:%i\n",value,ret);
}
NOTICE - This message and any attached files may contain information that is
confidential and intended only for use by the intended recipient. If you are
not the intended recipient or the person responsible for delivering the message
to the intended recipient, be advised that you have received this message in
error and that any dissemination, copying or use of this message or attachment
is strictly forbidden, as is the disclosure of the information therein. If you
have received this message in error please notify the sender immediately and
delete the message.
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
Other related posts:
- » [foxboro] AIMAPI - Schouten, Frits JF