LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-8502 problem

I have tried all the transmit example in both the NI-XNET and NI-CAN directories.

In all cases I cannot seem to get the setup to send just one frame. I always end up with continues or very long runs of the same frame.

I would like to send one frame then change the frame and send another etc.

In one of the NI-CAN examples is even said 'Transmit one CAN Frame'

I did try removing the While loop around the CWrite VI.

I am new to CAN so may be misunderstanding something.

 

 

Anyone have any examples that could help me.

0 Kudos
Message 1 of 3
(1,930 Views)

It seems like you are making a bunch of posts.  I'd suggest keeping one topic until it gets solved this is making for a fragmented conversation.

 

https://forums.ni.com/t5/LabVIEW/Good-CAN-Bus-example/m-p/4070512

https://forums.ni.com/t5/LabVIEW/NI-XNET-EXAMPLE/m-p/4071644

https://forums.ni.com/t5/LabVIEW/NI-XNET-EXAMPLE/m-p/4072061#M1170164

 

Also I'd suggest posting in the Automotive subforum.  You will probably get more specified help there.  Then I'd suggest doing some reading on CAN.  I happen to have a blog series. The first couple parts are probably the best for you.

 

Now lets see.  You have an XNet device which is good.  Don't bother with anything NI-CAN related.  Those examples and drivers aren't for your hardware and won't be useful.  I'd start with the bus monitor.  Open up MAX, find your hardware, and open the bus monitor.  From here you can change the baud rate (it must match your other devices).  Then make sure the wiring and termination are right.  You'll want 2 120 ohm resistors, one on each end of the bus.  You should then be able to see stuff from the other devices.  This bus monitor also allows for sending raw frames.

 

If you have a database import it into the XNet database editor, and look at the Help >> Find Examples in LabVIEW for the Signal Out Single Point.  This allows for you to write your value as engineering units.  Your database will convert things from something like degrees, to the raw frames.  If you don't have a database look for an example like CAN Frame Output Stream.  XNet is flexible and allows for lots of different session types to be combined in useful ways.  I have a couple blog posts on XNet session types.

0 Kudos
Message 2 of 3
(1,862 Views)

I found my problem.

The problem is that although I had the correct termination at each end.

I did not have a receiving channel running. This meant that I was seeing the same request sent over and over because it had not been acknowledged. with a single point input running as well  just one frame was sent and received correctly. 

0 Kudos
Message 3 of 3
(1,855 Views)