Moxa ioPAC 8500-5-M12-C-T [30/69] Moxa c programmable rtu controllers getting started

Moxa ioPAC 8500-9-RJ45-C-T [30/69] Moxa c programmable rtu controllers getting started
Moxa C Programmable RTU Controllers Getting Started
2-18
[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.c
[root@localhost hello]# _
The hello-release and hello-debug are described as below:
hello-release—An ARM platform executable file (created specifically to run on the Moxa RTU Controllers)
hello-debug—An ARM platform GDB debug server execution file (see Chapter 5 for details)
NOTE
Since the Moxa’s tool chain places a specially designed Makefile in the directory
/tmp/example/ hello
, be
sure to type the
#make command from within that directory. If users type the #make command from any
other directory, the host Linux PC may use other system compilers (for example, cc or gcc) and resulting
errors.
Uploading and Running the “Hello” Program
1. Use the following commands to upload hello-release to the RTU controller by FTP.
From the PC, type:
#ftp 192.168.127.254
2. Use the bin command to set the transfer mode to Binary mode, and then use the put command to initiate
the file transfer:
ftp> bin
ftp> cd /home
ftp> put hello-release
3. From the Moxa RTU, type:
# chmod +x hello-release
# ./hello-release
The word Hello will be printed on the screen.
root@Moxa:~# ./hello-release
Hello
To run the program automatically after system starts, modify the rc.local file at /etc/rc.d as follows,
Modify the /home/autoexec.sh will also be OK.

Содержание

Скачать