fp@1184: /***************************************************************************** fp@1184: * fp@1363: * $Id$ fp@1363: * fp@1363: * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH fp@1363: * fp@1363: * This file is part of the IgH EtherCAT Master. fp@1363: * fp@1363: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1363: * modify it under the terms of the GNU General Public License version 2, as fp@1363: * published by the Free Software Foundation. fp@1363: * fp@1363: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1363: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1363: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1363: * Public License for more details. fp@1363: * fp@1363: * You should have received a copy of the GNU General Public License along fp@1363: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1363: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1363: * fp@1363: * --- fp@1363: * fp@1363: * The license mentioned above concerns the source code only. Using the fp@1363: * EtherCAT technology and brand is only permitted in compliance with the fp@1363: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1184: * fp@1184: ****************************************************************************/ fp@1184: fp@1184: #include "SdoCommand.h" fp@1184: fp@1184: /*****************************************************************************/ fp@1184: fp@1184: SdoCommand::SdoCommand(const string &name, const string &briefDesc): fp@1184: Command(name, briefDesc) fp@1184: { fp@1184: } fp@1184: fp@1184: /****************************************************************************/ fp@1184: fp@1184: const char *SdoCommand::abortText(uint32_t abortCode) fp@1184: { fp@1184: const AbortMessage *abortMsg; fp@1184: fp@1184: for (abortMsg = abortMessages; abortMsg->code; abortMsg++) { fp@1184: if (abortMsg->code == abortCode) { fp@1184: return abortMsg->message; fp@1184: } fp@1184: } fp@1184: fp@1184: return "???"; fp@1184: } fp@1184: fp@1184: /*****************************************************************************/ fp@1184: fp@1327: /** SDO abort messages. fp@1184: * fp@1327: * The "Abort SDO transfer request" supplies an abort code, which can be fp@1184: * translated to clear text. This table does the mapping of the codes and fp@1184: * messages. fp@1184: */ fp@1184: const SdoCommand::AbortMessage SdoCommand::abortMessages[] = { fp@1184: {0x05030000, "Toggle bit not changed"}, fp@1327: {0x05040000, "SDO protocol timeout"}, fp@1184: {0x05040001, "Client/Server command specifier not valid or unknown"}, fp@1184: {0x05040005, "Out of memory"}, fp@1184: {0x06010000, "Unsupported access to an object"}, fp@1184: {0x06010001, "Attempt to read a write-only object"}, fp@1184: {0x06010002, "Attempt to write a read-only object"}, fp@1184: {0x06020000, "This object does not exist in the object directory"}, fp@1327: {0x06040041, "The object cannot be mapped into the PDO"}, fp@1184: {0x06040042, "The number and length of the objects to be mapped would" fp@1327: " exceed the PDO length"}, fp@1184: {0x06040043, "General parameter incompatibility reason"}, fp@1184: {0x06040047, "Gerneral internal incompatibility in device"}, fp@1184: {0x06060000, "Access failure due to a hardware error"}, fp@1184: {0x06070010, "Data type does not match, length of service parameter does" fp@1184: " not match"}, fp@1184: {0x06070012, "Data type does not match, length of service parameter too" fp@1184: " high"}, fp@1184: {0x06070013, "Data type does not match, length of service parameter too" fp@1184: " low"}, fp@1184: {0x06090011, "Subindex does not exist"}, fp@1184: {0x06090030, "Value range of parameter exceeded"}, fp@1184: {0x06090031, "Value of parameter written too high"}, fp@1184: {0x06090032, "Value of parameter written too low"}, fp@1184: {0x06090036, "Maximum value is less than minimum value"}, fp@1184: {0x08000000, "General error"}, fp@1184: {0x08000020, "Data cannot be transferred or stored to the application"}, fp@1184: {0x08000021, "Data cannot be transferred or stored to the application" fp@1184: " because of local control"}, fp@1184: {0x08000022, "Data cannot be transferred or stored to the application" fp@1184: " because of the present device state"}, fp@1184: {0x08000023, "Object dictionary dynamic generation fails or no object" fp@1184: " dictionary is present"}, fp@1184: {} fp@1184: }; fp@1184: fp@1184: /****************************************************************************/