LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-XNET fundamental operation

I'm using NI-XNET to communicate over a CAN bus. I am working with two CAN devices at two different addresses. I have defined all of the specifics of the CAN project using the XNET Database Editor.

 

This is what I don't understand: why does my code continue to run after I exit the routine that writes / reads from the bus, and continues to run until I close the labview program? The frame rate is 100mS on both read and write frames, and my bus sniffer (pCAN) continues to see bus traffic at that rate until labview is closed. Is this normal operation?

What am I missing? What am I doing wrong in my code?

0 Kudos
Message 1 of 8
(2,485 Views)

I'm using NI-XNET to communicate over a CAN bus. I am working with two CAN devices at two different addresses. I have defined all of the specifics of the CAN project using the XNET Database Editor.

 

This is what I don't understand: why does my code continue to run after I exit the routine that writes / reads from the bus, and continues to run until I close the labview program? The frame rate is 100mS on both read and write frames, and my bus sniffer (pCAN) continues to see bus traffic at that rate until labview is closed. Is this normal operation?

What am I missing? What am I doing wrong in my code?

0 Kudos
Message 2 of 8
(2,475 Views)

Please avoid duplicate posts - https://forums.ni.com/t5/LabVIEW/Using-XNET-CAN-with-LabVIEW/td-p/4234926

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 3 of 8
(2,477 Views)

It would be helpful if you could post your vi.

0 Kudos
Message 4 of 8
(2,384 Views)

Do you need more of my vi than what I already posted? What part would you like to see?

0 Kudos
Message 5 of 8
(2,381 Views)

Where your stop command is coming from? Seems like you either have some parallel process still running or you aren't stopping your while loop properly.

0 Kudos
Message 6 of 8
(2,374 Views)

@charlieallanp wrote:

Do you need more of my vi than what I already posted? What part would you like to see?


You have posted pictures of your code. It is very difficult to debug a picture.

 


@charlieallanp wrote:

why does my code continue to run...?


You have some kind of queued state machine. You will need to stop both loops to stop your code from running.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 7 of 8
(2,369 Views)

We can't see what parts you have, os how can we answer that? 

 

How do you close and stop you XNET sessions? 

0 Kudos
Message 8 of 8
(2,366 Views)