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.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET API Interface-Specific Properties

Why are Interface-Specific properties (i.e. baud rate or whether to echo transmits) part of a session rather than part of the interface?
 
This leads to either having to designate one session as a master session that is initialized before all other sessions or creating a dummy session that isn't used for anything, which seems rather awkward to me (rather than modifying the properties on the interface reference before it is passed into the create session vi).
 
I have thought of making an idea for this on the idea exchange, but I figured that it needs to be fleshed out first here (also there may be some compelling reason for the way things currently are that is completely obvious to everyone but me).  It doesn't help that the Idea Exchanges that might apply to XNET (Data Acquisition, Additional NI Software, maybe PXI and Instrumentation) are all nearly dead.
0 Kudos
Message 1 of 2
(2,259 Views)

The way it works now is that any property designated as an interface property can be set by any session on that interface. This approach keeps it pretty simple in that you can set the interface properties first, last, once in the middle, or on every session. Interface properties are static so multiple writes to the same property will result in the last value being used. For example on the same interface, if session A is created and sets the baud rate to X before session B is created with baud rate Y, the interface will use baud rate B since it was called last. 

 

It is my understanding that ease of use, flexibility, and a reduction of API complexity were the main drivers for these design decisions but that was before my time.

Jeff L
National Instruments
0 Kudos
Message 2 of 2
(2,248 Views)