Moxa KM-2430-T [13/52] Upload run the program

Moxa KM-2430-T [13/52] Upload run the program
ioPAC RTU Software Getting Started
2-5
The following response should be shown on the screen.
root@localhost:/tmp/example/hello_world# make
/usr/local/arm-linux/bin/arm-linux-gcc -I/usr/local/arm-linux/include
-I/usr/local/arm-linux/include/RTU -o hello_world hello_world.o
-L/usr/local/arm-linux/lib -lpthread -lmxml -L/usr/local/arm-linux/lib/RTU
-lmoxa_rtu -lrtu_common -ltag -Wl,-rpath,/lib/RTU/ -Wl,--allow-shlib-undefined
The hello_world-release and hello_world-debug executable files are described as below:
hello_world-release: an ARM platform executable file (created specifically to run on the Moxa RTU
Controllers)
hello_world-debug: an ARM platform GDB debug server executable file
NOTE
Since Moxa’s tool
chain places a specially designed makefile in the /tmp/example/hello_world directory,
be
sure to type the
#make command from within that directory. If users type the #make command from any
other directory, the host L
inux PC may use other system compilers (e.g., cc or gcc) and result in errors.
Upload & Run the Program
Follow the steps below to upload and run the hello_world.c program.
Step 1: Use the telnet command to access the console of the RTU controller.
root@localhost:~# telnet 192.168.127.254
Step 2: Enter root for both the account and password.
Step 3: Before uploading the compiled program to the RTU controller, check the free space of the flash memory
on the RTU controller. If the flash memory is full, you cannot save data to the flash ROM. Use the following
command to calculate the amount of available flash memory.
root@Moxa:~# df –h
NOTE
If there is
not enough available space for user’s program, users must delete some existing files.
Step 4: Use the following commands to connect the FTP server of the RTU controller.
root@localhost:/tmp/example/hello_world# ftp 192.168.127.254
Step 5: Enter root for both the account and password.
Step 6: Use the following commands to upload hello_world-release to the RTU controller by FTP in Binary
mode
ftp> cd /home
ftp> put hello_world
Step 7: Use the following commands to run the hello_world program on the RTU controller.
root@Moxa:/home~# chmod +x hello_world
root@Moxa:/home~# ./hello_world

Содержание

Скачать