ICP LP-8381-Atom User manual

Category
Digital & analog I/O modules
Type
User manual
LinPAC-8X81 Series SDK Manual1 Version 3.0
Software Guide
ICP DAS LinPAC-8X81 Series SDK
Implement industry control with Linux Technique
Warranty
All products manufactured by ICP DAS Inc. are warranted against defective
materials for a period of one year from the date of delivery to the original purchaser.
Warning
ICP DAS Inc. assume no liability for damages consequent to the use of this
product. ICP DAS Inc. reserves the right to change this manual at any time without
notice. The information furnished by ICP DAS Inc. is believed to be accurate and
reliable. However, no responsibility is assumed by ICP DAS Inc. for its use, nor for any
infringements of patents or other rights of third parties resulting from its use.
Copyright
Copyright 2011-2014 by ICP DAS Inc. All rights are reserved.
Trademark
The names used for identification only maybe registered trademarks of their
respective companies.
License
The user can use, modify and backup this software on a single machine.
The user may not reproduce, transfer or distribute this software, or any copy, in whole
or in part.
LinPAC-8X81 Series SDK Manual2 Version 3.0
Contents
1. Introduction ............................................................................. 5
2. The LinPAC-8X81 Series SDK Introduction ......................... 11
3. The Architecture of LIBI8K.A in the LP-8X81 Series ............ 13
4. LP-8X81 Series System Settings ......................................... 15
4.1 Settings for the LP-8X81 Series Network ..................................................... 17
4.1.1 Setting the IPNetmask and Gateway 17
4.1.2 Setting of DNS 21
4.2 CF (Compact Flash) Card Usage .................................................................. 21
4.2.1 Recover OS by CF card 22
4.3 USB Device Usage ........................................................................................ 22
4.3.1 Mount USB Device 23
4.3.2 Umount USB Device 23
4.4 System Language .......................................................................................... 23
4.5 VGA Resolution ............................................................................................ 24
4.6 Upgrade OS to new version by CF card (LinPAC-8X81 only) .................... 25
4.7 Running applications automatically at boot time .......................................... 26
5. Instructions for the LP-8X81 Series ...................................... 27
5.1 Basic Linux Instructions ................................................................................ 27
5.1.1 Linux Command ―ls‖ 27
5.1.2 Linux Command ―cd‖ 27
5.1.3 Linux Command ―mkdir‖ 27
5.1.4 Linux Command ―rmdir‖ 28
5.1.5 Linux Command ―rm‖ 28
5.1.6 Linux Command ―cp‖ 28
5.1.7 Linux Command ―mv‖ 28
5.1.8 Linux Command ―pwd‖ 28
5.1.9 Linux Command ―who‖ 29
5.1.10 Linux Command ―chmod‖ 29
5.1.11 Linux Command ―uname‖ 29
5.1.12 Linux Command ―ps‖ 29
5.1.15 Linux Command ―date‖ 29
LinPAC-8X81 Series SDK Manual3 Version 3.0
5.1.16 Linux Command ―netstat‖ 29
5.1.17 Linux Command ―ifconfig‖ 30
5.1.18 Linux Command ―wget‖ 30
5.1.19 Linux Command ―ping‖ 30
5.1.19 Linux Command ―clear‖ 30
5.1.20 Linux Command ―passwd‖ 30
5.1.21 Linux Command ―reboot‖ 30
5.2 A Simple Example Helloworld.c ............................................................... 30
5.3 i-Talk Utility .................................................................................................. 35
6. LIBI8K.A ............................................................................... 40
6.1 System Information Functions ...................................................................... 41
6.2 Digital Input/Output Functions ..................................................................... 46
6.3 Watch Dog Timer Functions ......................................................................... 61
6.4 EEPROM Read/Write Functions................................................................... 64
6.5 Analog Input Functions ................................................................................. 67
6.6 Analog Output Functions .............................................................................. 80
6.7 The Software Develop Toolkit Error Code ................................................... 84
7. Demo of LP-8X81 Series Modules With C Language .......... 86
7.1 I-7k Modules DIO Control Demo ................................................................. 86
7.2 I-7k Modules AIO Control Demo ................................................................. 88
7.3 I-87k Modules DIO Control Demo ............................................................... 91
7.3.1 I-87k Modules in slots of LP-8X81 Series 91
7.3.2 I-87k Modules in slots of I-87k I/O expansion unit 93
7.3.3 I-87k Modules in slots of I-8000 Controller 96
7.4 I-87k Modules AIO Control Demo ............................................................... 96
7.4.1 I-87k Modules in slots of LP-8X81 Series 96
7.4.2 I-87k Modules in slots of I-87k I/O expansion unit 98
7.4.3 I-87k Modules in slots of I-8000 Controller 101
7.5 I-8k Modules DIO Control Demo ............................................................... 101
7.5.1 I-8k Modules in slots of LP-8X81 Series 101
7.5.2 I-8k Modules in slots of I-8000 Controller 103
7.6 I-8k Modules AIO Control Demo ............................................................... 105
7.6.1 I-8k Modules in slots of LP-8X81 Series 105
7.6.2 I-8k Modules in slots of I-8000 Controller 108
7.7 Conclusion of Module Control Demo ......................................................... 110
8. LP-8X81 Series Library Reference in C Language ............ 112
LinPAC-8X81 Series SDK Manual4 Version 3.0
8.1 List Of System Information Functions ........................................................ 112
8.2 List Of Digital Input/Output Functions ....................................................... 112
8.3 List Of Watch Dog Timer Functions ........................................................... 113
8.4 List Of EEPROM Read/Write Functions .................................................... 113
8.5 List Of Analog Input Functions ................................................................... 113
8.6 List Of Analog Output Functions ................................................................ 114
9. Additional Support .............................................................. 115
9.1 N-Port Serial Port and Modules Driver Install ............................................ 115
9.2 N-Port Module (i-8114w or other serial modules) Support ........................ 116
9.3 Rescue Disk ................................................................................................. 117
9.4 GUI Funtion Support ................................................................................... 119
9.4.1 How to boot LP-8X81 Series without loading X-window 119
9.4.2 Enabling X-window load at boot time 120
9.5 Application Support .................................................................................... 120
9.6 Other Optional Function .............................................................................. 122
Appendix A. Service Information ............................................ 125
Internet Service : ............................................................................................... 125
Manual Revision : ............................................................................................. 126
LinPAC-8X81 Series SDK Manual5 Version 3.0
1. Introduction
Linux has been adopted widely by many users because of the properties of
stability, open source, and free charge. Meanwhile, Linux is supported by many large
international companies and the function in Linux is not inferior to Windows so that
Linux OS is more and more popular and accepted. In the other hand, the hardware
requirement that Linux OS can works in embedded system smoothly is not high, just
only 386 CPU or better and 8 MB RAM. Therefore except Win CE of Microsoft, Linux
has been already another good choice in embedded OS.
The Linux OS demands less system resources from the embedded controller and
is therefore the best fit for it because of the embedded controller has some limitations
in system resources. It is for this reason that the LP-8X81 Series embedded controller
has been published to be a new generation product from ICP DAS and the
Embedded-Linux OS has been adopted into the LP-8X81 Series. The main purpose
of LP-8X81 Series is to allow the numerous enthusiastic Linux users to control their
own embedded systems easily within the Linux Environment.
ICP DAS provides the library file - libi8k.a which includes all the functions from
the I-7000/8000/87000 series modules which are used in the LP-8X81 Series
Embedded Controller. The libi8k.a is designed especially for the I-7000/8000/87000
series modules on the Linux platform for use in the LP-8X81 Series. Users can easily
develop applications in the LP-8X81 Series by using either C Language In the future.
The various functions of the libi8k.a are divided into the sub-group functions for ease
of use within the different applications. The powerful functions of the LP-8X81 Series
LinPAC-8X81 Series SDK Manual6 Version 3.0
embedded controller, which includes a VGA, USB (Card Reader, Camera ),
Mouse, Audio, Keyboard, Serial ports (RS-232, RS-422/485), Ethernet (Hub)
and many I/O slots in the picture. Presently, HTTPSSH Servers are built in and
users can transfer files or use remote control with the LP-8X81 Series more
conveniently In network communication. Fig. 1-1 illustrates hardware architecture of
the LP-8X81 Series.
Fig. 1-1
1. Rotary Switch
The Rotary Switch is an operating mode selector switch which provides functions
to configure with the selection of operating mode and authorization control.
2. LED Indicators
The LP-8X81 contains PWR LED indicators that located near power switch and
show the power status.
The LP-8X81-Atom contains four LED indicators. The first is labeled PWR, located
LinPAC-8X81 Series SDK Manual7 Version 3.0
near the power switch and show the power status. The three other are located next
the rotary switch, the left one is labeled RUN and show the operation status, the two
other are denoted L1 and L2 and used for user defined.
LED In
LED Indicators
Color
Meaning
PWR
Red
Power is on
RUN
Green
OS is running
L1
Yellow
User programmable LED
L2
Red
User programmable LED
3. USB Ports
The LP-8X81 contains two USB ports that allow support for the USB devices such
as mouse, keyboard or an external USB hard drive. These ports are denoted P1 and
P2.
The LP-8X81-Atom contains four USB ports. These ports are denoted P1, P2, P3
and P4.
4. Ethernet Ports
The LP-8X81 Series contains two Ethernet ports for use with network devices, and
is denoted as LAN1 and LAN2.
5. Power Switch
The power switch is a small switch that enables or disables power to electric
circuits and loads in the LP-8X81 Series.
6. Connector
The connector has 10 pins arranged in 2 rows, as follows:
The pin assignments of the connector are as follows:
Pin
Signal
Description
1
PWR1
Power input 1
2
P.GND
LinPAC-8X81 Series SDK Manual8 Version 3.0
7. Microphone and Earphone
The LP-8X81-Atom contains the microphone and earphone jack to the input and
output of sound system.
8. CF(Compact Flash) Card Slot
The CF card expansion slot is an interface that is used to access and download
information on a CF card to a LP-8X81 Series. The CF card can be used to expand
the memory up to 32 GB.
9. VGA Connector
A VGA connector is a 3-row 15-pin connector that can be used with a variety of
supported VGA resolutions.
10. DIP Switch(Only for LP-8181-Atom, LP-8381-Atom and LP-8781-Atom)
The DIP switch can be used to set the Module ID to a number from 0 to 255. Do
not use Module ID 0 for communication.
3
D+
COM3:RS485
4
D-
5
F.G.
Frame ground
6
PWR2
Power input 2
7
P.GND
8
R.COM
Relay Output
9
R.NO
10
F.G.
Frame ground
LinPAC-8X81 Series SDK Manual9 Version 3.0
11. COM2(RS232)
Female
115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 bps
7, 8
None, Even, Odd
1
1 byte
12. COM4(RS232/RS485)
Male
115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 bps
5, 6, 7, 8
None, Even, Odd, Mark (Always 1), Space (Always 0)
13. COM5(RS232)
LinPAC-8X81 Series SDK Manual10 Version 3.0
Male
115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 bps
5, 6, 7, 8
None, Even, Odd, Mark (Always 1), Space (Always 0)
1, 2
16 bytes
14. PAC I/O Slots
The LP-8X81 Series contains some extra I/O slots.
The LP-8X81 Series use I/O slots that can be expanded. They can serve in local and
local expansion. The number of each type of the expansion I/O slot:
LP-8081: 0 I/O slot.
LP-8181-Atom: 1 I/O slot.
LP-8381 & LP-8381-Atom: 3 I/O slots.
LP-8181 & LP-8781-Atom: 7 I/O slots.
LinPAC-8X81 Series SDK Manual11 Version 3.0
2. The LinPAC-8X81 Series SDK Introduction
LP-8X81 Series SDK consists of the following major items.
LinPAC SDK library files
LinPAC SDK include files
Demo files
From http://ftp.icpdas.com/pub/cd/linpac/napdos/lp-8x8x/atom/, you can download the
latest version of LP-8X81 Series SDK and the Manual. And then follows the below
steps in order to get the development toolkit which has been provided by ICP DAS for
the easy application of the LP-8X81 Series embedded controller platform.
(1)User can connect to LP-8X81 Series through Ethernet 1, Ethernet 2 by using the
command telnet (refer to Fig 4-1, Fig 4-2) or by using putty software (refer to
Fig 4-3, Fig 4-4).
(2)After user connect to LP-8X81 Series, user could type command wget
http://ftp.icpdas.com/pub/cd/linpac/napdos/lp-8x8x/atom/sdk/linpac-8x81_sdk.tar.g
z to get the latest version of LP-8X81 series SDK.
(3)To type tar zxf linpac-8X81_sdk.tar.gz to decompress tar file (refer to Fig 2-1).
Fig 2-1
Once user decompresses the SDK file, user can find the files for the library and
demo in the following paths.
LinPAC-8X81 Series SDK Manual12 Version 3.0
The Libi8k.a path is LinPAC-8X81_sdk\lib".
The include files path is LinPAC-8X81_sdk\include.
The demo path is LinPAC-8X81_sdk\examples.
LinPAC-8X81 Series SDK Manual13 Version 3.0
3. The Architecture of LIBI8K.A in the LP-8X81 Series
The libi8k.a is a library file that is designed for I7000/8000/87000 applications
running in the LP-8X81 series Embedded Controller using the Linux OS. Users can
apply it to develop their own applications with GNU C language. In order to assist
users to build their project quickly, we provide many demo programs. Based on these
demo programs, users can easily understand how to use these functions and develop
their own applications within a short period of time.
The relationships among the libi8k.a and user‘s applications are depicted as Fig.
3-1
Fig. 3-1
LinPAC-8X81 Series SDK Manual14 Version 3.0
Functions for LP-8X81 Series Embedded Controller are divided into sub-groups
for ease of use within the different applications
System Information Functions
Digital Input Functions
Digital Output Functions
Watch Dog Timer Functions
EEPROM Read/Write Functions
Analog Input Functions
Analog Output Functions
The functions in the Libi8k.a are especially designed for LP-8X81 Series. Users
can easily find the functions they need for their applications from the descriptions in
chapter 6 and in the demo programs provided in chapter 7.
LinPAC-8X81 Series SDK Manual15 Version 3.0
4. LP-8X81 Series System Settings
User can use the three methods to connect to LP-8X81 Series to configure
system, check system status and startup/stop system service:
(1)To connect to LP-8X81 Series through serial port COM2 by using Windows
communication software Hyper Terminal (baud rate is 38400).
(2)To connect to LP-8X81 Series through Ethernet port by using command telnet
(please refer to Fig 4-1, 4-2).The default ID is root and password is icpdas.
Fig 4-1
Fig 4-2
LinPAC-8X81 Series SDK Manual16 Version 3.0
(3)To connect to LP-8X81 Series through Ethernet Port by using Putty software
(please refer to Fig 4-3, Fig 4-4). The default ID is root and password is icpdas.
Fig 4-3
Fig 4-4
In this section, we will introduce how to setup the LP-8X81 Series configuration. Let
users can use the LP-8X81 Series more easily.
LinPAC-8X81 Series SDK Manual17 Version 3.0
4.1 Settings for the LP-8X81 Series Network
The LP-8X81 Series network setting includes two ways. One is DHCP and the
other is Assigned Static IP. DHCP is the default setting after the LP-8X81 Series is
produced and this way is easy for users. However, if your network system is without
DHCP server, then users need to configure the network setting by using Assigned
IP.
4.1.1 Setting the IPNetmask and Gateway
(1) Using DHCP:
Boot up LP-8X81 Series and use telnet to open a “linux command Prompt”.
Type in vi /etc/sysconfig/network to open the network setting file.
Please refer to the Fig 4-5:
Fig 4-5
After editing the network file, user can type in vi /etc/sysconfig/network
-scripts/ifcfg-eth0 and vi /etc/sysconfig/network-scripts/ifcfg-eth1 to set
the network device eth0 and eth1. To remove # in the dhcp block and add
# in the Assign IP block. Then type :wp to save the setting. To type
/etc/init.d/ifplugd restart to make the setting work. Please refer to the Fig 4-6
and Fig 4-7.
LinPAC-8X81 Series SDK Manual18 Version 3.0
Fig 4-6
Fig 4-7
(2) Using Assigned IP:
Boot up LP-8X81 Series and open a “command Prompt. Type in vi
/etc/sysconfig/network to open the network setting file. If user wants to set
gateway, user can remove # in the GATEWAY and GATEWAYDEV. Please
refer to the Fig 4-8:
LinPAC-8X81 Series SDK Manual19 Version 3.0
Fig 4-8
After editing the network file, user can type in vi /etc/sysconfig/network
-scripts/ifcfg-eth0 and vi /etc/sysconfig/network-scripts/ifcfg-eth1 to
set the network device eth0 and eth1. To add # in the dhcp block and
remove # in the Assign IP block. Then type :wq to save the setting.
To type /etc/init.d/ifplugd restart to make the setting work. Please refer to
the Fig 4-9 and Fig 4-10:
Fig 4-9
LinPAC-8X81 Series SDK Manual20 Version 3.0
Fig 4-10
After finishing the LinPAC network setting, user can type ifconfig to see the
network setting. (Refer to the Fig 4-11)
Fig 4-11
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126

ICP LP-8381-Atom User manual

Category
Digital & analog I/O modules
Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI