/** * @file DtFunc.h * @brief Data Transfer/Resource Data Converter Application Program Interface Functions * [データ転送/リソースデータ変換API関数] * @date 2008-06-25 * Copyright (C) 2008 MITSUBISHI Electric Corporation All Rights Reserved. */ #ifndef ___DT_FUNC_H___ #define ___DT_FUNC_H___ ///GOT drive [GOTドライブ] #define DTCOMM_GOT_DRIVE_NAME_A L"A" #define DTCOMM_GOT_DRIVE_NAME_B L"B" #define DTCOMM_GOT_DRIVE_NAME_C L"C" #define DTCOMM_GOT_DRIVE_NAME_D L"D" ///Select communication configuration type [通信設定typeの指定] #define DTCOMM_COMMCONFIG_TYPE_RS232 L"RS232" #define DTCOMM_COMMCONFIG_TYPE_USB L"USB" #define DTCOMM_COMMCONFIG_TYPE_ETHERNET L"ETHERNET" #define DTCOMM_COMMCONFIG_TYPE_MODEM L"MODEM" ///Select communication configuration baudrate [通信設定baudrateの指定] #define DTCOMM_COMMCONFIG_BAUDRATE_115200 L"115200" #define DTCOMM_COMMCONFIG_BAUDRATE_57600 L"57600" #define DTCOMM_COMMCONFIG_BAUDRATE_38400 L"38400" #define DTCOMM_COMMCONFIG_BAUDRATE_19200 L"19200" #define DTCOMM_COMMCONFIG_BAUDRATE_9600 L"9600" ///Select communication configuration databit [通信設定データビットの指定] #define DTCOMM_COMMCONFIG_DATABIT_8 L"8" ///Select communication configuration parity [通信設定パリティの指定] #define DTCOMM_COMMCONFIG_PARITY_ODD L"ODD" #define DTCOMM_COMMCONFIG_PARITY_EVEN L"EVEN" #define DTCOMM_COMMCONFIG_PARITY_NONE L"NONE" ///Select communication configuration stopbit [通信設定ストップビットの指定] #define DTCOMM_COMMCONFIG_STOPBIT_1 L"1" #define DTCOMM_COMMCONFIG_STOPBIT_2 L"2" ///Data transfer [データ転送.] ///No communication error [通信エラーなし] #define COMM_ERROR_N 0 ///Operation error code [動作エラーコード] enum EConsoleCommError{ DTCOMM_NOERROR = 0, DTCOMM_OPTION_ERROR, ///When an incorrect command/option is specified, when the specified value is incorrect ///[不正なコマンド・オプションが指定されたとき、指定値が不正なとき] DTCOMM_TRANS_FILE_ERROR, ///When the transfer file is incorrect [転送ファイルが不正なとき] DTCOMM_TRANS_FILE_ERROR_SYSLABEL,///<転送ファイルのシステムラベルが不正のとき DTCOMM_TRANS_INI_ERROR, ///When the transfer data INI file is incorrect ///(including a failure in input/output of INI file (read-only, etc.), when INI file to be read does not exist) ///[転送データINIファイルが不正なとき(INIファイルの入出力に失敗したとき(書込み禁止など) 読み込むINIファイルが存在しないときを含む)] DTCOMM_TRANS_INI_DATA_ERROR,///When transfer specification is incorrect, when data specification of transfer data INI file is incorrect ///[転送指定が不正なとき、転送データINIファイルのデータ指定が不正なとき] DTCOMM_NO_TRANS_DATA_ERROR, ///When transfer data is not specified (0 setting) [転送データが指定されていないとき(0個の指定)] DTCOMM_FILE_SAVE_ERROR, ///When file save fails (+ read-only) [ファイル保存に失敗したとき(+上書き禁止)] DTCOMM_COMM_INFO_ERROR, ///When an incorrect value is specified for communication setting ///when an incorrect value is specified for the communication setting GTD2AP1000.ini (occurs when the value is manually edited, etc. ) ///[通信設定指定で不正値が指定されたとき+通信設定GTD2AP1000.iniに不正値が指定されているとき(手動で編集したときなどに発生する)] DTCOMM_PROJECT_SECURITY_ERROR,///When an unauthorized user (other than Administrator) opens a project (GTD3 1.43V or later) and data transmission/utility password is not set ///[Administrator権限のユーザ以外でプロジェクト(GTD3 1.43V以降)を開きデータ転送/ユーティリティ起動パスワードが設定されていないとき] DTCOMM_COMM_CANCEL = 20, ///When an operation is canceled in a communication [通信で動作キャンセルされたとき] DTCOMM_COMM_OPEN_ERROR, ///When opening the communication port fails [通信ポートのオープンに失敗したとき] DTCOMM_COMM_ERROR, ///When an error occurs during communication [通信中にエラーが発生したとき] DTCOMM_COMM_NOTAUTHENTICATED,///Password authentication error [パスワード認証エラー] DTCOMM_COMM_NO_DRIVE, ///Drive specification error [ドライブ指定エラー] DTCOMM_COMM_ALREADY_EXISTS = 40,///Exclusive lock acquisition error [排他ロック取得エラー] DTCOMM_ERROR = 50 ///Other errors [その他のエラー] }; ///Resource data conversion [リソースデータ変換] ///Convert complete [変換成功] #define CONVERT_COMPLETE 0 #define CONVERT_WITH_DEVCMT_NOTCNV 1 ///The device comments are not reflected since they were not included in the conversion target. ///[デバイスコメントが変換対象になっていないため、デバイスコメントは反映されていない] ///Error code [エラーコード] #define ERROR_INCORRECTFILE -1 ///The file data is incorrect. [ファイルデータが不正] #define ERROR_NO_FILE -2 ///The file does not exist. [ファイルが存在しない] #define ERROR_NO_FILETYPE -3 ///Unsupported file type [対応するファイルタイプではない] #define ERROR_NO_LANGUAGETYPE -4 ///Unsupported language type [対応しない言語タイプ] #define ERROR_NO_FILE_G1P -5 ///The destination G1P file does not exist. [変換先のG1Pファイルが存在しない] #define ERROR_NO_FILE_OLCONVFILE -6 ///olConv.G1 or olConv.G1D required for a conversion of operation logs/advanced alarm does not exist. ///[操作ログ/拡張アラームの変換に必要なolConv.G1またはolConv.G1Dがない] #define ERROR_NO_RCDLL_FILE -7 ///zlib.dll/rc_conv.dll does not exist in the data transfer tool install folder. ///[データ転送ツールインストールフォルダにzlib.dll/rc_conv.dllが存在しない] #define ERROR_NO_PROJECT -8 ///The project data does not exist. Invalid (broken) project data is specified. ///[プロジェクトデータが存在しない。不正な(壊れている)プロジェクトデータを指定した。] #define ERROR_INCORRECT_PASSWORD -9 ///The project user name or password is wrong. Or the password is not specified. ///[プロジェクトのユーザ名、パスワードが違う。またはパスワードを指定していない。] #define ERROR_INCORRECT_PROJECT -10 ///The setting of advanced user alarm observation does not exist in the project data. ///The required comment group setting does not exist in the project data. ///The specified setting of comment column No. does not exist in the project data. ///[プロジェクトデータに拡張ユーザアラーム監視の設定が存在しない。] ///[プロジェクトデータに必要なコメントグループの設定が存在しない。] ///[プロジェクトデータに指定したコメント列No.の設定が存在しない。] #define ERROR_CANNOT_CREATE_LOG -11 ///The file after conversion cannot be written. Log file cannot be created. ///(When targeting files in the same path) ///[変換先のファイルを書込めない。ログファイルが作成できない。] ///[(同じパス内のファイルを対象にする指定時)] #define ERROR_CANNOT_USE_PROJECT -12 ///Required functions are not installed. ///[必要な機能がインストールされていない。] /** * @brief DT_Download() * @note Download the project file. [プロジェクトファイルをダウンロードする。] * Regard an empty text as being specified in NULL is specified for an argument. [引数にNULLを指定した場合、空の文字列が指定されたと見なす。] * @param project_filename project to be downloaded [ダウンロードするプロジェクト] * @param got_drive_name GOT drive [GOTドライブ] * @param del Specification to perform download after delete all [全削除後ダウンロードを行う指定] * @param notreboot Specification not to automatically restart after download [ダウンロード後自動で再起動しない指定] * @return Operation error code [動作エラーコード] */ long __stdcall DT_Download( const wchar_t* project_filename, const wchar_t* got_drive_name, long del, long notreboot ); /** * @brief DT_DownloadEx() * @note Download the project file. [プロジェクトファイルをダウンロードする。] * Regard an empty text as being specified in NULL is specified for an argument. [引数にNULLを指定した場合、空の文字列が指定されたと見なす。] * @param project_filename project to be downloaded [ダウンロードするプロジェクト] * @param got_drive_name GOT drive [GOTドライブ] * @param del Specification to perform download after delete all [全削除後ダウンロードを行う指定] * @param notreboot Specification not to automatically restart after download [ダウンロード後自動で再起動しない指定] * @param project_username User Name of Project [プロジェクトのユーザ名] * @param project_password Password of Project [プロジェクトのパスワード] * @return Operation error code [動作エラーコード] */ long __stdcall DT_DownloadEx( const wchar_t* project_filename, const wchar_t* got_drive_name, long del, long notreboot, const wchar_t* project_username = L"", const wchar_t* project_password = L"" ); /** * @brief DT_DownloadEx2() * @note Download the project file. [プロジェクトファイルをダウンロードする。] * Regard an empty text as being specified in NULL is specified for an argument. [引数にNULLを指定した場合、空の文字列が指定されたと見なす。] * @param project_filename project to be downloaded [ダウンロードするプロジェクト] * @param got_drive_name GOT drive [GOTドライブ] * @param del Specification to perform download after delete all [全削除後ダウンロードを行う指定] * @param notreboot Specification not to automatically restart after download [ダウンロード後自動で再起動しない指定] * @param project_username User Name of Project [プロジェクトのユーザ名] * @param project_password Password of Project [プロジェクトのパスワード] * @param password Password [パスワード] * @return Operation error code [動作エラーコード] */ long __stdcall DT_DownloadEx2( const wchar_t* project_filename, const wchar_t* got_drive_name, long del, long notreboot, const wchar_t* project_username = L"", const wchar_t* project_password = L"", const wchar_t* password = L"" ); /** * @brief DT_Upload() * @note Upload the project file. [プロジェクトファイルをアップロードする。] * Regard an empty text as being specified if NULL is specified for an argument. [引数にNULLを指定した場合、空の文字列が指定されたと見なす。] * Cause an error prior to transfer if more than 8 characters are used for a password. [パスワードが8文字より大きい場合、転送前にエラーとする。] * @param G1_filename Upload destination project [アップロード先のプロジェクト] * @param got_drive_name GOT drive [GOTドライブ] * @param password Password [パスワード] * @return Operation error code [動作エラーコード] */ long __stdcall DT_Upload( const wchar_t* G1_filename, const wchar_t* got_drive_name, const wchar_t* password ); /** * @brief DT_ResourceUp() * @note Upload the resource data. [リソースデータをアップロードする。] * Regard an empty text as being specified if NULL is specified for an argument. [引数にNULLを指定した場合、空の文字列が指定されたと見なす。] * @param up_folder Upload destination folder [アップロード先フォルダ] * @param filenames Upload file [アップロードファイル] * @param got_drive_name GOT drive [GOTドライブ] * @return Operation error code [動作エラーコード] */ long __stdcall DT_ResourceUp( const wchar_t* up_folder, const wchar_t* filenames, const wchar_t* got_drive_name ); /** * @brief DT_GetDriveInfo() * @note Acquire GOT drive information. [GOTのドライブ情報を取得する。] * @param INI_filename INI file to record GOT memory information [record destination) [GOTのメモリ情報を記録するINIファイル(記録先)] * @param got_drive_name GOT drive [GOTドライブ] * @return Operation error code [動作エラーコード] */ long __stdcall DT_GetDriveInfo( const wchar_t* INI_filename, const wchar_t* got_drive_name ); /** * @brief DT_CommConfig() * @note Change the communication setting. [通信設定を変更する。] * Setting in which an empty text, NULL being specified should not be changed. [空文字列、NULLが指定された設定は変更しない。] * Specification of IP address such as .01. is unacceptable. [IPアドレスは.01.のような指定は不可。] * Up to 5 digits can be specified for port No. [ポート番号は最大5桁までで指定。] * @param type Connection method (USB, ETHERNET, RS232, MODEM) [接続方法(USB, ETHERNET, RS232, MODEM)] * @param cport Communication port (COM1-COM63) [通信ポート(COM1〜COM63)] * @param baudrate Baudrate (115200, 57600, 38400, 19200, 9600) [ボーレート(115200, 57600, 38400, 19200, 9600)] * @param ip IP address [IPアドレス] * @param port IP port No. (1024-65534) (IPのポート番号(1024〜65534)] * @return Operation error code (動作エラーコード) */ long __stdcall DT_CommConfig( const wchar_t* type, const wchar_t* cport, const wchar_t* baudrate, const wchar_t* ip, const wchar_t* port ); /** * @brief DT_CommConfigEx() * @note Change the communication setting.(supported modem) [通信設定を変更する。(モデム対応版)] * Setting in which an empty text, NULL being specified should not be changed. [空文字列、NULLが指定された設定は変更しない。] * Specification of IP address such as .01. is unacceptable. [IPアドレスは.01.のような指定は不可。] * Up to 5 digits can be specified for port No. [ポート番号は最大5桁までで指定。] * @param type Connection method (USB, ETHERNET, RS232, MODEM) [接続方法(USB, ETHERNET, RS232, MODEM)] * @param cport Communication port (COM1-COM63) [通信ポート(COM1〜COM63)] * @param baudrate Baudrate (115200, 57600, 38400, 19200, 9600) [ボーレート(115200, 57600, 38400, 19200, 9600)] * @param ip IP address [IPアドレス] * @param port IP port No. (1024-65534) (IPのポート番号(1024〜65534)] * @param mport Communication port of modem(COM1〜COM63) [モデムの通信ポート(COM1〜COM63)] * @param mbaudrate Baudrate of modem(115200, 57600, 38400, 19200, 9600) [モデムの転送速度(115200, 57600, 38400, 19200, 9600)] * @param mdatabit Data Bit (8) [データ長 (8)] * @param parity Parity (ODD, EVEN, NONE) [パリティ (ODD, EVEN, NONE)] * @param stopbit Stop Bit (1, 2) [ストップビット(1, 2)] * @param timeout Timeout (1-90) [タイムアウト(1〜90)] * @return Operation error code (動作エラーコード) */ long __stdcall DT_CommConfigEx( const wchar_t* type, const wchar_t* cport, const wchar_t* baudrate, const wchar_t* ip, const wchar_t* port, const wchar_t* mport, const wchar_t* mbaudrate, const wchar_t* mdatabit, const wchar_t* parity, const wchar_t* stopbit, const wchar_t* timeout ); /** * @brief DT_CommTest() * @note Execute a communication test. [通信テストを実行する。] * @param none * @return Operation error code [動作エラーコード] */ long __stdcall DT_CommTest(); /** * @brief DT_GetLastCommError() * @note Acquire the code of a communication error that occurs in the communication executed at the last. [最後に実行した通信で発生した通信エラーのコードを取得する。] * Initialize communication errors with 0 at the time of every communication execution. [通信エラーは、通信実行時毎に0で初期化される。] * Hence, return 0 if no error occurs in the previous communication. [そのため、前回の通信でエラーが発生しなかった場合は0を返す。] * (Set an error code in the case of a communication test as well.) [通信テストの場合もエラーコードは設定される。] * @param none * @return Communication error code [通信エラーコード] */ long __stdcall DT_GetLastCommError(); /** * @brief DT_INI_Download() * @note Download the project. [プロジェクトをダウンロードする。] * @param INI_filename INI file to specify transfer data [転送データを指定するINIファイル] * @return Operation error code [動作エラーコード] */ long __stdcall DT_INI_Download( const wchar_t* INI_filename ); /** * @brief DT_INI_Download() * @note Upload the project. [プロジェクトをアップロードする。] * @param INI_filename INI file to specify transfer data [転送データを指定するINIファイル] * @return Operation error code [動作エラーコード] */ long __stdcall DT_INI_Upload( const wchar_t* INI_filename ); /** * @brief DT_INI_ResourceUp() * @note Upload the resource data. [リソースデータをアップロードする。] * @param INI_filename INI file to specify transfer data [転送データを指定するINIファイル] * @return Operation error code [動作エラーコード] */ long __stdcall DT_INI_ResourceUp( const wchar_t* INI_filename ); /** * @brief ConvertFile_ARecipe() * @note Advanced Recipe Convert Function [拡張レシピ変換関数] * @param p_OriginalConversionFile, ///Original conversion file (Absolute Path + File Name) [変換元のファイル名(絶対パス+ファイル名)] * @param p_AfterFileType ///Destination file type [変換先のファイル種類] * @return * CONVERT_COMPLETE 0 ///Convert complete [変換成功] * ERROR_INCORRECTFILE -1 ///The file data is incorrect. [ファイルデータが不正] * ERROR_NO_FILE -2 ///The file does not exist. [ファイルが存在しない] * ERROR_NO_FILETYPE -3 ///Unsupported file type [対応するファイルタイプではない] * ERROR_NO_FILE_G1P -5 ///The destination G1P file does not exist. [変換先のG1Pファイルが存在しない] * ERROR_NO_RCDLL_FILE -7 ///zlib.dll/rc_conv.dll does not exist in the data transfer tool install folder. * ///[データ転送ツールインストールフォルダにzlib.dll/rc_conv.dllが存在しない] */ int __stdcall ConvertFile_ARecipe( wchar_t* p_OriginalConversionFile, wchar_t* p_AfterFileType ); /** * @brief ConvertFile_OPELOG() * @note Operation Log Conversion Function [操作ログ変換関数] * @param p_OriginalConversionFile, ///Original conversion file (Absolute Path + File Name) [変換元のファイル名(絶対パス+ファイル名)] * @param p_AfterFileType, ///Destination file type [変換先のファイル種類] * @param p_LanguageTypeAfterConvert ///Destination language type [変換先の言語タイプ] * @return * CONVERT_COMPLETE 0 ///Convert complete [変換成功] * ERROR_INCORRECTFILE -1 ///The file data is incorrect. [ファイルデータが不正] * ERROR_NO_FILE -2 ///The file does not exist. [ファイルが存在しない] * ERROR_NO_FILETYPE -3 ///Unsupported file type [対応するファイルタイプではない] * ERROR_NO_LANGUAGETYPE -4 ///Unsupported language type [対応しない言語タイプ] * ERROR_NO_FILE_OLCONVFILE -6 ///olConv.G1 or olConv.G1D required for a conversion of operation logs/advanced alarm does not exist. * ///[操作ログ/拡張アラームの変換に必要なolConv.G1またはolConv.G1Dがない] * ERROR_NO_RCDLL_FILE -7 ///zlib.dll/rc_conv.dll does not exist in the data transfer tool install folder. * ///[データ転送ツールインストールフォルダにzlib.dll/rc_conv.dllが存在しない] */ int __stdcall ConvertFile_OPELOG( wchar_t* p_OriginalConversionFile, wchar_t* p_AfterFileType, wchar_t* p_LanguageTypeAfterConvert ); /** * @brief ConvertFile_LOGGING() * @note Logging conversion function [ロギング変換関数] * @param p_OriginalConversionFile, ///Original conversion file (Absolute Path + File Name) [変換元のファイル名(絶対パス+ファイル名)] * @param p_AfterFileType ///Destination file type [変換先のファイル種類] * @return * CONVERT_COMPLETE 0 ///Convert complete [変換成功] * ERROR_INCORRECTFILE -1 ///The file data is incorrect. [ファイルデータが不正] * ERROR_NO_FILE -2 ///The file does not exist. [ファイルが存在しない] * ERROR_NO_FILETYPE -3 ///Unsupported file type [対応するファイルタイプではない] * ERROR_NO_RCDLL_FILE -7 ///zlib.dll/rc_conv.dll does not exist in the data transfer tool install folder. * ///[データ転送ツールインストールフォルダにzlib.dll/rc_conv.dllが存在しない] */ int __stdcall ConvertFile_LOGGING( wchar_t* p_OriginalConversionFile, wchar_t* p_AfterFileType ); /** * @brief ConvertFile_AAlarm() * @note Advanced alarm conversion function [拡張アラーム変換関数] * @param p_OriginalConversionFile, ///Original conversion file (Absolute Path + File Name) [変換元のファイル名(絶対パス+ファイル名)] * @param p_ProjectFile, ///Project file (absolute path) to be used for conversion [変換に使用するプロジェクトファイル(絶対パス)] * @param p_AfterFileType, ///Destination file type [変換先のファイル種類] * @param p_LanguageTypeAfterConvert, ///Destination language type [変換先の言語タイプ] * @param p_GenerationLocation, ///Log file generation location [ログファイルの作成環境] * @param p_ColumnNoAferConvert, ///Comment column No. (1-10) (Advanced User Alarm) [拡張ユーザアラーム時のコメント列No.(1-10)] * @param p_TargetInSamePath, ///Target files in the same path (0, 1) [同じパス内のファイルを対象にするか(0,1)] * @param p_ProjectUser, ///Project user name [プロジェクトのユーザ名] * @param p_ProjectPassword ///Project password [プロジェクトのパスワード] * @return * CONVERT_COMPLETE 0 ///Convert complete [変換成功] * ERROR_INCORRECTFILE -1 ///The file data is incorrect. [ファイルデータが不正] * ERROR_NO_FILE -2 ///The file does not exist. [ファイルが存在しない] * ERROR_NO_FILETYPE -3 ///Unsupported file type [対応するファイルタイプではない] * ERROR_NO_LANGUAGETYPE -4 ///Unsupported language type [対応しない言語タイプ] * ERROR_NO_FILE_OLCONVFILE -6 ///olConv.G1 or olConv.G1D required for a conversion of operation logs/advanced alarm does not exist. * ///[操作ログ/拡張アラームの変換に必要なolConv.G1またはolConv.G1Dがない] * ERROR_NO_RCDLL_FILE -7 ///zlib.dll/rc_conv.dll does not exist in the data transfer tool install folder. * ///[データ転送ツールインストールフォルダにzlib.dll/rc_conv.dllが存在しない] * ERROR_NO_PROJECT -8 ///The project data does not exist. Invalid (broken) project data is specified. * ///[プロジェクトデータが存在しない。不正な(壊れている)プロジェクトデータを指定した。] * ERROR_INCORRECT_PASSWORD -9 ///The project user name or password is wrong. Or the password is not specified. * ///[プロジェクトのユーザ名、パスワードが違う。またはパスワードを指定していない。] * ERROR_INCORRECT_PROJECT -10 ///The setting of advanced user alarm observation does not exist in the project data. * ///The required comment group setting does not exist in the project data. * ///The specified setting of comment column No. does not exist in the project data. * ///[プロジェクトデータに拡張ユーザアラーム監視の設定が存在しない。] * ///[プロジェクトデータに必要なコメントグループの設定が存在しない。] * ///[プロジェクトデータに指定したコメント列No.の設定が存在しない。] * ERROR_CANNOT_CREATE_LOG -11 ///The file after conversion cannot be written. Log file cannot be created. * ///(When targeting files in the same path) * ///[変換先のファイルを書込めない。ログファイルが作成できない。] * ///[(同じパス内のファイルを対象にする指定時)] * ERROR_CANNOT_USE_PROJECT -12 ///Required functions are not installed. * ///[必要な機能がインストールされていない。] * * */ int __stdcall ConvertFile_AAlarm( wchar_t* p_OriginalConversionFile, wchar_t* p_ProjectFile, wchar_t* p_AfterFileType, wchar_t* p_LanguageTypeAfterConvert, wchar_t* p_GenerationLocation, char p_ColumnNoAferConvert, char p_TargetInSamePath, wchar_t* p_ProjectUser, wchar_t* p_ProjectPassword ); #endif //___DT_FUNC_H___