FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

Read function block parameter with its object dictionary index in VC?

How do I read  a function block parameter with its object dictionary index using NI-Fbus Communications Manager Programmer VC API?
0 Kudos
Message 1 of 3
(7,097 Views)
You can use  marco NIFB_INDEX(index) as parameter for nif_ReadObject function. The index is the relative index of the parameter in the block.
nifError_t nifReadObject(nifDesc_t ud, NIFB_INDEX(uint32 idx), void *buffer, uint8 *length)
 
Please also refer to 'NI-FBUS Hardware and Software User Manual' from Start->National Instruments->NI-FBUS->Manuals. Page 6-41 ~ Page 6-44 describe the detail information about nifReadObject() function.
Page 6-51 ~ Page 6-52 explain the usage of marcos for processing index.
Feilian (Vince) Shen
0 Kudos
Message 2 of 3
(7,094 Views)

Thanks for the feedback.

After read the manual you recommended, I think I can do the following to read a parameter with its OD index:

the relative index of the parameter in the block = the parameter OD index - the starting OD index of the block

Then use the marco NIFB_INDEX( parameterRelativeIndex ) with nif_ReadObject function to read the parameter

 

0 Kudos
Message 3 of 3
(7,087 Views)