nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: TestMasterSlave nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210:

nico@210: TestMasterSlave nico@210:

nico@210: ************************************************************** nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * simple example for PC. It does implement 2 CanOpen nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * in the same process. A master and a slave. Both nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * together, exchanging periodically NMT, SYNC, &sstarf#star; nico@210: nico@210:

nico@210: * and PDO. Master configure heartbeat producer time nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * @1000 ms for slave node-id 0x02 by concise DCF. nico@210: nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
nico@210: Usage: nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210:
./TestMasterSlave OPTIONS] nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
nico@210: OPTIONS: nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210:
nico@210:
-l : Can library nico@210: [libcanfestival_can_virtual.so] nico@210: nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
: nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
nico@210:
-s : bus name [0] nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
nico@210:
-S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) &sstarf#star;
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
: nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
*
nico@210: nico@210:

nico@210: * nico@210:
nico@210:
-m : bus name [1] nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: * nico@210:
nico@210:
-M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) &sstarf#star;
nico@210: nico@210:

nico@210: * nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
&sstarf#star;
nico@210: nico@210:

nico@210: ************************************************************** nico@210: nico@210:

nico@210: nico@210:

nico@210:
nico@210: nico@210:

nico@210: Notes for Concise DCF : nico@210: nico@210:

nico@210: nico@210:

nico@210:
nico@210: nico@210:

nico@210: In this example, Master configure producer time at 1000 ms nico@210: for slave node-id 0x02 by concise DCF according DS-302 profile. nico@210: nico@210:

nico@210: nico@210: nico@210:

nico@210: Index 0x1F22 , sub-index 0x00 of the master OD, correspond to the nico@210: number of entries. This equal to the maximum possible nodeId (127). nico@210: Each sub-index points to the Node-ID of the device, to which the nico@210: configuration belongs. nico@210: nico@210:

nico@210: nico@210:

nico@210:
nico@210: nico@210:

nico@210: To add more parameters configurations to the slave, the value at nico@210: sub-index 0x02 must be a binary stream (little-endian) following nico@210: this structure : nico@210: nico@210:

nico@210: nico@210: nico@210:

nico@210: [ nb of entries / index parameter 1 / sub-index parameter 1 size nico@210: data parameter 1 data parameter 1 / index parameter n / ...] nico@210: nico@210:

nico@210: nico@210:
nico@210:
nico@210:
(UNS32) nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
(UNS16) (UNS8) nico@210: nico@210:
nico@210:
nico@210:
nico@210:
nico@210:
nico@210: UNS32) nico@210:
nico@210: DOMAIN)
nico@210: nico@210:

nico@210: nico@210: nico@210:

nico@210: So the binary value stream to configure heartbeat producer time must be nico@210: : nico@210: nico@210:

nico@210: nico@210:

nico@210:
nico@210: nico@210:

nico@210: 0100000017100002000000e803 nico@210: nico@210:

nico@210: nico@210:

nico@210:
nico@210: nico@210:

nico@210: The slave node is configured just before the Master entering in nico@210: Pre_operational state. nico@210: nico@210:

nico@210: nico@210:

nico@210: nico@210:
nico@210: epimerde nico@215: 2007-06-08 nico@210:
nico@210: nico@210: