Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

select xnet database programatically

 

I have two identical pieces of test equipent that use the same database frames and signals. I have two databases that are also identical, but use different arbitration ID's. 

 

I created a couple of vi's to read/write to the equipment, but each time I run them, I have to manually select the database for the one I am talking to by right clicking on the signal list and selecting the database.

 

I plan to put these vi's into an automated test.  Is there a way to programatically select the database when I call these vi's?

0 Kudos
Message 1 of 5
(7,506 Views)

You can use the "Generic" version of CreateSession. You pass the name of the database as a parameter, separate from the name of the signal(s).

Message 2 of 5
(7,504 Views)

you can also point dynamical to any database and object by not using predefined IO Names but create a string

 

see the NI-XNET manual for more information how to use XNET IO Name Strings:

 

here an example how to use XNET Frame IO name strings



... Use the following syntax convention for the XNET Frame I/O name string: <frame>\n<dbSelection>
The string contains the frame name, followed by a new line (\n) as a separator, followed by
the selected cluster name. When you drop the I/O name onto your front panel, the control displays only one line by
default. This enables the VI end user to focus on selecting the <frame>, rather than the more
complex syntax that includes <dbSelection>. Lowercase letters, uppercase letters, numbers, and the underscore (_) are valid characters for <frame>. The space ( ), period (.), and other special characters are not supported within the
<frame> name. The <frame> name must begin with a letter (uppercase or lowercase) or
underscore, and not a number. The <frame> name is limited to 128 characters. The frame
name is case sensitive. ...

 

 

 

 

Message 3 of 5
(7,502 Views)

 I read the section of the manual you referred to and am a bit confused. I am new to XNET and am still learning how it works. Where do I put the string?

0 Kudos
Message 4 of 5
(7,494 Views)

Thanks. That did it.

0 Kudos
Message 5 of 5
(7,493 Views)