Chapter 6
NI-FBUS Function Reference
NI-FBUS Hardware and Software User Manual
6-16
ni.com
nifOpenLink
Purpose
Returns a descriptor representing a Fieldbus link.
Format
nifError_t
nifOpenLink (
nifDesc_t session,
uint8 interfaceOrDevID,
char *name,
uint16 linkID,
nifDesc_t *out_ud)
Input
session
A valid session descriptor on which to open the link.
interfaceOrDevID
How to specify the link: zero if by interface name, one if by local
device ID.
name
The interface name or local device ID.
linkID
The link ID.
Output
out_ud
A descriptor for the link you request.
Context
Session.
Description
nifOpenLink
returns a descriptor for the link you specify. You must pass a valid session
descriptor to this function.
There are two ways you can specify the link. If the
interfaceOrDevID
parameter is zero,
then
name
specifies the name of the interface the link is connected to. The list of valid
interface names is contained in a configuration source which the NI-FBUS Communications
Manager has access to, and can be obtained by a call to
nifGetInterfaceList
.
If
interfaceOrDevID
is one, then the
name
specifies the device ID of an interface device
to which the NI-FBUS Communications Manager is attached.
In both cases,
linkID
is the Fieldbus link ID number for the specified link. For single-link
Fieldbus networks, you can set
linkID
to zero.