Ignore:
Timestamp:
01/10/03 15:38:47 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc

    r1690 r1701  
    6060        lout << "Scaling: " <<  (val&4   ?"on":"off") << "  ";
    6161        lout << "Modulo: " <<   (val&4096?"on":"off") << endl;
     62        return;
    6263
    6364    case 0x6001:
     
    7879
    7980    case 0x6502:
     81        if (val==0)
     82            val = 1;  // Single Turn = Multiturn with one turn
    8083        lout << "- Possible Turns: " << dec << val << endl;
    81         fTurns = val ? val : 1; // Single Turn = Multiturn with one turn
     84        fTurns = val;
    8285        return;
    8386
     
    198201    // Requesting and checking (FIXME) type of encoder
    199202    //
    200     lout << "- Requesting Hardware Type (SDO 0x1000) of " << GetNodeName() << endl;
     203    lout << "- " << GetNodeName() << ": Requesting Hardware Type (0x1000)." << endl;
    201204    RequestSDO(0x1000);
    202205    if (!WaitForSdo(0x1000))
     
    210213    // Read physical ticks per revolution
    211214    //
    212     lout << "- Requesting physical ticks/revolution (SDO 0x6501) of " << GetNodeName() << endl;
     215    lout << "- " << GetNodeName() << ": Requesting physical ticks/revolution (SDO 0x6501)." << endl;
    213216    RequestSDO(0x6501);
    214217    WaitForSdo(0x6501);
     
    217220    // Read number of possible ticks per revolution
    218221    //
    219     lout << "- Requesting possible ticks/revolution (SDO 0x6502) of " << GetNodeName() << endl;
     222    lout << "- " << GetNodeName() << ": Requesting possible ticks/revolution (SDO 0x6502)." << endl;
    220223    RequestSDO(0x6502);
    221224    WaitForSdo(0x6502);
     
    224227    // Set logic ticks/revolution = physical ticks/revolution => scale factor = 1
    225228    //
    226     lout << "- Configuring SDO 0x6001 of " << GetNodeName() << endl;
     229    lout << "- " << GetNodeName() << ": Configuring log. tick/rev (0x6001)." << endl;
    227230    SendSDO(0x6001, fTicks);
    228231    WaitForSdo(0x6001);
     
    231234    // Set maximum number of ticks (ticks * turns)
    232235    //
    233     lout << "- Configuring SDO 0x6002 of " << GetNodeName() << endl;
     236    lout << "- " << GetNodeName() << ": Configuring max number of ticks (0x6002)." << endl;
    234237    SendSDO(0x6002, (LWORD_t)(fTicks*fTurns));
    235238    WaitForSdo(0x6002);
    236239
    237240    //
     241    // Delete preset Value
     242    //
     243    lout << "- " << GetNodeName() << ": Delete preset value (0x6003)." << endl;
     244    SendSDO(0x6003, (LWORD_t)0xffffffff);
     245    WaitForSdo(0x6003);
     246
     247    //
    238248    // Configure PDOs
    239249    //
    240     lout << "- Configuring SDO 0x1802 of " << GetNodeName() << endl;
     250    lout << "- " << GetNodeName() << ": Configuring PDOs (0x1802)." << endl;
    241251    SendSDO(0x1802, 1, (LWORD_t)0x281);
    242252    WaitForSdo(0x1802, 1);
    243253
    244254    //
    245     // Delete preset Value
    246     //
    247     lout << "- Configuring SDO 0x6003 of " << GetNodeName() << endl;
    248     SendSDO(0x6003, (LWORD_t)0xffffffff);
    249     WaitForSdo(0x6003);
    250 
    251     //
    252255    // Request Parameter
    253256    //
    254     lout << "- Requesting SDO 0x6000 of " << GetNodeName() << endl;
     257    lout << "- " << GetNodeName() << ": Requesting SDO 0x6000." << endl;
    255258    RequestSDO(0x6000);
    256259    WaitForSdo(0x6000);
     
    258261    ReqPos();
    259262
    260     lout << "- Start Node " << GetNodeName() << endl;
     263    lout << "- " << GetNodeName() << ": Start Node (NMT)." << endl;
    261264    SendNMT(kNMT_START);
    262265}
     
    267270    // Request Position
    268271    //
    269     lout << "- Requesting Position of " << GetNodeName() << endl;
     272    lout << "- " << GetNodeName() << ": Requesting Position." << endl;
    270273    RequestSDO(0x6004);
    271274    WaitForSdo(0x6004);
     
    277280    fTurn = pre/16384;
    278281
    279     lout << " - Setting Preset " << GetNodeName() << endl;
     282    lout << "- " << GetNodeName() << ": Setting Preset." << endl;
    280283    SendSDO(0x6003, (LWORD_t)fPos);
    281284    WaitForSdo(0x6003);
     
    284287void ShaftEncoder::StopDevice()
    285288{
    286     lout << "- Stop Node " << GetNodeName() << endl;
     289    lout << "- " << GetNodeName() << ": Stop Node (NMT)." << endl;
    287290    SendNMT(kNMT_STOP);
    288291}
Note: See TracChangeset for help on using the changeset viewer.