Dynamically Modify the XNET Database or Signal List for XNET Create Session

Updated Oct 12, 2023

Environment

Software

  • LabVIEW

Driver

  • NI-XNET

The XNET Create Session VI (Signal Input or Signal Output) requires a signal list  to specify, which signals of the CAN database will be read or written.
 
  • Can I dynamically alter the database, i.e. use another alias  that includes signals of the same name?
  • Can I dynamically modify the content of the signal list array and replace or remove certain signals?

XNET Create Session will also accept an array of strings as a signal list instead of the dropdown elements. You can use one of the following syntaxes to specify the used signals and databases.
 
  • <signal>\n<dbSelection>
  • <frame>.<signal>\n<dbSelection>

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
You can use the the LabVIEW string functions to dynamically modify the signals and databases at runtime. Here is an example on how to alter the used CAN database of a signal list.


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.