Moxa C Programmable RTU Controllers User’s Manual Fourth Edition, September 2013 www.moxa.com/product © 2013 Moxa Inc. All rights reserved.
Moxa C Programmable RTU Controllers User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement. Copyright Notice © 2013 Moxa Inc. All rights reserved. Trademarks The MOXA logo is a registered trademark of Moxa Inc. All other trademarks or registered marks in this manual belong to their respective manufacturers.
Table of Contents 1. Introduction ...................................................................................................................................... 1-1 Overview ........................................................................................................................................... 1-2 Software Architecture ..........................................................................................................................
PPPoE.............................................................................................................................................. 4-14 PPP over Cellular .............................................................................................................................. 4-15 NFS (Network File System) ................................................................................................................ 4-16 Setting up the RTU Controller as an NFS Client ..................
1 1. Introduction The Moxa C programmable RTU controller is a system with 1 or 2 10/100 Mbps Ethernet ports, an internal SD socket, 1 or 2 RS-232/422/485 serial ports, built-in or user-selectable modular I/Os, and pre-installed operating system, depending on the specific model. The Moxa C programmable RTU controller offers high-performance communication capability, and high storage capacity in one compact and rugged box.
Moxa C Programmable RTU Controllers Introduction Overview The Moxa C programmable RTU controller uses the Moxa ART RISC CPU. The RISC architecture and advanced semiconductor technology provide the RTU controller with a powerful computing engine and communication functions without generating a lot of heat. A 32 MB NOR Flash ROM, 64 MB on-board SDRAM, and an SD socket provide enough memory for you to install application software and store data directly on the RTU controller.
Moxa C Programmable RTU Controllers Introduction Journaling Flash File System (JFFS2) The Root File System and User directory in the flash memory is formatted with the Journaling Flash File System (JFFS2). The formatting process places a compressed file system in the flash memory. This operation is transparent to users. The Journaling Flash File System (JFFS2), which was developed by Axis Communications in Sweden, puts a file system directly on the flash, instead of emulating a block device.
Moxa C Programmable RTU Controllers sshd Secure shell server openvpn Virtual private network openssl Open SSL Introduction Linux Tool Chain Gcc (V3.3.2) C/C++ PC Cross Compiler GDB (V5.3) Source Level Debug Server Glibc(V2.2.5) POSIX standard C library Linux Tool Chain (ioPAC 8020 & ioLogik W5348 V1.4) Gcc (V4.4.2) C/C++ PC Cross Compiler GDB (V7.0.1) Source Level Debug Server Glibc (V2.10.
Moxa C Programmable RTU Controllers Introduction Product Specifications ioPAC 8020 Series Computer CPU: ARM9 based CPU, 32-bit/160 MHz OS: Linux Clock: Real-time clock with battery backup SDRAM: 64 MB Flash: 32 MB SD™ Slot: Up to 32 GB (SD 2.0 compatible) Note: For units operating in extreme temperatures, industrial grade, wide-temperature SD cards are required. Ethernet Interface LAN: 2 auto-sensing 10/100 Mbps switch ports (M12 or RJ45) Ethernet Relay Function: Hardware Normal Close Protection: 1.
Moxa C Programmable RTU Controllers Introduction EMS: EN 55024, EN 61000-4-2, EN 61000-4-3, EN 61000-4-4, EN 61000-4-5, EN 61000-4-6, EN 61000-4-8, EN 61000-4-11, EN 61000-6-2 Shock: IEC 60068-2-27 Freefall: IEC 60068-2-32 Vibration: IEC 60068-2-6 Rail Traffic: EN 50155, EN 50121-3-2, EN 50121-4 Green Product: RoHS, CRoHS, WEEE Note: Please check Moxa’s website for the most up-to-date certification status.
Moxa C Programmable RTU Controllers Introduction Relay Outputs: 2 channels Isolation: 3K VDC or 2K Vrms Analog Input Type: Differential input Resolution: 16 bits I/O Mode: Voltage / Current Input Range: 0 to 10 V, ±10 V, ±5 V, 0 to 20 mA, 4 to 20 mA Accuracy: • ±0.1% FSR @ 25°C • ±0.3% FSR @ -30 and 70°C Sampling Rate: W5348: • All channels: 5 samples/sec • Per channel: 1.25 samples/sec Input Impedance: 200K ohms (min.
Moxa C Programmable RTU Controllers Introduction Physical Characteristics Dimensions: 46.8 x 135 x 105 mm (1.84 x 5.31 x 4.13 in) Weight: 495 g Mounting: DIN-rail (standard), wall (optional) Environmental Limits Operating Temperature: Standard Models: -10 to 55°C (14 to 131°F) Wide Temp.
2 2. Getting Started In this chapter, it explains how to connect the Moxa RTU C Programmable controller, and how to get started on the programming.
Moxa C Programmable RTU Controllers Getting Started I/O and Communication Module Installation The 5 I/O modules and single communication module may be selected for installation on the ioPAC 8020 system; all modules may be hot-swapped, allowing for convenient installation/removal at anytime. Care should be taken before installing the modules: 1. I/O modules (RM-1050-T, RM-1602-T, RM-2600-T, RM-3802-T, and RM-3810-T) may be installed on the ioPAC 8020-C system in any order.
Moxa C Programmable RTU Controllers Getting Started Installing the RTU Controller on a DIN-Rail ioPAC 8020-C Series The aluminum DIN-rail attachment plate should already be fixed to the back panel of the ioPAC 8020-C when you take it out of the box. If you need to reattach the DIN-rail attachment plate to the ioPAC 8020-C, make sure the spring-loaded bracket is situated towards the bottom, as shown in the following figures. NOTE Users can purchase a wall-mounting (WK-75) kit separately.
Moxa C Programmable RTU Controllers Getting Started Removing ioPAC 8020-C Series from the DIN-Rail To remove the ioPAC 8020-C from the DIN-rail, use a screwdriver to push down the spring-loaded bracket until it locks in place, as shown in the diagram to the right. Next, rotate the bottom of the switch upwards and then remove the switch from the DIN-rail. ioLogik W5348-C Series STEP 1: Insert the top of the DIN-rail into the slot just below the stiff metal spring.
Moxa C Programmable RTU Controllers Getting Started Grounding the RTU Controller The Moxa C programming RTU Controller is grounded to enhance EMS performance. The RTU controller comes with a metal DIN-Rail bracket for grounding the system. For optimal EMS performance, connect the chassis ground nut on the RTU controller to the grounding point.
Moxa C Programmable RTU Controllers Getting Started Power Terminal Block for ioPAC 8020-C Series Connecting to a Serial Device The RTU controller is equipped with two 3-in-1 serial ports that support RS-232/422/485, making it more convenient to connect field serial devices.
Moxa C Programmable RTU Controllers Getting Started LED Indicators ioPAC 8020-C Series Mark Function Description Power Power input OFF: No system power available Serial Serial communication activity OFF: No serial communication I/O Tool chain API control Green/Red/Off: Controlled by API Green: Power on Green: Serial Tx/Rx Ready System status Green: System ready System status Red: System error System status Green Flashing: System booting Tool chain API control Green/Red/Off: After booti
Moxa C Programmable RTU Controllers Getting Started Console Port for the ioPAC 8020-C Series Serial Console Port Console Port for the ioLogik W5348-C Series Serial Console Port Pin Assignment for the Serial Console Port No. Pin Assignments 1 Tx 2 Rx 3 N/A 4 GND Serial Console Baudrate 115200 bps Parity Data bits Stop bits: Flow Control Terminal None 8 1 None VT100 To connect to the RTU’s serial console, Moxa PComm Terminal Emulator is recommended to be used as the console terminal.
Moxa C Programmable RTU Controllers Getting Started STEP 5: Specify the COM port that is connecting the RTU controller, and configure the settings to 115,200, 8, none, and 1. STEP 6: Click on the Terminal tab, and configure the Terminal Type to VT100. Click OK to proceed. STEP 7: Serial console will be displayed on the terminal screen.
Moxa C Programmable RTU Controllers Getting Started Telnet Console It will be easy to use the system embedded command “telnet” to connect the RTU controller via network connection. The default IP address and Netmask are given below: LAN 1 Default IP Address Netmask 192.168.127.254 255.255.255.0 Use a cross-over Ethernet cable to connect directly from the host PC to the RTU controller. User must first modify the host PC’s IP address and netmask to be in the same subnet as the target RTU controller.
Moxa C Programmable RTU Controllers Getting Started SSH Console The RTU controller supports an SSH console to provide users with better security options. Windows Users Click on the link http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download PuTTY (free software) to set up an SSH console for the Moxa RTU in a Windows environment. The following figure shows a simple example of the configuration that is required.
Moxa C Programmable RTU Controllers Getting Started Installing RTUAdmin Insert the Document and Software CD into the host computer. In the Software\utility\RTUAdmin\RTUAdminSetup directory of the CD, locate and run SETUP.EXE. The installation program will guide you through the installation process and install the ioAdmin utility. After the installation is finished, run ioAdmin from the Windows Start menu. Broadcast Search Select the model and click the “Start Search” button to proceed.
Moxa C Programmable RTU Controllers Getting Started Menu Bar The Menu bar has four items: File, System, Sort, and Help. File Use the File\Exit to close the RTUAdmin. System a. Auto Search: Searches for Moxa RTU controllers on the local network. b. Network Interface: Selects a network interface to use the RTUAdmin. c. Auto Search Timeout: Selects the preferred timeout value for broadcast search. Sort a. By Connection: Sorts by the target Moxa RTU controller’s IP address. b.
Moxa C Programmable RTU Controllers Getting Started Sync Rate Status Indicates the period that RTUAdmin has been launched. Status Bar Displays the current time. Configuring the Ethernet Interface The network settings of the Moxa C programming RTU controller can be modified with the serial console port, or online over the network.
Moxa C Programmable RTU Controllers Getting Started #/etc/init.d/networking restart NOTE After changing the IP settings, use the networking restart command to activate the new IP address. Users must modify the /etc/network/interfaces to store the new settings. Using commands such as #ifconfig eth0 192.168.1.1 WILL NOT save the settings to the flash memory.
Moxa C Programmable RTU Controllers Getting Started Installing the Tool Chain (Linux) The Linux Operating System must be pre-installed in the host PC before installing the RTU controller’s GNU Tool Chain. Fedora Core or compatible versions are recommended. The Tool Chain requires approximately 150 MB of hard disk space on your PC. The RTU controller’s Tool Chain software is located on the attached Document and Software CD.
Moxa C Programmable RTU Controllers Getting Started Users should see the following response: [root@localhost hello]# make /usr/local/arm-linux/bin/arm-linux-gcc –o hello-release hello.c /usr/local/arm-linux/bin/arm-linux-strip –s hello-release /usr/local/arm-linux/bin/arm-linux-gcc –ggdb -o hello-debug hello.
3 3. Managing the RTU Controllers This chapter includes information for version control, deployment, updates, and peripherals. The information in this chapter will be useful when users need to run the same application on several Moxa RTU controllers.
Moxa C Programmable RTU Controllers Managing the RTU Controllers System Version Information To verify the hardware capability of the target RTU controller, and the supported software, check the version numbers of your Moxa RTU controller’s hardware, kernel, and user file system. Contact Moxa to verify the hardware version. You will need the Production S/N (Serial number), which is labeled on the RTU controller’s bottom.
Moxa C Programmable RTU Controllers Managing the RTU Controllers 3. In Moxa RTU Controller’s console, perform the following commands to use the built-in FTP client to retrieve the firmware file (xxxx.hfm) from the host PC to the RTU controller: /mnt/ramdisk# ftp Login Name: xxxx Login Password: xxxx ftp> bin ftp> get xxxx.hfm 4. After the firmware file is transferred to the RAM disk, perform upgradehfm command to upgrade the kernel and root file system. #upgradehfm xxxx.
Moxa C Programmable RTU Controllers httpd Managing the RTU Controllers Apache WWW Server daemon Perform the command “ps -ef” to list all the running processes. 192.168.127.
Moxa C Programmable RTU Controllers Managing the RTU Controllers The following diagram shows how to edit the last line of the rc.local to activate the complied example “tcps2-release”, and run in the background. 192.168.127.254 - PuTTY # !/bin/sh if [ -f /home/autoexec.sh ]; then /home/autoexec.sh fi # Add the new daemons or programs starting from the next line /home/tcps2-release &~ The enabled daemons will be available after rebooting the RTU controller. An alternative is the autoexec.
Moxa C Programmable RTU Controllers Managing the RTU Controllers Adjusting the System Time Setting the Time Manually The Moxa C programming RTU controller has two time settings. One is the system time, and the other is the RTC (Real Time Clock) time kept by the RTU controller’s hardware. Use the #date command to query the current system time or set a new system time. Use #hwclock to query the current RTC time or set a new RTC time.
Moxa C Programmable RTU Controllers Managing the RTU Controllers 10.120.53.100 - PuTTY root@Moxa:~# date ; hwclock Sat Jan 1 00:00:36 CST 2000 Sat Jan 1 00:00:37 2000 -0.772941 seconds root@Moxa:~# ntpdate time.stdtion.gov.tw 9 Dec 10:58:53 ntpdate[207]: step time server 220.130.158.52 offset 155905087.984256 sec root@Moxa:~# hwclock –w root@Moxa:~# date ; hwclock Thu Dec 9 10:59:11 CST 2010 Thu Dec 9 10:59:12 2010 -0.
Moxa C Programmable RTU Controllers mm h min 0-59 Managing the RTU Controllers dom mon dow user command hour date month week user command 0-23 1-31 1-12 0-6 (0 is Sunday) The following example demonstrates how to use Cron. How to use Cron to update the system time and RTC time every day at 8:00. STEP1: Write a shell script named fixtime.sh and save it to /home/. #!/bin/sh ntpdate time.nist.gov hwclock –-systohc exit 0 STEP2: Change mode of fixtime.sh #chmod 755 fixtime.
4 4. Managing Communications In this chapter, it explains how to configure the RTU controller’s communication functions.
Moxa C Programmable RTU Controllers Managing Communications Telnet/FTP The Telnet and FTP Server service is enabled by default on the RTU controller. To enable or disable the Telnet/ftp server, users need to edit the file /etc/inetd.conf. Enabling the Telnet/FTP Server The following example shows the default content of the file /etc/inetd.conf.
Moxa C Programmable RTU Controllers Managing Communications Web Service—Apache The Apache web server’s main configuration file is /etc/apache/conf/httpd.conf, with the default homepage located at /home/httpd/htdocs/index.html. Save the customized homepage to the following directory: /home/httpd/htdocs/ Save the customized CGI page to the following directory: /home/httpd/cgi-bin/ Before modifying the homepage, use a browser from the host PC to perform a test to see if the Apache Web Server is working.
Moxa C Programmable RTU Controllers Managing Communications Installing PHP for Apache Web Server The Moxa C programming RTU controller supports the PHP option. However, since the PHP file is 3 MB, it is not installed by default. To install it, first make sure there is enough free space (at least 3 MB) on the target RTU controller’s flash ROM. Step 1: Check if the system contains enough free space by performing the df -h command. 192.168.127.
Moxa C Programmable RTU Controllers Managing Communications Step 3: Download the PHP package. Users can locate the package in Software and Document CD/Software/php/php.tgz 192.168.127.254 - PuTTY root@Moxa:/bin# cd /mnt/ramdisk root@Moxa:/mnt/ramdisk# ftp 192.168.127.130 Connected to 192.168.127.130. 220 (vsFTPd 2.0.1) Name (192.168.127.130:root): root 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files.
Moxa C Programmable RTU Controllers Managing Communications Step 5: Change directory to “php”. Run “install.sh” and select “Install PHP Package”. 192.168.127.254 - PuTTY root@Moxa:/mnt/ramdisk# cd php root@Moxa:/mnt/ramdisk/php# ./install.sh Press the number: 1. Install PHP package 2. Uninstall PHP package 3. Exit. 1 Start to install PHP. Please wait ... Starting web server: apache. PHP install sucess. root@Moxa:/mnt/ramdisk/php# Step 6: Open the page with the host PC’s browser (e.g. http://192.168.127.
Moxa C Programmable RTU Controllers Managing Communications The following figure shows the IPTABLES hierarchy. The Moxa C programming RTU controller supports the following sub-modules. Be sure to use the module that matches the real application.
Moxa C Programmable RTU Controllers Managing Communications Use the lsmod command to check if the ip_tables module has already been loaded in the Moxa RTU unit. Use the modprobe command to insert and enable the module. Use the following command to load the modules (iptable_filter, iptable_mangle, iptable_nat): #modprobe iptable_filter NOTE IPTABLES plays the role of packet filtering or NAT. Be careful when setting up the IPTABLES rules.
Moxa C Programmable RTU Controllers Managing Communications POSTROUTING: To alter packets as they are about to be sent out. Examples: #iptables –P INPUT DROP #iptables –P OUTPUT ACCEPT #iptables –P FORWARD ACCEPT #iptables –t nat –P PREROUTING ACCEPT #iptables –t nat –P OUTPUT ACCEPT #iptables -t nat –P POSTROUTING ACCEPT In this example, the policy accepts outgoing packets and denies incoming packets.
Moxa C Programmable RTU Controllers Managing Communications # iptables –A INPUT –i eth0 –p all –m mac -–mac-source 01:02:03:04:05:06 –j DROP NOTE: In Example 7, remember to issue the command #modprobe ipt_mac first to load module ipt_mac. NAT NAT (Network Address Translation) protocol translates IP addresses used on one network to different IP addresses used on another network. One network is designated the inside network and the other is the outside network.
Moxa C Programmable RTU Controllers Managing Communications # Edit the rc.local file to make this shell startup automatically. # vi /etc/rc.d/rc.local # Add a line in the end of rc.local /home/nat.sh EXIF=‘eth0’ # This is an external interface for setting up a valid IP address. EXNET=‘192.168.4.0/24’ #This is an internal network address. # Step 1. Insert modules. # Here 2> /dev/null means the standard error messages will be dump to null device.
Moxa C Programmable RTU Controllers Managing Communications Example 1: Connecting to a PPP Server over a Simple Dial-up Connection The following command is used to connect to a PPP server by modem. Use this command for old ppp servers that prompt for a login name and password. Note that debug and default route 192.1.1.17 are optional.
Moxa C Programmable RTU Controllers Managing Communications defaultroute Once the PPP link is established, make it the default route; if you have a PPP link to the Internet, this is probably what you want. 192.1.1.17 This is a degenerate case of a general option of the form x.x.x.x:y.y.y.y. Here x.x.x.x is the local IP address and y.y.y.y is the IP address of the remote end of the PPP connection. If this option is not specified, or if just one side is specified, then x.x.x.
Moxa C Programmable RTU Controllers Managing Communications Try typing: netstat –nr It should show three routes, similar as the following: Kernel routing table Destination iface Gateway Genmask Flags Metric Ref Use 129.67.1.165 ppp0 0.0.0.0 255.255.255.255 UH 0 0 6 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 ppp0 129.67.1.165 0.0.0.0 UG 0 0 6298 If your output looks similar but doesn’t have the destination 0.0.0.
Moxa C Programmable RTU Controllers Managing Communications 4. Edit the file /etc/ppp/pap-secrets and add the following: “username@hinet.net”*“password”* “username@hinet.net” is the username obtained from the ISP to log in to the ISP account. “password” is the corresponding password for the account. 5. Edit the file /etc/ppp/options and add the following line: plugin pppoe 6. Add one of the two files: /etc/ppp/options.eth0. The choice depends on which LAN is connected to the ADSL modem.
Moxa C Programmable RTU Controllers Managing Communications Create a pppd configuration “cellular-connect” at /etc/ppp/peers Perform the command #pppd call cellular-connect NFS (Network File System) The Network File System (NFS) is used to mount a disk partition on a remote machine, as if it were on a local hard drive, allowing fast, seamless sharing of files across a network.
Moxa C Programmable RTU Controllers Managing Communications Mail smtpclient is a minimal SMTP client that takes an email message body and passes it on to an SMTP server. It is suitable for applications that use email to send alert messages or important logs to a specific user. NOTE Click on the following link for more information about smtpclient: http://www.engelschall.com/sw/smtpclient/ To send an email message, use the ‘smtpclient’ utility, which uses SMTP protocol.
Moxa C Programmable RTU Controllers Managing Communications Setup 1: Ethernet Bridging for Private Networks on Different Subnets 1. Set up four machines, as shown in the following diagram. Host A (B) represents one of the machines that belongs to OpenVPN A (B). The two remote subnets are configured for a different range of IP addresses.
Moxa C Programmable RTU Controllers Managing Communications ;; netmask ) NETMASK=$f2 ;; broadcast ) BROADCAST=$f2 ;; esac done break fi done < /etc/network/interfaces } # get the ip address of the specified interface mname= module_up() { oIFS=$IFS IFS=‘ ‘ FOUND=“no” for LINE in `lsmod` do TOK=`echo $LINE | cut -d’ ‘ -f1` if [ “$TOK” = “$mname” ]; then FOUND=“yes”; break; fi done IFS=$oIFS if [ “$FOUND” = “no” ]; then modprobe $mname fi } start() { ifcfg_vpn if [ ! \( -d “/dev/net” \) ]; then mkdir /dev/ne
Moxa C Programmable RTU Controllers Managing Communications openvpn --mktun --dev tap${i} # connect tap device to the bridge brctl addif br0 tap${i} # null ip address of tap device ifconfig tap${i} 0.0.0.0 promisc up i=`expr $i + 1` if [ $i -ge $maxtap ]; then break fi done # null ip address of internal interface ifconfig $iface 0.0.0.
Moxa C Programmable RTU Controllers Managing Communications exit 0 #---------------------------------- end ----------------------------Run the shell command to start, stop, or restart the OpenVPN # sh /etc/openvpn/openvpn-bridge start # sh /etc/openvpn/openvpn-bridge stop # sh /etc/openvpn/openvpn-bridge restart 3. Create a configuration file named A-tap0-br.conf and an executable script file named A-tap0-br.sh on OpenVPN A. # point to the peer remote 192.168.8.174 dev tap0 secret /etc/openvpn/secrouter.
Moxa C Programmable RTU Controllers Managing Communications Destination Gateway Genmsk Flags Metric Ref Use Iface 192.168.4.0 * 255.255.255.0 U 0 0 0 br0 192.168.2.0 * 255.255.255.0 U 0 0 0 br0 192.168.8.0 * 255.255.255.0 U 0 0 0 eth0 Interface eth1 is connected to the bridging interface br0, to which device tap0 also connects, whereas the virtual device tun sits on top of tap0.
Moxa C Programmable RTU Controllers Managing Communications Setup 3: Routed IP 1. Set up four machines as shown in the following diagram: 2. Create a configuration file named “A-tun.conf” and an executable script file named “A-tun. sh”. # point to the peer remote 192.168.8.174 dev tun secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40 ifconfig 192.168.2.173 192.168.4.174 up /etc/openvpn/A-tun.
Moxa C Programmable RTU Controllers Managing Communications Note that the parameter “ifconfig” defines the first argument as the local internal interface and the second argument as the internal interface at the remote peer. Note that $5 is the argument that the OpenVPN program passes to the script file. Its value is the second argument of ifconfig in the configuration file. 3.
5 5. Tool Chains for Application Development In this chapter we describe how to install a tool chain on the host computer to develop user applications. In addition, the process for performing cross-platform development and debugging is also introduced. For clarity, the MOXA C Programming RTU controller is called a target system.
Moxa C Programmable RTU Controllers Tool Chains for Application Development Linux Tool Chain The Linux tool chain contains a suite of cross compilers and other tools, as well as the libraries and header files that are necessary to compile your applications. These tool chain components must be installed on a Linux-based host computer (PC). The following Linux distributions can be used to install the tool chain. ioPAC 8020 series • Fedora Core 6 (on x86) • Mandrake 8.1 (on x86) • Red Hat 7.3, 8.0, 9.
Moxa C Programmable RTU Controllers Tool Chains for Application Development Compiling Applications To compile a simple C application, use the cross compiler instead of the regular compiler: #arm-linux-gcc –o example –Wall –g –O2 example.c #arm-linux-strip –s example #arm-linux-gcc -ggdb –o example-debug example.c Most of the cross compiler tools are the same as their native compiler counterparts, only with an additional prefix that specifies the target system.
Moxa C Programmable RTU Controllers Tool Chains for Application Development 192.168.4.99 is the host PC’s IP address, and 2000 is the port number. You can now begin debugging in the host environment using the interface provided by ddd. 5. Set a break point in the main function by double clicking or entering b main on the command line. 6. Click the cont button.
6 6. Programmer's Guide This chapter includes important information for programmers.
Moxa C Programmable RTU Controllers Programmer's Guide Flash Memory Partition sizes are hard coded into the kernel binary. The flash memory map is shown in the following table.
7 7. Software Lock “Software Lock” is an innovative technology developed by Moxa. It can be adopted by a system integrator or developer to protect his applications from being copied. An application is compiled into a binary format bound to the embedded computer and the operating system (OS) that the application runs on. As long as one obtains it from the computer, he/she can install it into the same hardware and the same operating system. The add-on value created by the developer is thus lost.
A A. System Commands Linux normal command utility collection: Moxa Special Utilities 1. kversion Show kernel version 2. upramdisk Mount ramdisk 3. downramdisk Unmount ramdisk 4. setdef Reset to factory defaults and reboot 5. setkey Set key command for Software Lock function 6. upgradehfm Firmware upgrade utility To view the supported system commands, use the "help" or "busybox --help" commands, as illustrated in the following examples for the ioPAC 8500 controller (RTU version 1.2.0).
Moxa C Programmable RTU Controllers System Commands export [-nf] [name[=value] ...] or false fc [-e ename] [-nlr] [first] [last for NAME [in WORDS ... ;] do COMMA for (( exp1; exp2; exp3 )); do COM function NAME { COMMANDS ; } or NA getopts optstring name [arg] help [-s] [pattern ...] hash [-lr] [-p pathname] [-dt] [na history [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [ elif kill [-s sigspec | -n signum | -si let arg [arg ...] local name[=value] ...
Moxa C Programmable RTU Controllers System Commands "busybox --help" command: root@Moxa:/# busybox --help BusyBox v1.15.3 (2013-02-18 13:27:47 CST) multi-call binary Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko and others. Licensed under GPLv2. See source distribution for full notice. Usage: busybox [function] [arguments]... or: function [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable.
B B. Module Specifications and Wiring 16-channel 24 VDC Digital Input Module RM-1602-T: 16 digital inputs, 24 VDC, sink/source type Inputs per Module: 16 channels, sink/source type On-state Voltage: 24 VDC nominal, 10 VDC min. OFF-state Voltage: 0 to 3 VDC, 3 VDC max.
Moxa C Programmable RTU Controllers Module Specifications and Wiring 16-channel Digital Output Module RM-2600-T: 16 digital outputs, 24 VDC, sink type, 0.2 A Outputs er Module: 16 channels, 24 VDC, sink type Output Impedance: 120m ohms (typical) Off-state Resistance: 500K ohms (typical) Response Time: 10 ms Over Current Protection: 200 mA per channel Isolation: I/O to logic (photocoupler isolation) Channel-to-Channel Isolation: 2.
Moxa C Programmable RTU Controllers Module Specifications and Wiring 8-channel Analog Input Module, 16-bit Resolution RM-3810-T: 8 analog inputs, 0 to 10 V, 16 bits Inputs per Module: 8 channels, differential Input Current Range: 0 to 10 VDC Input Impendence: > 10M ohms Resolution Range: 16 bits, 0.15 μA/bit Data Format: 16-bit integer (2’s complement) Accuracy: ±0.1%, FSR @ 25°C ±0.3%, FSR @ -40°C, 75°C Sampling Rate: • All channels: 12 samples/sec • Per channel: 1.