mpiSqNodeDigitalOutSet

Declaration

long mpiSqNodeDigitalOutSet(MPISqNode       node,
                            long            bitStart,
long bitCount, unsigned long state,
MPI_BOOL wait);

Required Header: stdmpi.h
Change History: Modified in the 03.03.00. Added in the 03.02.00.

Description

mpiSqNodeDigitalOutSet changes the state of multiple digital outputs on the specified SynqNet node.

node a handle to a SynqNet node object.
bitStart the first bit.
bitCount the number of bits to be changed.
state a pointer to where the current state of the output bits is written to by this function.
wait Boolean flag indicating if the new output state is applied immediately or if a wait is inserted so that any previous output set is transmitted over SynqNet and applied to the output before this function. You should be able to use TRUE for this argument in most applications.
Return Values
MPIMessageOK

Sample Code

The following MPI code will set the top 16 bits and clear the bottom 16 bits of Node 1:

long x = 0xFFFF0000;
mpiSqNodeDigitalOutSet( sqNode1, 0, 32, &x, TRUE );

The following MPI code will only set the fifth bit on a node 0 (the second bit of the segment 1):

mpiSqNodeDigitalOutSet( sqNode0, 5, 1, 1, TRUE );

The following MPI code with wait true will ensure that the physical pin will definitely generate a short pulse.

mpiSqNodeDigitalOutSet(sqNode1, 0, 1, 1, /*wait*/ 1);
mpiSqNodeDigitalOutSet(sqNode1, 0, 1, 0, /*wait*/ 1)

The following MPI code shows the use of not introducing a wait. This code is updating two bits on the same node. Both calls will immediately exit and since the timing of these two bits in this application are not related, this code can execute faster.

mpiSqNodeDigitalOutSet(sqNode1, 7, 1, 1, /*wait*/ 0);
mpiSqNodeDigitalOutSet(sqNode1, 8, 1, 1, /*wait*/ 0);

See Also

mpiSqNodeDigitalOutGet | Accessing Digital I/O | SQIO-DIN32DOUT32: Output Pinouts