wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/IO/GetInputMask

Version 2 (modified by Don Wilson, 7 years ago) ( diff )

--

GetInputMask

Determine if any of one or more inputs for the main board or a DIO option card is on.

bool GetInputMask(int bd, uint32 mask);

Parameters

  • bd - 0 for main board or number of digital output card.
  • mask - input bit mask.

Return Value

  • Returns the result - true = any input specified by the mask is on, false = all inputs specified by the mask are off

Remarks

The main board or option card must already be opened by calling OpenMnBd first. This function returns the status of the memory buffer for the input. It is necessary to have communications code in place for this memory to be updated in an application. This can be done by using StartRepeatIO or StartRepeatMulti, at the beginning of the application or by calling MnBdRequest MNBD_GET_IO_STATUS prior to GetOutput.

Examples

// Inputs 1 - 2 = mask 1 + 2 = 3
if(GetInputMask(MNBD_DEV, 3) == true)
    DisplayText(0, 0, "Inputs 1 2 or both ON");
// inputs 2 - 3  =   mask 2 + 4 = 6
if(GetInputMask(1, 6) == false)
    DisplayText(0, 0, "Card 1 Inputs 2 and 3 are OFF");

See Also

Note: See TracWiki for help on using the wiki.