차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
platform:ethercat:100_api:20_eg:version_compare [2019/08/14 18:06] 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; | + | |
- | } | + | |
- | | + | if (isVersionMatch) |
- | string ver_Fw = string.Format(" | + | { |
- | + | message = " | |
- | string comp_Fw_Drv = string.Empty; | + | return true; |
- | string comp_Fw_Lib = string.Empty; | + | } |
- | string comp_Drv_Lib = string.Empty; | + | |
+ | // Firmware Verion 확인 | ||
+ | string ver_Fw = string.Format(" | ||
+ | |||
+ | string comp_Fw_Drv = string.Empty; | ||
+ | string comp_Fw_Lib = string.Empty; | ||
+ | string comp_Drv_Lib = string.Empty; | ||
- | | + | //FW - SDK 호환성 결과 |
- | switch ((ec.EEcVerCompatResult)sdkInfo.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: comp_Fw_Lib = " | + | default: comp_Fw_Lib = " |
- | } | + | } |
- | | + | //FW-WDM 호환성 결과 |
- | switch ((ec.EEcVerCompatResult)driverInfo.nFwCompResult) | + | 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: comp_Fw_Drv = " | + | default: comp_Fw_Drv = " |
- | } | + | } |
- | | + | //SDK-WDM |
- | switch ((ec.EEcVerCompatResult)sdkInfo.nWdmCompResult) | + | switch ((ec.EEcVerCompatResult)sdkInfo.nWdmCompResult) |
- | { | + | { |
- | 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: comp_Drv_Lib = " | + | default: comp_Drv_Lib = " |
- | } | + | } |
- | | + | message = string.Format(" |
- | return false; | + | return false; |
- | } | + | } |
- | </code> | + | </sxh> |
</ | </ | ||
줄 74: | 줄 76: | ||
===C++=== | ===C++=== | ||
\\ | \\ | ||
- | <code> | + | <sxh cpp> |
bool IsVersionMatch() | bool IsVersionMatch() | ||
{ | { | ||
줄 84: | 줄 86: | ||
return ecNet_GetVerInfo(NETID, | return ecNet_GetVerInfo(NETID, | ||
} | } | ||
- | </code> | + | </sxh> |
</ | </ | ||