Download NI-FBUS Function Block Shell Reference Manual

Transcript
Chapter 8
Serial Functions
nihPutData
Purpose
Updates the data associated with a command that is part of a sequence.
Format
int16 nihPutData(nihDesc_t desc, uint8 *sendData, uint16 *stat)
Includes
#include "types.h"
#include "hart.h"
Parameters
IN desc
IN sendData
OUT stat
The descriptor of the repetitive command—returned
by nihSendCommand.
The address of the buffer containing the data to be sent
with the command.
The address of buffer to receive the communication
status.
Description
This function updates the data associated with a command that is part of a sequence. The
new command data sendData is sent to the device the next time the command identified
by desc is executed. The status of the last transmission of the command desc is returned
in stat.
For generic serial, the entire transmitted string is replaced by sendData when you call
nihPutData. sendData will then be used in all subsequent iterations of the specified
command until you call nihPutData.
For HART serial, the user data portion of the HART packet is replaced by sendData
when you call nihPutData. The rest of the packet remains the same (except the
checksum, which is recalculated for you automatically). The new packet will be used in
all subsequent iterations of the specified command until you call nihPutData again.
In both generic serial and HART serial, the number of bytes in the command that is to be
transmitted remains the same before and after the call to nihPutData.
Possible Errors
E_WRONG_ARGUMENT
NI-FBUS Function Block Shell Reference Manual
The descriptor is invalid.
8-10
© National Instruments Corporation