07-19-2010
10:07 AM
- last edited on
04-21-2025
02:41 PM
by
Content Cleaner
Making my first steps with a NI PCI-8516 and XNET I'm facing some problems/questions.
NI's examples use a default database (nixnet_exampleldf). Using the examples, the communication between both ports is OK.
The NI-XNET Hardware and Software Manual shows how to create a database. But, unless I'm missing something obvious, LIN isn't compatible with the XNET Database Editor (in opposite to CAN and FlexRay).
07-22-2010 07:23 AM
Hi JB,
Thanks for posting your querstion in the NI Forum. The quick answere is you did not need a database to work with the devices. Have a look to the LIN examples in LabVIEW (examples\nican\LIN - Basic.llb\LIN Master Send Header Frame and Receive.vi).
A LIN database could not be generated at the moment.
Regards
TomBaum
07-22-2010 02:36 PM
Hi JB,
Unfortunetely, a database file is currently required with NI-XNET 1.1 and our LIN interfaces. As TomBaum mentioned, a database is not required with our USB-LIN devices. There are two options for using databases:
1. Use a static LDF file
We currently do not support editing LDF files. You can always use a free editor like this one:
http://downloads.hto.fh-deggendorf.de/DownloadManager/zdm/download.php?file=203
Or, if you understand the spec, you can always edit the file with a text editor 🙂
2. Create an in memory database
You can create all database items in memory (in your block diagram) using the NI-XNET API. You can look at the LIN Dynamic Database Creation.vi example located at Hardware Input and Output -> LIN -> NI-XNET -> Advanced.
I hope this helps.
07-23-2010 02:34 AM
Thank you very much for your answers.
A colleague has already successfully used the NI USB-8476 in an application. Now, for an application with 4 LIN buses, I would like to use PCI-8516s for some reasons.
Meanwhile, I got the LDF file for the Device Under Test (DUT) and was able to communicate with the DUT. I have also "played" with LIN Dynamic Database Creation.vi and will
give the free LDF editor a try in the case the database has to be enhanced for the needs of the test application.
There are still questions about LDF and NI-XNET but I should now be able to progress.
One very important question : Is there a way to know if XNET Read (Signal Single-Point).vi returns the default values or the data sent by the DUT ?
If the DUT is not connected, the VI will return the data according to the default values of the LDF file. I'm really missing a boolean which indicates the nature of the data !
Many thanks in advance for your help
07-23-2010 07:36 AM
I believe the timestamp is 0 if the data is default data and non-zero if it actually came from the device.
07-23-2010 09:10 AM
Hi JB,
You won't be able to get timestamp values directly with a signal single point session. However, you can open multiple sessions on the same interface, so you could always open a stream input session and wait for a valid frame with a valid timestamp to appear on the bus. That may complicate your code too much...since a valid frame may not the be frame your slave is sending...etc.
Another option is to use the signal input XY. This gives you all the values of the signal with an associated timestamp. That way, you can know exactly when the slave answered. Let me know if that works for you.
07-23-2010 09:55 AM
GPIB Guru a écrit :
I believe the timestamp is 0 if the data is default data and non-zero if it actually came from the device.
A little test shows that you are right. Unfortunately the timestamp is only there with frames. Is there also a way to know if the data come from the device when using signals ?
07-23-2010 10:00 AM
As O. Proulx wrote, if you do Single Input XY you will get timestamps with the data and still use signals.
The problem is that this is no longer single point, but uses queues.
Could you give a defaul value for the signal that is invalid? Then you can check for the unique value???
07-23-2010 10:02 AM
It is very important to know if the data was sent by the device or is the default values. Why is this information not available with a signal single point session ?
07-23-2010 10:13 AM
GPIB Guru a écrit :
Could you give a defaul value for the signal that is invalid? Then you can check for the unique value???
I have already thought about this. Unfortunately, the testbench will be used for several types of devices. Each type has its specific LDF file with tens of signals. It would be much work to modify all the default values and for some of the signals all values are valid.
Anyway, my opinion is that this would open the door for many mistakes and would lead to a non robust LV code !