Moxa V2426A-C7 [32/88] Example 1 2 main routines and callbacks to operate timer

Moxa V2426A-C7-CT-T [32/88] Example 1 2 main routines and callbacks to operate timer
V2400A Series Expansion Modules Software Installation and Programming Guide
4-12
}
dgio_input_change_release(mngr);
}
Example 1-2: (Main Routines and Callbacks to Operate Timer
Functions on Digital IO Ports.)
Folder and file: /examples/ExpansionCard/LX/EPM3438/digit_input_change/main.c
#include <stdio.h>
#include <stdlib.h>
#include "digit_io_timer.h"
static int
input_chg_cb(int HWIndex, int port, int sig, void *arg)
{
printf("input_chg_cb() HWIndex %d port %d sig %d\n", HWIndex, port, sig);
return 0;
}
static int
input_get_cb(int HWIndex, int port, int sig, void *arg)
{
printf("input_get_cb() HWIndex %d port %d sig %d\n", HWIndex, port, sig);
return 0;
}
static int
output_set_cb(int HWIndex, int port, int last_sig, void *arg)
{
printf("output_set_cb() HWIndex %d port %d last sig %d\n", HWIndex, port,
last_sig);
last_sig++;
last_sig %= 2;
printf("new sig=%d\n", last_sig);
return last_sig;
}
static int
output_get_cb(int HWIndex, int port, int sig, void *arg)
{
printf("output_get_cb() HWIndex %d port %d sig %d\n", HWIndex, port, sig);
return 0;
}
#define INTERVAL 10000
int
#if defined(_WIN32_WCE)
WINAPI
WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int
nCmdShow )
#else
main(int argc, char *argv[])
#endif
{
DGIOMNGR *mngr;
int HWIndex;
int port;
int interval;

Содержание

Скачать