
Chapter 6
NI-FBUS Function Reference
NI-FBUS Hardware and Software User Manual
6-46
ni.com
Description
nifReadObject
reads the values of objects such as block parameters or communications
parameters from devices.
•
If
ud
is the descriptor of a link, then
name
must be in the format
BLOCKTAG.PARAM_NAME
.
•
If
ud
is a session descriptor, then all links are searched for the given
BLOCKTAG.PARAM_NAME
. The call fails if multiple identical
BLOCKTAG.PARAM_NAME
tags are located on the bus. Index access is not allowed for session descriptors.
•
If
ud
is the descriptor of a general function block application VFD, then name must be
in the format
BLOCKTAG.PARAM_NAME
.
•
If
ud
is the descriptor of a function block,
name
must be in the format
PARAM_NAME
.
•
If
ud
is the descriptor of a function block, and the
NIFB_INDEX
or
NIFB_INDEX_SUBINDEX
macro is used, the index specified is the relative index of the
parameter within the block. Relative indices start at 1 for the first parameter.
•
In all descriptor cases, you can expand
PARAM_NAME
itself to
STRUCT.ELEMENT
format
to represent a named element of a named structure.
In each case,
name
can represent either a variable or a variable list object. You should
determine the size of the object beforehand, possibly with a call to
nifGetObjectSize
.
If the object is larger than the buffer size specified in
length
, the NI-FBUS Communications
Manager returns an error, and none of the data in the buffer is valid.
Refer to Table 6-5 for an explanation of how to use macros to specify the parameter.
The data
nifReadObject
returns is in Fieldbus Foundation FMS Application format. You
must accomplish conversion of the data to the internal format of your processor and compiler.
Return Values
E_OK
The call was successful.
E_INVALID_DESCRIPTOR
The descriptor does not correspond to a VFD or function block.
This descriptor is no longer valid.
E_NOT_FOUND
The referred object does not exist.
E_OBJECT_ACCESS_DENIED
The NI-FBUS Communications Manager interface does not have
the required privileges. The access group you belong to is not
allowed to acknowledge the event, or the password you used is
wrong.
E_MULTIPLE
The NI-FBUS Communications Manager found more than
one identical tag. The function failed.
E_BUF_TOO_SMALL
The object is larger than your buffer.