Changes between Initial Version and Version 1 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/IO/SetDIOCounter


Ignore:
Timestamp:
12/27/11 11:02:20 (13 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825ev/IO/SetDIOCounter

    v1 v1  
     1= SetDIOCounter =
     2Setup a DIO counter.
     3
     4{{{
     5int SetDIOCounter(int dev, int input, DIOSetReg reg, int value, int wait);
     6}}}
     7
     8== Parameters ==
     9
     10 * dev - 0 = main board input, DIO option card number
     11 * input number - option card inputs limited to two counters, any of inputs 1 - 7, and input 8 may be used.
     12 * reg - register to set
     13 * value - value to set
     14 * wait - WAIT_ACK to wait for acknoledgement or NO_WAIT_ACK for no wait.
     15
     16== Return Value ==
     17
     18 * Returns the result - OK success
     19
     20== Remarks ==
     21
     22The main board or option card must already be opened by calling OpenMnBd first.
     23
     24== Examples ==
     25
     26
     27{{{
     28int bd = 1;
     29int inp = 8;
     30
     31SetDIOCounter(bd, inp, dioSetCount, 0, WAIT_ACK);
     32SetDIOCounter(bd, inp, dioSetPrescaler, 1, WAIT_ACK);
     33SetDIOCounter(bd, inp, dioSetCountUp, 0, WAIT_ACK);
     34SetDIOCounter(bd, inp, dioSetCountLowToHigh, 0, WAIT_ACK);
     35SetDIOCounter(bd, inp, dioEnableCounter, 0, WAIT_ACK);
     36
     37struct mnbd_multi_rep_counters_struct counters;
     38memset(&counters, 0, sizeof(counters));
     39
     40counters.cnt1_bd = bd;
     41counters.cnt1_input = inp;
     42
     43if(StartRepeatMulti(100, counters) == OK)
     44    DisplayText(0, 0, "Wt, I/O, cnt 10 times per second");
     45}}}
     46
     47== See Also ==
     48
     49 * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/StartRepeatMulti StartRepeatMulti]
     50 * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/IO/GetDIOCounter GetDIOCounter]