/
MATES
/ Modular Automatic Test Equipment System API
2.5.0.0
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
mates_test_34.c
#include <stdio.h>
#include "
mates.h
"
int
main(
void
)
{
char
buf[100];
int
val;
MATES_HANDLE
h1 =
mates_open
(
"proxy.mon"
, 1);
MATES_HANDLE
h2 =
mates_open
(
"missing.mon"
, 0);
mates_get_din_all
(h1,
mates_dio3_mk1_1
, &val);
int
idx = 0;
while
(
mates_get_last_error_ex
(h1, buf,
sizeof
(buf)) > 0)
{
/* Note: each message has a newline. */
printf(
"GET EX 1 #%04d: %s"
, idx++, buf);
}
/* Try empty handle. */
while
(
mates_get_last_error_ex
(NULL, buf,
sizeof
(buf)) > 0)
{
/* Note: each message has a newline. */
printf(
"GET EX 2 #%04d: %s"
, idx++, buf);
}
/* Try another handle. */
while
(
mates_get_last_error_ex
(h2, buf,
sizeof
(buf)) > 0)
{
/* Note: each message has a newline. */
printf(
"GET EX 3 #%04d: %s"
, idx++, buf);
}
mates_close
(h1);
mates_close
(h2);
return
(0);
}