01-17-2022 10:06 AM
Hello,
I am using the NI-9860 onto a cDAQ-9189 and I am trying to do 2 things to let me communicate with my slave device (sensor) using XNET:
Also, as an additionnal question, as on XNET we need to open a session (one to write, one to read), what would be the best way (structure of diagram) to let me send one full frame followed by sending a header followed by a reading of the slave reponse ?
I have thought about the sequence structure for this (3 differents strucutres for each sessions), but it might be something better ?
Thank you in advance 🙂
01-17-2022 07:21 PM
You can use a Input Session as the LIN Master and loads a schedule which contains only slave payload. Please see the attached example.
DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
01-18-2022 05:49 AM
Hello ZY_Ong,
I have tried to launch your example as explained (first open database editor then open CarWindow.xml) but when I launch the VI, it shows 1074384560 error.
Looking on Knowledge NI web page , I see that either I should load the alias (which didn't work, but I am not sure that I made it well) either add the alias on the database editor, which seems already well defined.
Meanwhile, I have tried to develop my own VI to:
1) send a frames from the master to the slave, which is used to kind of wake up the device and specify which datas it will wait for when It will send then the header
2) send a Header by the master and read the slave response using a piece your Carwindow example, using my own LDF.
Here is the screenshot of the front pannel:
The diagram screenshot:
The database screenshot:
But when I spy the LIN bus thanks to my other LIN port, I see the Master frame but I don't see any header frame sent.. So I guess there is a misunderstanding somewhere. Could you explain please ?
01-18-2022 08:17 PM
Once you have registered the database alias, you might need to right click on the Frame List and Schedule to select the newly registered database. The original database file contains DUT name so I renamed it, but it will break the compatibility with the VI.
The sending of header is handled by firmware. You only need a Input Session that specifies a schedule, if you only want to read the payload from slave.
If you want to send a LIN wake frame, please refer to shipping example at Hardware Input and Output >> LIN >> NI-XNET >> Sleep and Wakeup
DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
01-19-2022 02:08 AM
@ZY_Ong a écrit :
The sending of header is handled by firmware. You only need a Input Session that specifies a schedule, if you only want to read the payload from slave.
If you want to send a LIN wake frame, please refer to shipping example at Hardware Input and Output >> LIN >> NI-XNET >> Sleep and Wakeup
So I guess that the vi I have "developped" (it takes the "LIN frame Output Single Point.vi example to send the full master frame and your "CarWindow_LIN_Master.vi" example to then send the master header and read the slave response) should work (see screenshots in my previous email, you will find the .vi and the ldf in attachment to let you kindly check), souldn't it ?
It seems not..it only send the Master full frames but I don't see any header sent then, spying the LIN bus thanks to the second LIN bus monitor. Is that normal to not see any header sent?
Concerning the database alias, I did select the right frame list and schedule but the error is still here.
Coud you be more explicit by "Once you have registered the database alias" ? You mean just load it into the database editor as we talked about?