Moxa DA-685-W7E [36/38] The led control sample code
![Moxa DA-685-W7E [36/38] The led control sample code](/views2/1199145/page36/bg24.png)
DA-685 / W7E Sample Code for DA-685 Customization
A-4
The LED Control Sample Code
Below we reproduce the LED control code. This is a simple code that users may freely modify this code to suit
their needs.
/* Copyright (C) MOXA Inc. All rights reserved.
This software is distributed under the terms of the
MOXA License. See the file COPYING-MOXA for details.
*/
#include "stdafx.h"
#include <windows.h>
#include "..\\Include\\mxdev.h"
#define LED_PORT_NUMBER 8
int _tmain(intargc, _TCHAR* argv[])
{
HANDLE hLedDev;
intport_no;
int data;
intnLED = 0;
intnRet = 0;
int port = 0;
int mode = 0;
int n = 0;
TCHAR sin;
TCHAR smode;
_tprintf(_T("LED Test Program\r\n"));
_tprintf(_T("\t (0) Exit Program\r\n"));
_tprintf(_T("\t (1) Display LED\r\n"));
_tprintf(_T("\t (2) Set LED value\r\n"));
sin = _gettchar();
n = _tstoi(&sin);
do
{
switch (n)
{
// if char == '1', display the LED output status
case 1:
// Open device
hLedDev = mxgpio_open();
for (inti = 0; i< LED_PORT_NUMBER; i++)
{
// Get digital input
port_no = i;
nLED = mxgpio_get_data( hLedDev, port_no);
_tprintf(_T("LED[%d] = %d\r\n"), port_no, nLED);
}
Содержание
- Da 685 windows embedded standard 7 software manual 1
- First edition february 2014 1
- Www moxa com product 1
- Copyright notice 2
- Da 685 windows embedded standard 7 software manual 2
- Disclaimer 2
- Technical support contact information 2
- Trademarks 2
- Www moxa com support 2
- Table of contents 3
- Introduction 4
- Da 685 w7e introduction 5
- Software components 5
- System initialization 6
- Attention 7
- Create a new user account 7
- Da 685 w7e system initialization 7
- Enabling embedded filters 8
- Da 685 w7e enabling windows 7 write protections 9
- Enhanced write filter 9
- Overview 9
- Da 685 w7e enabling windows 7 write protections 10
- Enabling enhanced write filter 10
- Committing data and or disabling ewf 11
- Da 685 w7e enabling windows 7 write protections 11
- Da 685 w7e enabling windows 7 write protections 12
- File based write filter 12
- Overview 12
- Configuring file based write filter 13
- Da 685 w7e enabling windows 7 write protections 13
- Da 685 w7e enabling windows 7 write protections 14
- Excluding files from fbwf protection 14
- Da 685 w7e enabling windows 7 write protections 15
- Da 685 w7e enabling windows 7 write protections 16
- Managing temporary files cached in the overlay 16
- Serial port configuration 17
- Da 685 w7e serial port configuration 18
- Serial port configuration 18
- Warning 18
- Customizable sample code 19
- Da 685 w7e customizable sample code 20
- Sample code for customizing the da 685 20
- The digital i o control walkthrough 20
- Da 685 w7e customizable sample code 21
- Examples releas 21
- The led control walkthrough 21
- Watchdog control code 21
- C programs example 22
- Da 685 w7e customizable sample code 22
- The watchdog control code walkthrough 22
- System recovery 23
- Da 685 w7e system recovery 24
- Overview setting up the recovery environment 24
- Recovery 24
- Step 1 prepare the usb drive 24
- Tuxboot windows 23 exe 24
- Attention 25
- Da 685 w7e system recovery 25
- F home partimag 25
- Recovery os_image 25
- Step 2 setting the bios to boot via usb 25
- Da 685 w7e system recovery 26
- F home partimag 26
- Step 3 opt create a custom system image 26
- Da 685 w7e system recovery 27
- Home partima 27
- Da 685 w7e system recovery 28
- Warning 28
- Da 685 w7e system recovery 29
- Step 4 reset bios to original state 29
- Da 685 w7e system recovery 30
- Step 5 perform a test restoration 30
- Da 685 w7e system recovery 31
- Da 685 w7e system recovery 32
- A sample code for da 685 customization 33
- Sample code for da 685 customization 33
- The dio control sample code 34
- The led control sample code 36
- The watchdog control sample code 38
Похожие устройства
- Moxa DA-685-W7E Руководство по аппаратной части
- Moxa DA-685-W7E Руководство по подключению
- Moxa DA-685-W7E Технические характеристики
- Moxa DA-820-C7-SP-HV-T Инструкция по эксплуатации
- Moxa DA-820-C7-SP-HV-T Руководство по аппаратной части
- Moxa DA-820-C7-SP-HV-T Технические характеристики
- Moxa DA-820-C7-SP-LV-T Инструкция по эксплуатации
- Moxa DA-820-C7-SP-LV-T Технические характеристики
- Moxa DA-820-C7-SP-LV-T Технические характеристики
- Moxa DA-820-C7-DP-HV-T Инструкция по эксплуатации
- Moxa DA-820-C7-DP-HV-T Технические характеристики
- Moxa DA-820-C7-DP-HV-T Руководство по аппаратной части
- Moxa DA-820-C7-DP-LV-T Инструкция по эксплуатации
- Moxa DA-820-C7-DP-LV-T Технические характеристики
- Moxa DA-820-C7-DP-LV-T Руководство по аппаратной части
- Moxa DA-820-C8-SP-LV Инструкция по эксплуатации
- Moxa DA-820-C8-SP-LV Технические характеристики
- Moxa DA-820-C8-SP-LV Руководство по аппаратной части
- Moxa СРАВНИТЬ Инструкция по эксплуатации
- Moxa СРАВНИТЬ Технические характеристики