API C#
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager Class Reference

This class represents all the method you need to access diagnostic data from JACO. From this class you can access and manage errors stored in JACO and all information from the class CPosition. More...

Public Member Functions

 CJacoDiagnosticDataManager (CCypherMessage encryptedPass)
 Initializes a new instance of the CJacoDiagnosticDataManager class. Developper that use that API should never have to declare an object of this class because you can access it via the object CJacoArm. More...
 
ulong GetErrorLogCount ()
 Get the error log count. More...
 
List< CErrorGetErrorsFromJaco ()
 Gets a list of all the error from Jaco. More...
 
int GetPositionLogCount ()
 Get the position log count. More...
 
float[] GetSensorsInfo ()
 Gets information about Jaco's sensors. More...
 
CPosition GetPositionFromJaco (int index)
 Gets all the positions from jaco. Check the position count before calling this method because the transfer can be very long. You may consider GetPositionsFromJaco(int start, int end) to choose a range of positions. More...
 
CPeripheralInformation GetPeripheralInformationFromJaco ()
 Gets the peripheal information from jaco. More...
 
CPosition GetPositionLogLiveFromJaco ()
 Gets positions from jaco in a specific range. More...
 
double RealSpeedTest ()
 Execute a speed test of the USB connection. More...
 
void DeleteErrorLog ()
 Delete the error log. More...
 

Public Attributes

const int SENSORSINFO_SIZE = 14
 
const int SENSORSINFO_SUPPLYVOLTAGE = 0
 
const int SENSORSINFO_CURRENTCONSUMED = 1
 
const int SENSORSINFO_ACCELERATIONX = 2
 
const int SENSORSINFO_ACCELERATIONY = 3
 
const int SENSORSINFO_ACCELERATIONZ = 4
 
const int SENSORSINFO_ACTUATORTEMP1 = 5
 
const int SENSORSINFO_ACTUATORTEMP2 = 6
 
const int SENSORSINFO_ACTUATORTEMP3 = 7
 
const int SENSORSINFO_ACTUATORTEMP4 = 8
 
const int SENSORSINFO_ACTUATORTEMP5 = 9
 
const int SENSORSINFO_ACTUATORTEMP6 = 10
 
const int SENSORSINFO_FINGERTEMP1 = 11
 
const int SENSORSINFO_FINGERTEMP2 = 12
 
const int SENSORSINFO_FINGERTEMP3 = 13
 

Detailed Description

This class represents all the method you need to access diagnostic data from JACO. From this class you can access and manage errors stored in JACO and all information from the class CPosition.

Constructor & Destructor Documentation

Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.CJacoDiagnosticDataManager ( CCypherMessage  encryptedPass)

Initializes a new instance of the CJacoDiagnosticDataManager class. Developper that use that API should never have to declare an object of this class because you can access it via the object CJacoArm.

Parameters
encryptedPassThe encrypted pass.

Member Function Documentation

void Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.DeleteErrorLog ( )

Delete the error log.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) {

m_Jaco.DiagnosticManager.DataManager.DeleteErrorLog();

} } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
ulong Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetErrorLogCount ( )

Get the error log count.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) {

ulong Count = m_Jaco.DiagnosticManager.DataManager.GetErrorLogCount();

System.Console.WriteLine("Error count : " + Count);

} } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
The count
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
List<CError> Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetErrorsFromJaco ( )

Gets a list of all the error from Jaco.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) {

ulong CountError = (ulong)m_Jaco.DiagnosticManager.DataManager.GetErrorLogCount();

if (CountError > 0)
{
    //We get a list of position and we take the first element.
    CError error = m_Jaco.DiagnosticManager.DataManager.GetErrorsFromJaco()[0];

    //We do what need to be done with the list.
    //Here, we display the average power consumed by JACO.

    System.Console.WriteLine("Code version : " + error.CodeVersion);
}
else
{
    System.Console.WriteLine("No error found");
}

} } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
The list of Error
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
CPeripheralInformation Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetPeripheralInformationFromJaco ( )

Gets the peripheal information from jaco.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) { CPeripheralInformation info = m_Jaco.DiagnosticManager.DataManager.GetPeripheralInformationFromJaco();

System.Console.WriteLine("Device ID : " + info.DeviceID); } } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
The peripheral information of Jaco.
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
CPosition Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetPositionFromJaco ( int  index)

Gets all the positions from jaco. Check the position count before calling this method because the transfer can be very long. You may consider GetPositionsFromJaco(int start, int end) to choose a range of positions.

