Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating session on RT target

Solved!
Go to solution

I am fairly new to the X-Net API and programming for RT targets, so I apologize in advance if this is an amateurish question. However, I've combed through the forum, knowledge base, and getting-started guides multiple times without much luck.

 

I have a 9862 module in a cRIO 9045, with which I am trying to record CAN signals. For prototyping and ease of logging, I elected to use the signal input waveform session mode. I have also created a database, which I have successfully (as far as I can tell) deployed to the RT target using the database editor.

 

My question has two parts, corresponding to the two ways in which I've tried creating the session.

 

  • Project session: I tried creating the session under the RT target in the project. Database and interface have been specified, with the static session reference piped into my acquisition and logging loop. However, when I try to deploy the project, it only makes it as far as 'Deploying X-Net Session' before stopping and returning "deployed with errors." The same thing happens when I try porting the X-Net project-session examples to my cRIO target. If I remove the project session, the rest of the project deploys successfully. What is going on here? I can find no specific examples or documentation on creating a project session for an RT target - is that not a supported method?
  • Run-time session creation: To get around the deployment problem, I tried creating my session at run time, but here's where my unfamiliarity with X-Net hurts me. I cannot, for the life of me, understand how to specify the database I've deployed when creating a session. The 'create session' VI has a 'signals' input, but how does one specify a list of signals if a database hasn't yet been loaded? Does X-Net automatically use whichever database(s) are deployed on the RT target and, if so, what about when multiple databases are deployed? The X-Net examples aren't particularly informative when it comes to this. 

I apologize again if these are dumb questions, and thanks in advance for any help.

 

0 Kudos
Message 1 of 2
(2,608 Views)
Solution
Accepted by topic author CaseyH_UI

XNET uses a unique "Alias" for the database to connect the API with the specific database file on disk. When you select a signal with a IO control on the front panel or block diagram, the control will first ask you to select an alias. Once the alias is selected, the control is populated with the available options from that database. 

 

We also have a programatic database API that allows you to use an alias string as an input and pull any information you want out of the database through property nodes. For example, this approach can also be used to pull out the specific signals you want and they can be used as inputs to the create session VIs.

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