15. Altre Interfacce
15.1. Ottenere Chiave Pubblica SSH
1/**
2* @brief Ottenere Chiave Pubblica SSH
3* @param [out] keygen Chiave pubblica
4* @return Codice errore
5*/
6int GetSSHKeygen(ref string keygen);
15.2. Inviare Comando SCP
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1/**
2* @brief Inviare Comando SCP
3* @param [in] mode 0-Caricamento (PC supervisore -> controller), 1-Scaricamento (controller -> PC supervisore)
4* @param [in] sshname Nome utente PC supervisore
5* @param [in] sship Indirizzo IP PC supervisore
6* @param [in] usr_file_url Percorso file PC supervisore
7* @param [in] robot_file_url Percorso file controller robot
8* @return Codice errore
9*/
10int SetSSHScpCmd(int mode, string sshname, string sship, string usr_file_url, string robot_file_url);
15.3. Calcolare Valore MD5 File Percorso Specificato
1/**
2* @brief Calcolare Valore MD5 File Percorso Specificato
3* @param [in] file_path Percorso file incluso nome file, percorso cartella Traj predefinito:"/fruser/traj/", es. "/fruser/traj/trajHelix_aima_1.txt"
4* @param [out] md5 Valore MD5 file
5* @return Codice errore
6*/
7int ComputeFileMD5(string file_path, ref string md5);
15.4. Esempio Codice Istruzioni SSH, MD5 Robot
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1private void button46_Click(object sender, EventArgs e)
2{
3 string file_path = "/fruser/airlab.lua";
4 string md5 = "";
5 byte emerg_state = 0;
6 byte si0_state = 0;
7 byte si1_state = 0;
8 int sdk_com_state = 0;
9
10 string ssh_keygen = "";
11 int retval = robot.GetSSHKeygen(ref ssh_keygen);
12 Console.WriteLine("GetSSHKeygen retval is: {0}", retval);
13 Console.WriteLine("ssh key is: {0}", ssh_keygen);
14
15 string ssh_name = "fr";
16 string ssh_ip = "192.168.58.45";
17 string ssh_route = "/home/fr";
18 string ssh_robot_url = "/root/robot/dhpara.config";
19 retval = robot.SetSSHScpCmd(1, ssh_name, ssh_ip, ssh_route, ssh_robot_url);
20 Console.WriteLine("SetSSHScpCmd retval is: {0}", retval);
21 Console.WriteLine("robot url is: {0}", ssh_robot_url);
22
23 robot.ComputeFileMD5(file_path, ref md5);
24 Console.WriteLine("md5 is: {0}", md5);
25}
15.5. Impostare Periodo Feedback Porta 20004 Robot
1/**
2* @brief Impostare Periodo Feedback Porta 20004 Robot
3* @param [in] period Periodo feedback porta 20004 robot(ms)
4* @return Codice errore
5*/
6int SetRobotRealtimeStateSamplePeriod(int period);
15.6. Ottenere Periodo Feedback Porta 20004 Robot
1/**
2* @brief Ottenere Periodo Feedback Porta 20004 Robot
3* @param [out] period Periodo feedback porta 20004 robot(ms)
4* @return Codice errore
5*/
6int GetRobotRealtimeStateSamplePeriod(ref int period);
15.7. Esempio Codice Configurazione Periodo Feedback Stato Porta 20004 Robot
1private void button47_Click(object sender, EventArgs e)
2{
3 robot.SetRobotRealtimeStateSamplePeriod(10);
4 int getPeriod = 0;
5 robot.GetRobotRealtimeStateSamplePeriod(ref getPeriod);
6 Console.WriteLine("period is {0}", getPeriod);
7 Thread.Sleep(1000);
8}
15.8. Aggiornamento Software Robot
1/**
2* @brief Aggiornamento Software Robot
3* @param [in] filePath Percorso completo pacchetto aggiornamento software
4* @param [in] block Se bloccare fino al completamento aggiornamento true:bloccante; false:non bloccante
5* @return Codice errore
6*/
7int SoftwareUpgrade(string filePath, bool block);
15.9. Ottenere Stato Aggiornamento Software Robot
1/**
2* @brief Ottenere Stato Aggiornamento Software Robot
3* @param [out] state Stato aggiornamento pacchetto software robot 0-inattivo o caricamento pacchetto aggiornamento in corso; 1~100: percentuale completamento aggiornamento; -1:fallimento aggiornamento software; -2: fallimento verifica; -3: fallimento verifica versione; -4: fallimento estrazione; -5: fallimento aggiornamento configurazione utente; -6: fallimento aggiornamento configurazione periferiche; -7: fallimento aggiornamento configurazione assi estesi; -8: fallimento aggiornamento configurazione robot; -9: fallimento aggiornamento parametri DH
4* @return Codice errore
5*/
6int GetSoftwareUpgradeState(ref int state);
15.10. Esempio Codice Aggiornamento Software Robot
1private void button48_Click(object sender, EventArgs e)
2{
3 robot.SoftwareUpgrade("D://zUP/QNX382/software.tar.gz", false);
4 while (true)
5 {
6 int curState = -1;
7 robot.GetSoftwareUpgradeState(ref curState);
8 Console.WriteLine("upgrade state is {0}", curState);
9 Thread.Sleep(300);
10 }
11}
15.11. Scaricamento Tabella Punti
1/**
2* @brief Scaricamento Tabella Punti da Controller Robot a Computer Locale
3* @param [in] pointTableName Nome tabella punti nel controller: pointTable1.db
4* @param [in] saveFilePath Percorso scaricamento tabella punti sul computer C://test/
5* @return Codice errore
6*/
7int PointTableDownLoad(string pointTableName, string saveFilePath);
15.12. Caricamento Tabella Punti
1/**
2* @brief Caricamento Tabella Punti da Computer Locale a Controller Robot
3* @param [in] pointTableFilePath Percorso assoluto tabella punti su computer locale C://test/pointTabl e1.db
4* @return Codice errore
5*/
6int PointTableUpLoad(string pointTableFilePath);
15.13. Aggiornamento Programma Lua con Tabella Punti
1/**
2* @brief Aggiornamento punti nel programma Lua usando la tabella punti fornita
3* @param [in] pointTableName Nome tabella punti nel controller: "pointTable1.db", quando tabella punti vuota, cioè "", indica aggiornamento programma Lua al programma iniziale senza tabella punti applicata
4* @param [in] luaFileName Nome file Lua da aggiornare "test.lua"
5* @param [out] errorStr Informazioni errore aggiornamento Lua tabella punti
6* @return Codice errore
7*/
8int PointTableUpdateLua(string pointTableName, string luaFileName, ref string errorStr);
15.14. Cambio Tabella Punti e Applicazione
1/**
2* @brief Cambio Tabella Punti e Applicazione
3* @param [in] pointTableName Nome tabella punti da cambiare "pointTable1.db"
4* @param [out] errorStr Informazioni errore cambio tabella punti
5* @return Codice errore
6*/
7int PointTableSwitch(string pointTableName, ref string errorStr);
15.15. Esempio Codice Operazioni Tabella Punti Robot
1private void btnUpload_Click(object sender, EventArgs e)
2{
3 string save_path = "D://zDOWN/";
4 string point_table_name = "test_point_A.db";
5 int rtn = robot.PointTableDownLoad(point_table_name, save_path);
6 Console.WriteLine("download : {0} fail: {1}", point_table_name, rtn);
7
8 string upload_path = "D://zUP/test_point_A.db";
9 rtn = robot.PointTableUpLoad(upload_path);
10 Console.WriteLine("retval is: {0}", rtn);
11
12 string point_tablename = "test_point_A.db";
13 string lua_name = "Text1.lua";
14
15 string errorStr = "";
16 rtn = robot.PointTableUpdateLua(point_tablename, lua_name, ref errorStr);
17 Console.WriteLine("retval is: {0}", rtn);
18}
15.16. Scaricamento Log Controller
1/**
2* @brief Scaricamento Log Controller
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice errore
5*/
6int RbLogDownload(string savePath);
15.17. Scaricamento Tutte Sorgenti Dati
1/**
2* @brief Scaricamento Tutte Sorgenti Dati
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice errore
5*/
6int AllDataSourceDownload(string savePath);
15.18. Scaricamento Pacchetto Backup Dati
1/**
2* @brief Scaricamento Pacchetto Backup Dati
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice errore
5*/
6int DataPackageDownload(string savePath);
15.19. Esempio Codice Scaricamento Dati Controller
1private void button50_Click(object sender, EventArgs e)
2{
3 int rtn = robot.RbLogDownload("D://zDOWN/");
4 Console.WriteLine("RbLogDownload rtn is {0}", rtn);
5
6 rtn = robot.AllDataSourceDownload("D://zDOWN/");
7 Console.WriteLine("AllDataSourceDownload rtn is {0}", rtn);
8
9 rtn = robot.DataPackageDownload("D://zDOWN/");
10 Console.WriteLine("DataPackageDownload rtn is {0}", rtn);
11}
15.20. Aggiornamento Sistema Operativo Robot (Quadro Controllo LA)
Nuovo nella versione C#SDK-V1.1.8: Web-3.8.6
1/**
2 * @brief Aggiornamento Sistema Operativo Robot (Quadro Controllo LA)
3 * @param [in] filePath Percorso completo pacchetto aggiornamento sistema operativo
4 * @return Codice errore
5 */
6public int KernelUpgrade(string filePath)
15.21. Ottenere Risultato Aggiornamento Sistema Operativo Robot (Quadro Controllo LA)
Nuovo nella versione C#SDK-V1.1.8: Web-3.8.6
1/**
2 * @brief Ottenere Risultato Aggiornamento Sistema Operativo Robot (Quadro Controllo LA)
3 * @param [out] result Risultato aggiornamento: 0:successo; -1:fallimento
4 * @return Codice errore
5 */
6public int GetKernelUpgradeResult(ref int[] result)
15.22. Impostare Aggiornamento Encoder
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Impostare Aggiornamento Encoder
3* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
4* @return Codice errore
5*/
6int SetEncoderUpgrade(string path);
15.23. Impostare Aggiornamento Firmware Giunto
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Impostare Aggiornamento Firmware Giunto
3* @param [in] type Tipo file aggiornamento; 1-aggiornamento firmware; 2-aggiornamento file configurazione slave
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice errore
6*/
7int SetJointFirmwareUpgrade(int type, string path);
15.24. Impostare Aggiornamento Firmware Quadro Controllo
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Impostare Aggiornamento Firmware Quadro Controllo
3* @param [in] type Tipo file aggiornamento; 1-aggiornamento firmware; 2-aggiornamento file configurazione slave
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice errore
6*/
7int SetCtrlFirmwareUpgrade(int type, string path);
15.25. Impostare Aggiornamento Firmware Estremità
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Impostare Aggiornamento Firmware Estremità
3* @param [in] type Tipo file aggiornamento; 1-aggiornamento firmware; 2-aggiornamento file configurazione slave
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice errore
6*/
7int SetEndFirmwareUpgrade(int type, string path);
15.26. Aggiornamento File Configurazione Parametri Completi Giunto
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Aggiornamento File Configurazione Parametri Completi Giunto
3* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
4* @return Codice errore
5*/
6int JointAllParamUpgrade(string path);
15.27. Esempio Codice Aggiornamento Firmware Slave Robot
Nuovo nella versione C#SDK-V1.1.5: Web-3.8.4
1private void button83_Click(object sender, EventArgs e)
2{
3 robot.RobotEnable(0);
4 Thread.Sleep(200);
5 int rtn = robot.JointAllParamUpgrade("D://zUP/upgrade/jointallparameters.db");
6 Console.WriteLine($"robot JointAllParamUpgrade rtn is{rtn}");
7 rtn = robot.SetCtrlFirmwareUpgrade(2, "D://zUP/upgrade/FAIR_Cobot_Cbd_Asix_V2.0.bin");
8 Console.WriteLine($"robot SetCtrlFirmwareUpgrade rtn is{rtn}");
9 rtn = robot.SetEndFirmwareUpgrade(2, "D://zUP/upgrade/FAIR_Cobot_Axle_Asix_V2.4.bin");
10 Console.WriteLine($"robot SetEndFirmwareUpgrade rtn is {rtn}");
11 robot.SetSysServoBootMode();
12 rtn = robot.SetCtrlFirmwareUpgrade(1, "D://zUP/upgrade/FR_CTRL_PRIMCU_FV201212_MAIN_U4_T01_20250428(MT).bin");
13 Console.WriteLine($"robot SetCtrlFirmwareUpgrade rtn is{rtn}");
14 rtn = robot.SetEndFirmwareUpgrade(1, "D://zUP/upgrade/FR_END_FV201009_MAIN_U1_T01_20250428.bin");
15 Console.WriteLine($"robot SetEndFirmwareUpgrade rtn is {rtn}");
16 rtn = robot.SetJointFirmwareUpgrade(1, "D://zUP/upgrade/FR_SERVO_FV504214_MAIN_U7_T07_20250519.bin");
17 Console.WriteLine($"robot SetJointFirmwareUpgrade rtn is{rtn}");
18}
15.28. Generazione Log MCU Robot
Nuovo nella versione C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Generazione Log MCU Robot
3* @return Codice errore
4*/
5public int RobotMCULogCollect();