차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

cfnet:cfheaderprogramming:code_2 [2026/02/14 03:21] – created admincfnet:cfheaderprogramming:code_2 [알 수 없는 날짜] (현재) – 제거됨 - 바깥 편집 (알 수 없는 날짜) 127.0.0.1
줄 1: 줄 1:
-<code csharp> 
-// Get the CFHEADER module at address 0 
-var cfheader0 = Cfheader.Instances[0]; 
-  
-// Open USB communcation with the CFHEADER module 
-cfheader0.Open(); 
-  
-// Get all possible IO module instances 
-var allIOModules = ((IEnumerable<IIOModule>)cfheader0.AnalogInputModules) 
-    .Concat(cfheader0.AnalogOutputModules) 
-    .Concat(cfheader0.DigitalInputModules) 
-    .Concat(cfheader0.DigitalOutputModules); 
-  
-// Reset the IO module's I²C status so I²C communication will be attempted again on the next call to `Sync`. 
-foreach(var ioModule in allIOModules) 
-{ 
-    ioModule.AcknowledgeI2cFailure(); 
-} 
-  
-// Test i2c communication for each IO module 
-cfheader0.Sync(); 
-  
-// Identify each IO module whose I²C communication succeeded. 
-foreach(var ioModule in allIOModules) 
-{ 
-    if (ioModule.I2cStatus == I2cResult.Success) 
-    { 
-        Console.WriteLine($"Found {ioModule.GetType().Name} at address {ioModule.Address}"); 
-    } 
-} 
-  
-// Close USB communication with the CFHEADER module 
-cfheader0.Close(); 
-</code>