Showing results for 
Search instead for 
Did you mean: 

XNET READ SIGNAL XY buffer behaviour

Dear all, 

Context: My NI hardware is the NI-9860 (+ TRC-8546 ) module and I use NI-XNET read SIGNAL XY to catch the frame received from the equipment. I have a scheduler running at the background to send frame followed by a send of the header to receive the frame response.
Note: I don't any hardware now, to test eveything.. which would have already probably gave me the reponses to my questions.
1) Reading the NI-XNET-Hardware-and-Software-User-Manual-and-Specifications , in particular the example written into the Signal Input XY Mode chapter, I understand that the first frame signal received is put at the top of the NI-XNET read SIGNAL XY buffer (index 0) . It remains at this first index even if there is more frame signal received after that. Those ones are put after, meaning index 1, index 2, etc... Is my understanding correct ?
2) If I pass through the NI-XNET READ Signal XY function in my code, and that just before, my scheduler passed through a response request frame (header). 
If there was no response from the equipment, what is the behaviour of the function ? Would it still give as an output a correct timestamp ?
3) If I had 2 frames received at the previous call of the NI-XNET READ Signal XY function, and then, at the last call, I didn't receive any frame. 
What is the size of the array (timestamp or value signal) ? Is it reset to 0 ?
Thank you in advance
Best regards,
0 Kudos
Message 1 of 4



Any help ? 🙃

0 Kudos
Message 2 of 4

I don't fully understand your question, but I will try to describe the XY read function.


You configure what signals you want to read with the XNet Create Session.  Here you provide an array of signals you want to read.  After the session has started the XNet hardware will look for CAN signals that come in, and hold them in a buffer, or a queue.  Once you call the XNet Read, all the values in that buffer are returned, and the buffer is cleared.  This assumes you have number to read set to -1, or unwired which is the default.  If you called the XNet Read a second time immediately, the returned signal values will be empty.  By that I mean the Data Array will contain the same size as the number of signals you configured to read in the Create Session.  But the Timestamp, and Value will be empty.  This is because the first read will return Timestamp and Values from all the previous signal values the hardware saw.


If you want to keep track of the previous values that have been read, then you need to track them and keep them in something like a shift register.  Most designs have the Read function being called periodically, and then logging those new values, or appending them to the previous values with some limit on the size of the data being collected.

Message 3 of 4

Hello Hooovahh,


It seems I can only count on you, once again 😃


You reply is clear, thank you. I could do some remote control test and I see the same behaviour.

But even if it helps me to understand how those XNET functions work, It didn't fix the issue.
Indeed, after a while of running (few few ten minut of few hours), I can see a shift on the buffer. I mean, when I call the read, at a time, I got the frame previously received and not the last one. I precise than I have tried to add a flush (even if it wouldn't do anything using a Signal In Single-point Xnet session, I guess) a certain time before the read, and it didn't solve the issue.
-> Have you seen such a behaviour before ?
-> What could be the root case ?
      - A lack of perfomance of the HARDWARE (cDAQ NI-9860 (+ TRC-8546 )) after a certain time of use  ? 
      - A lack of perfomance of the software (Labview and its XNET functionafter a certain time of use using the XNET functionnality and/or communicating with the HW in real time ?
-> How to fix it ? When I exit my software and re-start, it works well. So I was thinking to make this dynamically in my code by using a "System Close" Xnet functionallity periodically (and the end of a specific sequence for example), and if it doesn't work, by using the DAQmx "peripheral reinitalization". But for this last one, I do no know if I need to something just after to set anything?
Thank you in advance,
0 Kudos
Message 4 of 4