Changeset 1701 for trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
- Timestamp:
- 01/10/03 15:38:47 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r1690 r1701 60 60 lout << "Scaling: " << (val&4 ?"on":"off") << " "; 61 61 lout << "Modulo: " << (val&4096?"on":"off") << endl; 62 return; 62 63 63 64 case 0x6001: … … 78 79 79 80 case 0x6502: 81 if (val==0) 82 val = 1; // Single Turn = Multiturn with one turn 80 83 lout << "- Possible Turns: " << dec << val << endl; 81 fTurns = val ? val : 1; // Single Turn = Multiturn with one turn84 fTurns = val; 82 85 return; 83 86 … … 198 201 // Requesting and checking (FIXME) type of encoder 199 202 // 200 lout << "- Requesting Hardware Type (SDO 0x1000) of " << GetNodeName()<< endl;203 lout << "- " << GetNodeName() << ": Requesting Hardware Type (0x1000)." << endl; 201 204 RequestSDO(0x1000); 202 205 if (!WaitForSdo(0x1000)) … … 210 213 // Read physical ticks per revolution 211 214 // 212 lout << "- Requesting physical ticks/revolution (SDO 0x6501) of " << GetNodeName()<< endl;215 lout << "- " << GetNodeName() << ": Requesting physical ticks/revolution (SDO 0x6501)." << endl; 213 216 RequestSDO(0x6501); 214 217 WaitForSdo(0x6501); … … 217 220 // Read number of possible ticks per revolution 218 221 // 219 lout << "- Requesting possible ticks/revolution (SDO 0x6502) of " << GetNodeName()<< endl;222 lout << "- " << GetNodeName() << ": Requesting possible ticks/revolution (SDO 0x6502)." << endl; 220 223 RequestSDO(0x6502); 221 224 WaitForSdo(0x6502); … … 224 227 // Set logic ticks/revolution = physical ticks/revolution => scale factor = 1 225 228 // 226 lout << "- Configuring SDO 0x6001 of " << GetNodeName()<< endl;229 lout << "- " << GetNodeName() << ": Configuring log. tick/rev (0x6001)." << endl; 227 230 SendSDO(0x6001, fTicks); 228 231 WaitForSdo(0x6001); … … 231 234 // Set maximum number of ticks (ticks * turns) 232 235 // 233 lout << "- Configuring SDO 0x6002 of " << GetNodeName()<< endl;236 lout << "- " << GetNodeName() << ": Configuring max number of ticks (0x6002)." << endl; 234 237 SendSDO(0x6002, (LWORD_t)(fTicks*fTurns)); 235 238 WaitForSdo(0x6002); 236 239 237 240 // 241 // Delete preset Value 242 // 243 lout << "- " << GetNodeName() << ": Delete preset value (0x6003)." << endl; 244 SendSDO(0x6003, (LWORD_t)0xffffffff); 245 WaitForSdo(0x6003); 246 247 // 238 248 // Configure PDOs 239 249 // 240 lout << "- Configuring SDO 0x1802 of " << GetNodeName()<< endl;250 lout << "- " << GetNodeName() << ": Configuring PDOs (0x1802)." << endl; 241 251 SendSDO(0x1802, 1, (LWORD_t)0x281); 242 252 WaitForSdo(0x1802, 1); 243 253 244 254 // 245 // Delete preset Value246 //247 lout << "- Configuring SDO 0x6003 of " << GetNodeName() << endl;248 SendSDO(0x6003, (LWORD_t)0xffffffff);249 WaitForSdo(0x6003);250 251 //252 255 // Request Parameter 253 256 // 254 lout << "- Requesting SDO 0x6000 of " << GetNodeName()<< endl;257 lout << "- " << GetNodeName() << ": Requesting SDO 0x6000." << endl; 255 258 RequestSDO(0x6000); 256 259 WaitForSdo(0x6000); … … 258 261 ReqPos(); 259 262 260 lout << "- Start Node " << GetNodeName()<< endl;263 lout << "- " << GetNodeName() << ": Start Node (NMT)." << endl; 261 264 SendNMT(kNMT_START); 262 265 } … … 267 270 // Request Position 268 271 // 269 lout << "- Requesting Position of " << GetNodeName()<< endl;272 lout << "- " << GetNodeName() << ": Requesting Position." << endl; 270 273 RequestSDO(0x6004); 271 274 WaitForSdo(0x6004); … … 277 280 fTurn = pre/16384; 278 281 279 lout << " - Setting Preset " << GetNodeName()<< endl;282 lout << "- " << GetNodeName() << ": Setting Preset." << endl; 280 283 SendSDO(0x6003, (LWORD_t)fPos); 281 284 WaitForSdo(0x6003); … … 284 287 void ShaftEncoder::StopDevice() 285 288 { 286 lout << "- Stop Node " << GetNodeName()<< endl;289 lout << "- " << GetNodeName() << ": Stop Node (NMT)." << endl; 287 290 SendNMT(kNMT_STOP); 288 291 }
Note:
See TracChangeset
for help on using the changeset viewer.