Moxa TC-6110-W7E [69/74] The led control script
![Moxa TC-6110-CT-T-W7E [69/74] The led control script](/views2/1200315/page69/bg45.png)
TC-6110 / Windows 7 Sample Code for TC-6110 Customization
B-2
The LED Control Script
Below we reproduce the LED control code. This is a simple script 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 <commctrl.h>
#include "devices.h"
/*
index[n]: 0 ; BIT 0
1 ; BIT 1
2 ; BIT 2
3 ; BIT 3
....
data[n]: 0 ; Digital LOW
1 ; Digital HIGH
*/
#define LED_NUMBER 8
int LEDMap[8] = {0, 1, 2, 3, 6, 7, 9, 10};
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hGPIO;
int led_no;
int data;
int nLED = 0;
int nRet = 0;
int n = 0;
WCHAR sin,smode;
printf("LED Test Program\n");
printf("\t (0) Exit Program\n");
printf("\t (1) Display LED\n");
printf("\t (2) Set LED value\n");
sin = getwchar();
n = _wtoi(&sin);
do
{
switch (n)
{
// if char == '1', display the digital input
case 1:
//Open dio
hGPIO = mxgpio_open();
Содержание
- Second edition june 2013 1
- Tc 6110 windows embedded standard 7 software manual 1
- Www moxa com product 1
- Copyright notice 2
- Disclaimer 2
- Tc 6110 windows embedded standard 7 software manual 2
- Technical support contact information 2
- Trademarks 2
- Www moxa com support 2
- Table of contents 3
- Introduction 4
- Software components 5
- Tc 6110 windows 7 introduction 5
- Tc 6110 windows 7 introduction 6
- System initialization 7
- Create a new user account 8
- Tc 6110 windows 7 system initialization 8
- Enabling windows 7 write protections 9
- Enhanced write filter 10
- Overview 10
- Tc 6110 windows 7 enabling windows 7 write protections 10
- Enabling enhanced write filter 11
- Ewfmgr c 11
- Tc 6110 windows 7 enabling windows 7 write protections 11
- Ewfmgr c 12
- Ewfmgr c commitanddisabl 12
- Ewfmgr c enabl 12
- Tc 6110 windows 7 enabling windows 7 write protections 12
- Enabling file based write filter 13
- Fbwfmgr displayconfi 13
- Fbwfmgr enabl 13
- File based write filter 13
- Overview 13
- Tc 6110 windows 7 enabling windows 7 write protections 13
- Fbwfmgr displayconfi 14
- Tc 6110 windows 7 enabling windows 7 write protections 14
- Installing moxa software 15
- Hot swap configuration and usage 16
- Installing mxhtsp 16
- Mxhtsp hot swapping for hard drives 16
- Overview 16
- Starting hot swap 16
- Drive usage notifications 17
- Tc 6110 windows 7 installing moxa software 17
- Unmounting and removing the storage drives 17
- User defined percentage of drive capacity 17
- Warning 17
- C program files moxa mxhtsp confi 18
- C program files moxa mxhtsp script 18
- Configuring hot swap settings 18
- Mxhtsp 18
- Mxhtspd 18
- Tc 6110 windows 7 installing moxa software 18
- Warning 18
- C program files moxa mxhtsp confi 19
- C program files moxa mxhtsp config script 19
- Moxa hot swap mxhtsp scripts 19
- Mxhtsp 19
- Tc 6110 windows 7 installing moxa software 19
- Warning 19
- Hot swap mxhtsp logs 20
- Installing the pdm diagnostics package 20
- Moxa predictive maintenance diagnostic tools 20
- Overview 20
- Attention 21
- Configuring and using the g sensor tool 21
- Launching the charting application 21
- Tc 6110 windows 7 installing moxa software 21
- Configuring the sensor logs 22
- Tc 6110 windows 7 installing moxa software 22
- Configuring the g sensor to signal an alarm 23
- Tc 6110 windows 7 installing moxa software 23
- Configuring and using the temperature sensor 24
- Tc 6110 windows 7 installing moxa software 24
- Overview 25
- Tc 6110 windows 7 installing moxa software 25
- The synmap design concept 25
- The synmap virtualization layer full interoperability with any moxa device 25
- Moxa synmap oids list 26
- Mxgpio_clos 26
- Mxgpio_get_data 26
- Mxgpio_open 26
- Mxgpio_set_dat 26
- Tc 6110 windows 7 installing moxa software 26
- Tc 6110 windows 7 installing moxa software 27
- Installing the synmap virtualization layer 28
- Mxsynmap_setup ms 28
- Tc 6110 windows 7 installing moxa software 28
- Tility 3 mxsynmap 28
- Installing and using an nms 29
- Installing moxa mxview 29
- Mxview_trial_v2 ms 29
- Tc 6110 windows 7 installing moxa software 29
- Tility 4 mxviewtria 29
- Basic configuration of mxview 30
- Tc 6110 windows 7 installing moxa software 30
- Tc 6110 windows 7 installing moxa software 31
- Warning 31
- Tc 6110 windows 7 installing moxa software 32
- Loading the synmap mib file 33
- Tc 6110 windows 7 installing moxa software 33
- Tc 6110 windows 7 installing moxa software 34
- C sr share snmp mibs 35
- Moxa sys mib tx 35
- Tc 6110 windows 7 installing moxa software 35
- Moxa sys mib values moxa embeddedcomputer moxasystem productinfomgmt 36
- Retrieving basic device information 36
- Tc 6110 windows 7 installing moxa software 36
- Using synmap oids to control the tc 6110 36
- Ledentry ledvalu 37
- Moxa sys mib values moxa embeddedcomputer moxasystem peripheralmgmt perledmgmt ledtable 37
- Tc 6110 windows 7 installing moxa software 37
- Using synmap to control the programmable leds 37
- Tc 6110 windows 7 installing moxa software 38
- Using synmap to set the os power policy 38
- Attention 39
- Moxa sys mib values moxa embeddedcomputer moxasystem powermgmt powerpolic 39
- Tc 6110 windows 7 installing moxa software 39
- Using synmap to read the temperature sensor 39
- Moxa sys mib values moxa embeddedcomputer moxasystem sensormgmt sensorobject tempsensortabl 40
- Tc 6110 windows 7 installing moxa software 40
- Moxa sys mib values moxa embeddedcomputer moxasystem sensormgmt sensorobject accelerometertabl 41
- Tc 6110 windows 7 installing moxa software 41
- Using synmap to read the g sensor 41
- Tc 6110 windows 7 installing moxa software 42
- Using synmap to enable and configure the watchdog timer 42
- Moxa sys mib values moxa embeddedcomputer moxasystem peripheralmgmt persystemmgmt watchdogstatu 43
- Moxa sys mib values moxa embeddedcomputer moxasystem peripheralmgmt systemwatchdog watchdog perio 43
- Tc 6110 windows 7 installing moxa software 43
- Tc 6110 windows 7 installing moxa software 44
- Customizable sample code 45
- C programs example 46
- Examples project led 46
- Examples tc6000releas 46
- Sample code for customizing the tc 6110 46
- Tc 6110 windows 7 customizable sample code 46
- The led control walkthrough 46
- Accelerometer control walkthrough 47
- Attention 47
- C programs example 47
- Examples project gsensor 47
- Examples tc6000releas 47
- G sensor accelerometer control code 47
- Tc 6110 windows 7 customizable sample code 47
- C programs example 48
- Examples project tempsensor 48
- Examples project watchdog 48
- Examples tc6000releas 48
- Pdwportval 0x8 48
- Pdwportval 0xc 48
- T sensor control code 48
- Tc 6110 windows 7 customizable sample code 48
- The watchdog control code walkthrough 48
- Walkthrough for reading temperature values 48
- Watchdog control code 48
- Gps control code 49
- Retrieving gps data 49
- Tc 6110 windows 7 customizable sample code 50
- Tc 6110 windows 7 customizable sample code 51
- Closehandle 52
- Createfile 52
- Gpsdatasize null 52
- Handle handleport createfile com3 generic_read generic_write 0 null open_existing 0 null 52
- Readfile 52
- Readfile handleport inputdata inputdatasize gpsdata 52
- Tc 6110 windows 7 customizable sample code 52
- System recovery 53
- Overview setting up the recovery environment 54
- Recovery tc6110w7 54
- Recovery tc6110w7e clonezillafactory_2013 02 21 14 54
- Step 1 prepare the usb drive 54
- Tc 6110 windows 7 system recovery 54
- Tuxboot windows 23 exe 54
- F home partimag 55
- Tc 6110 windows 7 system recovery 55
- Tc6110w7e recovery os_imag 55
- Attention 56
- Step 2 setting the bios to boot via usb 56
- Tc 6110 windows 7 system recovery 56
- F home partimag 57
- Step 3 opt create a custom system image 57
- Tc 6110 windows 7 system recovery 57
- Home partima 58
- Tc 6110 windows 7 system recovery 58
- Tc 6110 windows 7 system recovery 59
- Warning 59
- Step 4 reset bios to original state 60
- Step 5 perform a test restoration 60
- Tc 6110 windows 7 system recovery 60
- Tc 6110 windows 7 system recovery 61
- Tc 6110 windows 7 system recovery 62
- The 2013 synmap oid table 63
- Moxa synmap the full oid table 64
- Tc 6110 windows 7 the 2013 synmap oid table 64
- Tc 6110 windows 7 the 2013 synmap oid table 65
- Tc 6110 windows 7 the 2013 synmap oid table 66
- Tc 6110 windows 7 the 2013 synmap oid table 67
- Sample code for tc 6110 customization 68
- The led control script 69
- The accelerometer control script 71
- Accelerometer conversion code 73
- The watchdog control script 73
- The temperature sensor control script 74
Похожие устройства
- Moxa TC-6110-W7E Руководство по аппаратной части
- Moxa TC-6110-W7E Технические характеристики
- Moxa TC-6110-W7E Руководство по быстрой установке
- Moxa TC-6110-W7E Руководство по программной части (Linux)
- Moxa TC-6110-T-W7E Инструкция по эксплуатации
- Moxa TC-6110-T-W7E Руководство по аппаратной части
- Moxa TC-6110-T-W7E Технические характеристики
- Moxa TC-6110-T-W7E Руководство по быстрой установке
- Moxa TC-6110-T-W7E Руководство по программной части (Linux)
- Moxa TC-6110-CT-LX Инструкция по эксплуатации
- Moxa TC-6110-CT-LX Руководство по аппаратной части
- Moxa TC-6110-CT-LX Технические характеристики
- Moxa TC-6110-CT-LX Руководство по быстрой установке
- Moxa TC-6110-CT-LX Руководство по программной части (Linux)
- Moxa TC-6110-CT-T-LX Инструкция по эксплуатации
- Moxa TC-6110-CT-T-LX Руководство по аппаратной части
- Moxa TC-6110-CT-T-LX Технические характеристики
- Moxa TC-6110-CT-T-LX Руководство по быстрой установке
- Moxa TC-6110-CT-T-LX Руководство по программной части (Linux)
- Moxa TC-6110-CT-W7E Инструкция по эксплуатации