CANopen stack implemented in Erlang
Erlang Makefile
Permalink
Failed to load latest commit information.
doc
ebin
include
priv
src
test
.gitignore
README.md
rebar.config
sys.config

README.md

canopen

canopen implements a CANopen stack.
See www.can-cia.org for a description of CANopen.

Dependencies

To build canopen you will need a working installation of Erlang R15B (or later).
Information on building and installing Erlang/OTP can be found here (more info).

canopen is built using rebar that can be found here, with building instructions here. rebar's dynamic configuration mechanism, described here, is used so the environment variable REBAR_DEPS should be set to the directory where your erlang applications are located.

canopen also requires the following applications to be installed:

Downloading

Clone the repository in a suitable location:

$ git clone git://github.com/tonyrog/canopen.git

Configurating

Concepts

canopen can be started with a number of options.
For details either check co_api.erl - start_link() or in the full implementation documentation, see below on how to create it.

Files

Arguments to all applicable erlang applications are specified in an erlang configuration file.
An example can be found in "sys.config".

Building

Rebar will compile all needed dependencies.
Compile:

$ cd canopen
$ rebar compile
...
==> canopen (compile)

Running

There is a quick way to run the application for testing:

$ erl -config sys -pa <path>/canopen/ebin
>canopen:start().

(Instead of specifing the path to the ebin directory you can set the environment ERL_LIBS.)

Stop:

>halt().

Release

To generate a proper release follow the instructions in Release Handling or look in the Rebar tutorial.

Before the last step you have to update the file "canopen/rel/files/sys.config" with your own settings. You probably also have to update "canopen/rel/reltool.config" with the correct path to your application (normally "{lib_dirs, ["../.."]}") and all apps you need.

       {app, sasl,   [{incl_cond, include}]},
       {app, stdlib, [{incl_cond, include}]},
       {app, kernel, [{incl_cond, include}]},
       {app, sl, [{incl_cond, include}]},
       {app, eapi, [{incl_cond, include}]},
       {app, can, [{incl_cond, include}]},
       {app, canopen, [{incl_cond, include}]}

And then you run:

$ rebar generate

.

When generating a new release the old has to be (re)moved.

Start node:

$ cd rel
$ canopen/bin/canopen start

(If you want to have access to the erlang node use

console 

instead of

start

.)

Documentation

canopen is documented using edoc. To generate the documentation do:

$ cd canopen
$ rebar doc