차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
platform:ethercat:100_api:20_eg:version_compare [2019/08/14 14:33] winoars 만듦 |
platform:ethercat:100_api:20_eg:version_compare [2024/07/08 18:23] (현재) |
||
---|---|---|---|
줄 9: | 줄 9: | ||
- | =====C#===== | + | ====Code==== |
<callout type=" | <callout type=" | ||
===C#=== | ===C#=== | ||
- | <code> | + | <sxh csharp> |
+ | using ec = ComiLib.EtherCAT.SafeNativeMethods; | ||
bool IsVersionMatch(ref string message) | bool IsVersionMatch(ref string message) | ||
- | | + | { |
- | | + | ec.TEcFileVerInfo_SDK sdkInfo = new ec.TEcFileVerInfo_SDK(); |
- | | + | ec.TEcFileVerInfo_WDM driverInfo = new ec.TEcFileVerInfo_WDM(); |
- | | + | ec.TEcFileVerInfo_FW fwInfo = new ec.TEcFileVerInfo_FW(); |
- | + | ||
- | bool isVersionMatch = ec.ecNet_GetVerInfo(0, | + | |
- | if (isVersionMatch) | + | bool isVersionMatch = ec.ecNet_GetVerInfo(0, ref sdkInfo, ref driverInfo, ref fwInfo, ref errorCode); |
- | { | + | |
- | message = " | + | |
- | return true; | + | |
- | } | + | |
- | // Firmware Verion 확인 | + | if (isVersionMatch) |
- | string ver_Fw = string.Format(" | + | { |
- | + | message | |
- | | + | return true; |
- | | + | } |
- | | + | |
- | | + | // Firmware Verion 확인 |
- | | + | string ver_Fw = string.Format("{0}.{1}.{2}.{3}", fwInfo.CurVer.MajorVer, |
- | | + | |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: | + | string comp_Fw_Drv = string.Empty; |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: | + | string |
- | case ec.EEcVerCompatResult.ecVER_MATCH: | + | string comp_Drv_Lib |
- | | + | |
- | } | + | |
- | | + | //FW - SDK 호환성 결과 |
- | switch ((ec.EEcVerCompatResult)driverInfo.nFwCompResult) | + | switch ((ec.EEcVerCompatResult)sdkInfo.nFwCompResult) |
- | { | + | { |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: | + | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: | + | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: |
- | case ec.EEcVerCompatResult.ecVER_MATCH: | + | case ec.EEcVerCompatResult.ecVER_MATCH: |
- | default: | + | default: |
- | } | + | } |
- | | + | //FW-WDM 호환성 결과 |
- | switch ((ec.EEcVerCompatResult)sdkInfo.nWdmCompResult) | + | switch ((ec.EEcVerCompatResult)driverInfo.nFwCompResult) |
- | { | + | { |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: | + | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: |
- | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: | + | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: |
- | case ec.EEcVerCompatResult.ecVER_MATCH: | + | case ec.EEcVerCompatResult.ecVER_MATCH: |
- | default: | + | default: |
- | } | + | } |
- | + | ||
- | message = string.Format(" | + | |
- | return false; | + | |
- | } | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | <callout type=" | + | |
+ | //SDK-WDM | ||
+ | switch ((ec.EEcVerCompatResult)sdkInfo.nWdmCompResult) | ||
+ | { | ||
+ | case ec.EEcVerCompatResult.ecVER_MISMATCH_LOWER: | ||
+ | case ec.EEcVerCompatResult.ecVER_MISMATCH_HIGHER: | ||
+ | case ec.EEcVerCompatResult.ecVER_MATCH: | ||
+ | default: comp_Drv_Lib = " | ||
+ | } | ||
+ | message = string.Format(" | ||
+ | return false; | ||
+ | } | ||
+ | </ | ||
</ | </ | ||
줄 79: | 줄 73: | ||
- | <callout type="success" | + | <callout type="info" |
+ | ===C++=== | ||
+ | \\ | ||
+ | <sxh cpp> | ||
+ | bool IsVersionMatch() | ||
+ | { | ||
+ | TEcFileVerInfo_SDK SdkVerInfo; | ||
+ | TEcFileVerInfo_WDM WdmVerInfo; | ||
+ | TEcFileVerInfo_FW FwVerInfo; | ||
+ | int nErrCode; | ||
+ | |||
+ | return ecNet_GetVerInfo(NETID, | ||
+ | } | ||
+ | </ | ||
</ | </ | ||
- | |||
- | |||
- | |||
- | |||
- | <button collapse=" | ||
- | < | ||
- | < | ||
- | {{page> | ||
- | </ | ||