07-09-2012 03:39 AM
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
07-09-2012 04:12 AM
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
07-09-2012 04:21 AM
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
07-09-2012 10:49 PM
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.
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.
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:
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