User`s manual
Table Of Contents
- 1. Introduction
- 2. Getting Started
- Starting Your UC-7400-CE Computer
- Resetting Your UC-7400-CE Computer
- Operating UC-7400-CE Computer Via Serial Console
- Changing the Network Settings
- Operating Your UC-7400-CE Computer Via Telnet Client
- User/Group Management
- Adjusting System Time and RTC Time
- Starting and Stopping Services
- Troubleshooting Network Connectivity
- Simple Network Management Protocol (SNMP)
- 3. Web-based Management System
- 4. Application Development
- 5. Programming Examples
- A. Operating Programmable Function Keys and LCM
- B. Firmware Upgrade Procedure
- C. Service Information

UC-7400-CE User’s Manual Programming Examples
5-6
Example #3—Digital I/O
The UC-7408-CE computer supports 8 programmable digital input channels and 8 programmable
digital output channels for your applications. These IO channels can be accessed at run-time via
the following APIs.
/* this function initialize a connection to the devices. It must be called before you
call other functions
On success, it returns a handle. Otherwise, it return NULL
*/
HANDLE mxdio_init(void);
/* this function requests the system to detect a low-to-high or high-to-low event on
a specified input port every tick_slot milliseconds. On success, it returns 0.
<hndl> handle created by mxdio_init
<port> port number 0~7
<handler> callback function with prototype (unsigned int, unsigned int, unsigned
int)
<low_high> macro DIN_EVENT_LOW_TO_HIGH or DIN_EVENT_HIGH _TO _LOW
<tick_slot> 10 milliseconds minimal
*/
int mxdio_set_input_event( HANDLE hndl,
unsigned int port,
mxdio_input_cb handler,
unsigned int low_high,
unsigned int tick_slot);
/* this function starts a dispatcher to handle events.
<hndl> handle created by mxdio_init
Return non-zero to abort.
*/
int mxdio_dispatch(HANDLE hndl);
/* this function set a digit level for a specified output port
<hndl> handle created by mxdio_init
<port> port number 0~7
<data> 0 or 1
*/
int mxdio_set_dout(HANDLE hndl, unsigned int port, unsigned int
data);