| | 1 | = SetOutputMask = |
| | 2 | Set the output states of one or more digital outputs to ON or OFF for the main board or a DIO option card. |
| | 3 | |
| | 4 | {{{ |
| | 5 | int SetOutputMask(int bd, uint32 mask, uint32 output); |
| | 6 | }}} |
| | 7 | |
| | 8 | == Parameters == |
| | 9 | |
| | 10 | * bd - 0 for main board or number of digital output card |
| | 11 | * mask - bit mask to specify which outputs will be affected |
| | 12 | * output - bit mask to specify state of outputs |
| | 13 | |
| | 14 | == Return Value == |
| | 15 | |
| | 16 | * Returns the result - OK success |
| | 17 | |
| | 18 | == Remarks == |
| | 19 | |
| | 20 | The main board or option card must already be opened by calling OpenMnBd first. The call does a wait for acknowledgement. If the application is using main board communication events these events may be called during the wait for acknowledgement. |
| | 21 | |
| | 22 | == Examples == |
| | 23 | |
| | 24 | {{{ |
| | 25 | // Affect outputs 1 - 3 Mask = 1 + 2 + 4 = 7 |
| | 26 | if(SetOutputMask(MNBD_DEV, 7, 4) == OK) |
| | 27 | DisplayText(0, 0, "Out 3 set to ON 1 and 2 set to OFF"); |
| | 28 | }}} |
| | 29 | |
| | 30 | {{{ |
| | 31 | // Affect outputs 1 - 4 Mask = 1 + 2 + 4 + 8 = 15 decimal = 0x0F hexadecimal |
| | 32 | // Set 1 and 2 on = 1 + 2 = 3 |
| | 33 | if(SetOutputMask(MNBD_DEV, 0x0F, 3) == OK) |
| | 34 | DisplayText(0, 0, "1 and 2 ON - 3 and 4 OFF"); |
| | 35 | }}} |
| | 36 | |
| | 37 | |
| | 38 | == See Also == |
| | 39 | |
| | 40 | * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/IO/SetOutput SetOutput] |