FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing SMIB attributes

Hi,

 

I am developing an application in which I need to access the SMIB attributes (e.g.:domain descriptor attributes) of the device. I don’t see any NI APIs specific to these attributes but I could see some APIs  for the functional block parameters in the NI-FBUS user manuals.

 

Please help me on this.

 

Regards,

Sundar 

0 Kudos
Message 1 of 4
(7,351 Views)

Hi Sundar,

 

Could you please provide the following infromation to me?

 

1. Which kind of API do you need? C-API? Or VI-API?

2. Which paramater do you want to read the attribute? Do you know the Name or the ID?

 

Thanks.

Chris

0 Kudos
Message 2 of 4
(7,349 Views)

Hi Chris,

 

1. I need to use the C-API.

2. I need to write to the multi domain descritptor attribute in SMIB.

 

Please let me know if you need any other information.

 

Regards,

Sundar

0 Kudos
Message 3 of 4
(7,344 Views)

Hi Sundar,

 

For this usage, you only need one C-API: nifReadObject().

If you know the index, it is 

nifReadObject(
nifDesc_t ud,
NIFB_INDEX(uint32 idx),
void *buffer, uint8 *length)

 

And if you only know the name, it is

nifReadObject(
nifDesc_t ud,
“MULTI_DOMAIN_SUMMARY ”,
void *buffer, uint8 *length)

 

---------------------------------------------------------------------

Regarding how to access to the multi domain descriptor attribute, here are the steps:

1. Read the Object Name "MULTI_DOMAIN_SUMMARY" of the MIB.

multidomain1.JPG

2. You could see the last but second value of MULTI_DOMAIN_SUMMARY is the MultiDomainDescriptor Starting Index (405). And the last value (2) indicate how many domains are available. Then you need to read the Index of 405.

multidomain2.JPG

3. Then the last but second value is the DomainDescriptor Starting Index (410). It means the first domain information index. The comming domain index is 411. And 412 is the next if there are 3 domains.

Read index of 410, and you get all the atrributes you wanted as below:

multidomain3.JPG

The Structure of this is listed below:

{

    Unsigned8 Command,

    Unsigned8 State,

    Unsigned16 ErrorCode,

    Unsigned32 DownloadDomainIndex,

    Unsigned32 DownloadDomainHeaderIndex,

    Unsigned32 ActivatedDomainHeaderIndex,

    VisibleString DomainName

}

 

At last, since you are using C-API, you have to parse the data in the buff by yourself.

If any further questions, please let me know.

Thanks.

Chris

 

0 Kudos
Message 4 of 4
(7,334 Views)