Returns
A list that contains all position from Jaco.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) { //A list to store the positions from Jaco. List<CPosition> list = new List<CPosition>();

//Get the index of the last recorded position. int index = m_Jaco.DiagnosticManager.DataManager.GetPositionLogCount();

//Loop until you get the last 50 positions for (int i = index; i > index - 50; i–) { list.Add(m_Jaco.DiagnosticManager.DataManager.GetPositionFromJaco(i)); }

//Show the time of each positions for (int i = 0; i < (list.Count); i++) { System.Console.WriteLine("time absolute #" + i + " = " + list[i].TimeAbsolute); } } } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
int Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetPositionLogCount ( )

Get the position log count.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) {

int Count = m_Jaco.DiagnosticManager.DataManager.GetPositionLogCount();

System.Console.WriteLine("CPosition count : " + Count);

} } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
The count
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
CPosition Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetPositionLogLiveFromJaco ( )

Gets positions from jaco in a specific range.

Parameters
startThe starting index.
endThe endding index.
Returns
A list of position.

try { CCypherMessage cypherPass;

//MyValidPassword is a string containing the password. cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword); CJacoArm m_Jaco = new CJacoArm(cypherPass);

if (m_Jaco.JacoIsReady()) { int CountPosition = m_Jaco.DiagnosticManager.DataManager.GetPositionLogCount();

//We get a list of position and we take the first element. CPosition Position = m_Jaco.DiagnosticManager.DataManager.GetPositionsFromJaco(CountPosition - 20, CountPosition - 1)[0];

//We do what need to be done with the list. //Here, we display the average power consumed by JACO.

System.Console.WriteLine("Average power consumed : " + Position.AveragePower); } } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.

Gets a real time CPosition from JACO.

Returns
THe real time CPosition instance.
try
{
CCypherMessage cypherPass;
//MyValidPassword is a string containing the password.
cypherPass = Crypto.GetInstance().Encrypt(MyValidPassword);
CJacoArm m_Jaco = new CJacoArm(cypherPass);
if (m_Jaco.JacoIsReady())
{
@verbatim
//We get a list of position and we take the first element.
CPosition Position = m_Jaco.DiagnosticManager.DataManager.GetPositionLogLiveFromJaco();
System.Console.WriteLine("Average power consumed : " + Position.AveragePower);
@endverbatim
}
}
catch (Exception ex)
{
System.Console.WriteLine("EXCEPTION");
}
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
float [] Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.GetSensorsInfo ( )

Gets information about Jaco's sensors.

try { CJacoArm m_Jaco = new CJacoArm(Crypto.GetInstance().Encrypt(MyValidPassword));

if (m_Jaco.JacoIsReady()) { //Declaration of the data structure that will hold information about the sensors. float[] info;

//We get the information from the robotic arm Jaco. info = m_Jaco.DiagnosticManager.DataManager.GetSensorsInfo();

System.Console.WriteLine(" Acceleration X : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACCELERATIONX]); System.Console.WriteLine(" Acceleration Y : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACCELERATIONY]); System.Console.WriteLine(" Acceleration Z : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACCELERATIONZ]); System.Console.WriteLine(" Actuator temp 1 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP1]); System.Console.WriteLine(" Actuator temp 2 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP2]); System.Console.WriteLine(" Actuator temp 3 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP3]); System.Console.WriteLine(" Actuator temp 4 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP4]); System.Console.WriteLine(" Actuator temp 5 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP5]); System.Console.WriteLine(" Actuator temp 6 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_ACTUATORTEMP6]); System.Console.WriteLine(" Current consumed : " + info[CJacoDiagnosticDataManager.SENSORSINFO_CURRENTCONSUMED]); System.Console.WriteLine(" Finger temp 1 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_FINGERTEMP1]); System.Console.WriteLine(" Finger temp 2 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_FINGERTEMP2]); System.Console.WriteLine(" Finger temp 3 : " + info[CJacoDiagnosticDataManager.SENSORSINFO_FINGERTEMP3]); System.Console.WriteLine(" Supply voltage : " + info[CJacoDiagnosticDataManager.SENSORSINFO_SUPPLYVOLTAGE]); } } catch (Exception ex) { System.Console.WriteLine("EXCEPTION"); }

Returns
A float array
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.
double Kinova.API.Jaco.Diagnostic.CJacoDiagnosticDataManager.RealSpeedTest ( )

Execute a speed test of the USB connection.

Returns
Time in seconds to transfer 224k bytes with Jaco.
Exceptions
CJACOOfflineExceptionJACO is offline (USB Connection)
CAccessDeniedExceptionYou must enter a valid password when you declare a CJacoArm object.
CJacoCommFailedExceptionCommunication has been broken and the system was not able to recover from the fault.
CPacketSynchroExceptionA USB packet has been skip during the communication.

The documentation for this class was generated from the following file: