OpenLCB Python Prototype

This is the index page of the OpenLCBâ„¢ Python prototypes directory.

Most of the Python modules in this package are meant to be run from the command line, or invoked programmatically.

To run one from the Mac OS X or Linux command line, first edit the defaults.py file with your connection information, then do e.g.:

./verifyNodeGlobal.py -v

To run the full set of tests from the Mac OS X or Linux command line, do :

./allTest.py -t -v && echo OK

followed by testing the start-up sequencing with :

./testStartup.py -t -v && echo OK

(Reset the node when prompted to force the start-up sequence to run)

When running from the command line, internal help is available via the -h option, as in:

./verifyNodeGlobal.py -h

Common options are:

There are text files containing typical output from running

./allTest.py -t -V

and

./testStartup.py -t -V

test scripts that you can consult to see what normal operation looks like. Note that they contain node IDs, aliases, and event IDs that are specific to the particular node being tested, so your mileage

vary.

The type of access (Ethernet or USB) and parameters such as IP address, default node IDs, etc are defined in the default.py file. When using the command line, edit that file for your specific needs. If you're using a serial connection, you need to have PySerial installed, which is described here.

Utilities and Modules

The basic Ethernet connection is accessed via the "ethernetolcblink" module.

    import ethernetolcblink

The basic USB-Serial connection is accessed via the "serialolcblink" module.

    import serialolcblink

Other cross-connection utilities can found in the "canolcbutils" module.

Frame and Message Tools

verifyNodeGlobal
Send a "Verify Node Global" message, getting a reply from each connected node.
verifyNodeAddressed
Send a "Verify Node Addressed" message, getting a reply from the addressed node.
identifyConsumers
Send an "Identify Consumers" message, which will generate a reply from any node using consuming the Event ID
identifyProducers
Send a "Identify Producers" message, which will generate a reply from any node using consuming the Event ID.
identifyEventsGlobal
Send a "Identify Events Global" message, getting a reply from each connected node.
identifyEventsAddressed
Send a "Verify Node Global" message.
datagram
Send a "datagram" message.

Tests

allTest
Runs the complete set of tests in sequence
testProducerConsumerNotification
Uses IdentifyEvents to learn which events a node produces and consumes, then checks that IdentifyConsumers and IdentifyProducers will find them.
testConfigurationProtocol
Does a sequence of tests of the configuration protocol
testConfigurationProtocol
Does a sequence of tests of the configuration protocol

Tools

monitor
Monitors received frames until cancelled
readConfiguration
Reads from a node via the configuration protocol
ethernetolcblink
Allows you to send specific CAN frames via an Ethernet adapter
getUnderTestAlias
Assumes there is only one node attached, and finds the alias for addressing it.




This web site contains trademarks and copyrighted information. Please see the Licensing page.

This is SVN $Revision: 2771 $ of 08/16/09.