From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get rid of DD requirement to get new NI-API to work

I am trying to use the new NI-API that comes on the CD.  It works great but I seem to have to have a DD installed to get it to work despite the fact that I am using indices hard-coded in my code.  I can't even open blocks for example.  What command does one need to use to open blocks by ID opposed to tag/string name.  For example I have a transducer block called "TRANSDUCER_2000".  I want to open this using Block ID=1 (Transducer) instead of the name "TRANSDUCER_2000".
 
My understanding is the resource block is always 0 the transduver block is always 1 (at least it is for our current product).
 
Any advice?
 
0 Kudos
Message 1 of 4
(8,301 Views)
Does this new NI-API is .Net? If you are it is .Net, please use GetBlockByOrdinalNumber(int index).
 
There are two ways to open block
GetBlockByTag
GetBlockByOrdinalNumber
Feilian (Vince) Shen
0 Kudos
Message 2 of 4
(8,286 Views)

With the .net API I have found that you are unable to access a device by index without a DD for the device installed.  Any attempts to open a block by index result in the exception "symbol file not found."

 

This differs from the C API which seems to have no trouble with this and is able to access the OD within the device without any need for the DD symbol file.

0 Kudos
Message 3 of 4
(6,881 Views)

Both C and .NET API need the presence of a DD file for the device.

C will encounter error as well as C# if the DD file is missing. I did try it myself.

 

0 Kudos
Message 4 of 4
(6,873 Views)