CAN Database constant not working in the target PC

Updated Jul 10, 2020

Reported In

Software

  • LabVIEW

Driver

  • NI-XNET

Issue Details

How can I use a constant for CAN Database file when I build a LabVIEW code to deploy it?
My XNET CAN program, coded with LabVIEW, is working well on my PC. However, it does not work in a deployed PCs. I think the problem is  the CAN Database file Constant. The deployed PCs can not recognize the constant of the CAN Database file even though the file is in the proper location. When I replaced the constant with a control, it is working. 

Solution

This problem occurs when your alias is not added to the CAN database. Since your alias(CAN database file) is the new alias to the target PC, you need extra code which adds it into the CAN database.

You can simply add the new alias by using XNET Database Add Alias.vi

alias is the name of the constant of the new CAN Database file. 
filepath is the location of the new CAN Database file. Note that this location is where the CAN Database file will be located in the target PC.

You can create your LabVIEW code as shown below.