SIXNET IPm Application Development Kit (IADK)

SIXNET IPm Application Development Kit (IADK)
Tutorial
This is an outline of how to compile, load, and run the supplied sample IPm
application, oem_iodb.c.
Step 1: Install the IADK. Refer to iadk_install_guide.pdf if necessary.
Step 2: Open up the file oem_iodb.c in your favorite text editor.
Step 3: This program makes use of all the IPM I/O Database functions. These functions are all you need to
store, retrieve, or change I/O. Notice the #include <iodb.h> line. iodb.h has all the function
prototypes. It is all you need to include to start making your own projects.
Step 4: Read through the file IADK_use_guide.pdf. Pay attention to the PATH environment variable.
Typing 'echo $PATH' should print '/opt/sixnet/bin' along with the rest of your path. If
‘/opt/sixnet/bin’ is missing from the path, set it now.
using bash: export PATH=/opt/sixnet/bin:${PATH}
using csh: setenv PATH /opt/sixnet/bin:${PATH}
Step 5: Compile the sample program:
powerpc-linux-gcc oem_iodb.c -lsxiodb –lddio -lsxio -o oem_iodb
Now you should see the file 'oem_iodb'. This is ready to be run on the IPm.
Step 6: Load the program (oem_iodb) to the IPm.
The compiled program can be loaded to the IPm station using either ftp or the SIXNET Tool Kit.
Using FTP:
Note: FTP must first be enabled in the IPm station. There is an “Enable FTP” checkbox
selection in the “Advanced” view of the IPm Configuration window within the SIXNET I/O
Tool Kit. You’ll need to check this “Enable FTP” box and load the configuration into your
IPm station.
Now run your favorite FTP client (or just type “ftp” at the command prompt) and open a connection to the
IPm (see example below). Login is "anonymous". No password is necessary. (Hit <Enter>.)
:
Example: if your IPm's IP address is 10.1.0.1, you would type:
ftp 10.1.0.1 [enter]anonymous [enter][enter]
SIXNET Technology Park
331 Ushers Road • Ballston Lake, NY 12019 • USA
518.877.5173 • Fax 518.877.8346 • [email protected]
SIXNET IPm Application Development Kit (IADK)
Next, 'cd' to the existing location you want to place 'oem_iodb' (typically /usr/local/bin) and use
'put' in binary mode to upload your file:
bin [enter]cd /usr/local/bin [enter]put oem_iodb [enter]quit [enter]
Optionally, you can use the mkdir command and create a folder to upload your file into.
mkdir /my_folder [enter]bin [enter]cd /my_folder [enter]put oem_iodb
[enter]quit [enter]
Using the SIXNET I/O Tool Kit: Copy the compiled oem_iodb file into a folder on your Windows
computer. Run the SIXNET I/O Tool Kit and open your project file. Click in any of the fields for your IPm
station. Select Operations File Operations. In the File Operations window, select the location you want
to place 'oem_iodb'. Then click the Load File button. In the file selection window, locate the oem_iodb file
and click the “Open” button.
Step 7: Start and test the program (oem_iodb) running in the IPm.
To start the program running, make a telnet connection to the IPm. The default login/password
is 'root'. There is no password. 'cd' to the directory where you placed the program.
Note:
Telnet must first be enabled in the IPm station. There is an “Enable Telnet Protocol”
checkbox selection in the “Advanced” view of the IPm Configuration window within the
SIXNET I/O Tool Kit. You’ll need to check this “Enable Telnet Protocol” box and load the
configuration into your IPm station.
Now run Telnet and establish a connection to the IPm (see example below).
telnet 10.1.0.1 [enter]root [enter]cd /usr/local/bin [enter]
Note: You may need to set the execute flag for the file:
chmod +x oem_iodb
To run the program, type:
:
./oem_iodb
You should see diagnostic information printed to the screen.
Configuring the IPm station to start your program automatically
The program can be listed in a startup script file in the IPm station.
Refer to the file iadk_use_guide.pdf for details on automatic startup of a program.
SIXNET Technology Park
331 Ushers Road • Ballston Lake, NY 12019 • USA
518.877.5173 • Fax 518.877.8346 • [email protected]
SIXNET Technology Park
331 Ushers Road • Ballston Lake, NY 12019 • USA
518.877.5173 • Fax 518.877.8346 • [email protected]