This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cfnet:cfheader:csharp:index [2026/05/29 05:52] – mfranklin | cfnet:cfheader:csharp:index [2026/05/29 06:06] (current) – [Simple Digital Output Example] mfranklin | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| After [[cfnet: | After [[cfnet: | ||
| - | Debug the entire solution on the Windows development machine before deploying to an ARM Linux or other target device. | ||
| ===== Simple Digital Output Example ===== | ===== Simple Digital Output Example ===== | ||
| <code csharp> | <code csharp> | ||
| + | using ComfileTech.Cfnet.Cfheader; | ||
| + | |||
| var cfheader0 = Cfheader.Instances[0]; | var cfheader0 = Cfheader.Instances[0]; | ||
| - | var digitalOutputModule0 | + | var DOModule0 |
| cfheader0.Open(); | cfheader0.Open(); | ||
| Line 15: | Line 16: | ||
| while (true) | while (true) | ||
| { | { | ||
| - | | + | foreach (var channel in DOModule0.Channels.Concat(DOModule0.Channels.Reverse())) |
| - | | + | |
| { | { | ||
| - | | + | foreach (var state in new[] { true, false }) |
| - | Thread.Sleep(50); | + | { |
| - | channel.State = !channel.State; | + | channel.State = state; |
| - | Thread.Sleep(50); | + | |
| - | } | + | Thread.Sleep(50); |
| - | + | } | |
| - | // Blink each output in decreasing order | + | |
| - | | + | |
| - | { | + | |
| - | channel.State = !channel.State; | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| } | } | ||
| } | } | ||
| Line 36: | Line 29: | ||
| {{ : | {{ : | ||
| + | |||
| + | Debug the entire solution on the Windows development machine before deploying to an ARM Linux or other target device. | ||
| ===== Contents ===== | ===== Contents ===== | ||