From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving from NI-CAN Transmit Periodic Waveform to NI-XNET

Hi,

 

I have been using the LabVIEW NI-CAN Frame API with Series 2 PXI CAN Cards to control my outgoing CAN on a test stand.

Now that those cards are being phased out, I am trying to convert my existing functionality over to the XNET API.

 

With the NI-CAN Frame API I am able to provide a set of 16 precalculated payloads and have them sent out on repeat at a precise interval. (transmit periodic waveform)

Is it possible to do the same thing (or nearly the same thing) using the XNET calls?

 

I have been forced into using precalculated payloads in the past because I have CAN and DAQ Traffic for 22 stations being managed and every bit of processing I can offload to the CAN Card is useful.

The big problem I'm running into with the XNET API is that CAN signals like a message counter or a custom checksum are just sent out with the previous value if I cannot get around to calculating new payloads and calling the Write function again in time.

 

I'm using:

LabVIEW 2011 SP1

NI-PXI-8512/2 XNET Card 

XNET Driver 14.1

NI-CAN Driver 2.7.3

 

Suggestions? =D

0 Kudos
Message 1 of 7
(3,434 Views)

Hey,

 

If you set up a frame to be cyclic in the XNET database, it will have a hardware timed, periodic output when you write it to the bus.

 

Here is an article that you might find helpful for migrating your application to XNET.

 

Migrating NI-CAN Applications to NI-XNET

http://www.ni.com/white-paper/9717/en/

Britton C.
Senior Software Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,372 Views)

Yeah, I have been looking through that document.

 

It looks like I have to move back to a buffered output where I refill the outgoing frame buffer as quickly as possible.  The problem is that I was unable to keep up with that in previous tries with the NI-CAN Frame API.  Maybe the XNET API will be more efficient.

 

Thanks Britton.

0 Kudos
Message 3 of 7
(3,341 Views)

You need to read more documentation.  XNet supports hardware timed retransmits where you don't have to continually fill the bucket with new data to transmit.  When you create your session there are three modes for Signals, and three modes for Frames.  Queued, Single-Point, and Stream.  You'll need to pick the right one for your application so read up, and test out the different modes to see how they differ.

 

XNet is way more capable than the NI-CAN stuff it is just usually done a slightly different way than you are used to.

0 Kudos
Message 4 of 7
(3,336 Views)

I understand that I can send Cyclic Frame or Signal data at specified intervals, but what I want to do is repeat a given sequence of values indefinitely.

There are lots of ways to send periodic data regardless of whether its a Signal or a Frame, but my problem is in the sequence of values part.

 

Lets say I want to send these three frames:

1) 0x00 0x00 0x00

2) 0x01 0x01 0x01

3) 0x02 0x02 0x02

over and over, in that order with the same interval forever, without doing anything in software but calling Open, Write, Start.

 

That is doable with the NI-CAN API, is that doable with the XNET API / XNET PXI Cards?

 

I can't find a way to repeat a sequence of frames without having to refill some sort of buffer (whether it be signal, frame, or stream).

The NI-CAN Compatability Layer cannot replicate Transmit Periodic Waveform either.

0 Kudos
Message 5 of 7
(3,285 Views)

Ahh okay that wasn't clear before.  You are essentially asking to put down a series of outputs to cycle through then continue to cycle through without any other functions other than the write.  That the XNet drivers don't support.  As you mentioned you can continually fill the buffer with new outputs in the Queued output method.  This is how I handle a watch dog signal, that needs to increment an output from 0 to 255 back to 0.  I setup the output rate, then put down many outputs as an array which go out one at a time.  After some time I add more outputs to set re-filling the buffer, before the buffer completely empties.

 

It sounds like you are aware of this method but would like something simpler from an API perspective and as far as I know XNet doesn't support that.

Message 6 of 7
(3,279 Views)

That is very similar to what I'm trying to do.

I wanted to make sure I wasn't missing something simple before I got to implementing my XNET core Class with the buffered approach.

 

Thanks for the replys,

 

Rob Afton

0 Kudos
Message 7 of 7
(3,273 Views)