Menu

Test2

Mike Johnson

PC Test

A program to configure OpenLCB modules.

To start click the Comport button to connect to the CANUSB or CANRS interface.

Select the port from the drop down list and click OK.

Click the Get NID's button to get the list of Node ID's and aliases. This sends a broadcast FT_VNSN (Verify Node Serial Number) and each connected and working module replies with DAA_NSN (Node serial number).

Select one of the modules from the NodeAlias? drop down list.

This reads the boot string, module string and user string information from the module using DAA_UPGREAD (read 64 bytes) and DAA_DATA packets.

Setting the NodeID

For a newly programmed chip the nodeid will be 0x000000000001 or 0x000000000002. This must be changed to a unique number. Select the the NodeID tab.

This shows the current NodeID in hex, and as bytes in decimal. For a MERG member enter 3 in the first decimal box and 2 in the second. Then enter your MERG membership number in the box for this. The last decimal box is allocated by you and should be unique for all your modules. The easiest way to do this is to keep a list so you know which numbers have been used, you can also write the number on the PCB.

Having completed the boxes click Write NID to write the new node ID to the module, then click Reboot Node to restart the node with the new number. The node will then follow the protocol for getting a new 12 bit alias.

So the alias list is now out of date, so its necessary to click Get NID's to get a new list and then to select the module from the list again.

The Node ID is stored in an area of memory which is not afected by upgrading the module code from the PC using PC test. However it would be deleted when using a chip programmer and the ICSP pins to replace the code.

The alias should only change if the Node ID is changed or another module which uses the same alias is connected after both have passed the initial boot time.

User String

With even a moderate size layout there will be several modules of the same type. Making sure you are altering the right module is going to be always going to be problem.

The user string allows the user to define a string of up to 64 bytes to identify a module. It can be used to identify its location or its function within the layout.

Change the contents of the User Str edit box and then click the Write User Str button to set this.

The information is held in memory which is not changed by upgrading the module software from the PC using PC test, but would be lost if the chip is reprogrammed using the ICSP pins.

Save and Restore Configuration

On the Node tab there are Save Config and Restore Config buttons. All modules should respond to the commands used by these buttons even if there is no information to be saved.

Clicking the button results in a standard file save or restore dialog box to select the file to be used.

The format of the configuration file is readable and easy to edit, although the meaning of the bits may be hard to understand. The format will probably change in later version when XML and XSD files are used to make them easier to understand.

Producer events are prefixed by PE and have the 4 hex digits for the index number and the 16 hex digits for the event.

Consumer events are prefixed by EV and have the 16 hex digits for the event followed by pairs of hex digits for the action taken.

Node variables have NV folowed by the index and the value.

SERVO configuration file

NodeNumber=030200097204
NV0040
NV017D
NV027D
NV037D
NV047D
NV057D
NV067D
NV077D
NV08C0
NV097D
NV0A7D
NV0B7D
NV0C7D
NV0D7D
NV0E7D
NV0F7D
NV10FF
NV11FF
NV1200
NV13FF
NV14FF
NV15FF
NV16FF
NV17FF
NV18FF
NV19FF
NV1AFF
EV030200097202000108
EV030200097202000000
End

CANACE8C configuration file

NodeNumber=03020009720E
NV0000
PE000003020009720E0000
PE000103020009720E0001
PE000203020009720E0002
PE000303020009720E0003
PE000403020009720E0004
PE000503020009720E0005
PE000603020009720E0006
PE000703020009720E0007
PE000803020009720E0008
PE000903020009720E0009
PE000A03020009720E000A
PE000B03020009720E000B
PE000C03020009720E000C
PE000D03020009720E000D
PE000E03020009720E000E
PE000F03020009720E000F
End

CANACE3 or CANACE8C

The CANACE3 is switch or botton matrix scanning module. It's a producer module which generates events when a switch or button is closed or opened.

The event it produces can be configured by the user. Default values need to be initialized after setting the node id.

Click the producer events tab.

Next click the Set All Defaults button. This will initialize the event table to the Node ID, the switch number and the off or on event.

To read events the Index (switch number and off or on) needs to be set and the read event button clicked.

Entering a new 6 byte NodeID part and 2 byte index followed by Write Event will update the table.

Erase Event will mean that nothing will be generated by the event, this would be the case if only push button on events were required.

The CANACE3 has 256 events (2 for each switch position) and the CANACE8 has 16 events. If the default configuration is not used then it should be saved.

The CANACE8C also has a node variable to extend the de-bounce time of the inputs.

CANACC4

This module is for 4 solenoid type point motors.

It contains a built in capacitor discharge unit (CDU) to make point operation reliable. The output is a 100 msec pulse, followed by 600 msec delay to allow for the CDU recharge time.

From the PC the event action byte only uses the bottom 3 bit to select 1 of 8 outputs.

0
1A

1
1B

2
2A

3
2B

4
3A

5
3B

6
4A

7
4B

The consumer events tab can be used to examine and set individual events.

The Read All Events sets the index to 0 and reads one event, Read Next will increase the index and read an event.

A typical configuration file may be:

NodeNumber=03020009720D
EV030200097202000100
EV030200097202000107
EV030200097202000001
EV030200097202000006
End

This show that events from a MERG members module with serial number 2, index 0 operates output 1B and 4A, and the event with index 1 operates outputs 1A and 4B.

This particular configuration was generated using the switches on the module and then deleting some entries which had been added by mistake.

Hopefully the future implementation of XML and XSD files should make all this easier to understand.

CANACC5 and CANACC8

These modules use the same code. The CANACC5 has 8 high current (up to 1 Amp) push pull outputs, the CANACC8 has 8 open collector outputs. In some applications the open collect driver chip is replace by a DIL resistor package to provide 8 low current (up to 25 mA) push pull outputs.

From the PC the event action byte uses the bottom 3 bits (bits 0,1 and 2) to select 1 of 8 outputs. Bit 3 is used to indicate the polarity, 0 for off and 1 for on. Bit 4 is used to toggle the next output in the opposite direction. This toggle option would be of use for slow motion point motors where the motor is connected across two adjacent outputs.

NodeNumber=030200097203
EV03020009720200011E
EV030200097202000112
EV030200097202000016
EV03020009720200001A
End

The first EV line shows that index 1 event from module 2 should toggle outputs 6 and 7 with 6 going on. The 3rd line has the inverse with index 0 sending output 6 off (and 7 on).

Again this configuration can be generated using the module switches and edited on the PC.

SERVO

The servo module uses a CANACC8 with the driver chip removed and replaced by DIL resistors.

The servo endpoints are set using node variables. The initial configuration has then set to the mid point. Selecting the module and the Node Variables tab allows these values to be changed.

The mid position is 0x7D and the value should slowly be changed until the right amount of movement is produced.

The servo on output 0 uses node variables 0 and 8, output 1 uses 1 and 9.

I'm using 0x68 and 0xB0 as the end points for a servo but the values that will allow the point blades to close reliably depends on the gearing and linkage to the blades.


Related

Wiki: Home

MongoDB Logo MongoDB