LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different timings using streaming output with CAN NI-XNET

I have set up the database to cyclic timing, with the corresponding transmission time for each frame. I have four frames being outputted through streaming output using the NI-XNET tool after being concatenated and thrown into an array with the array builder function. Using the bus monitor, I can see that all the frames are being transmitted at the same rate, regardless of the rates being different in the database. What's going on?!

 

I tried using timing loops and timing frames, but I am not noticing that the problem is really being fixed. 

 

I have 4 frames being packaged and then sent to the CAN stream output block from the NI-XNET toolbox. Three frames need to be transmitted  at 500ms and the fourth frame needs to be transmitted at 100ms. I don't know how to have this done within LabVIEW.

 

Toying around with the examples and the timing tools, but get nothing being written to CAN or get an error saying that I cannot open the same frame/session twice, getting signals just drop out or getting times that change from 1.6 or 1.7 and suddenly, randomly go to 0.5 or 0.9 Hertz according to the bus monitor. 

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

Hi estradjm,

It sounds to me like you have your database configured properly, but instead of using the frame configurations, it sounds like you are taking all the frames then transmitting them through the streaming output, is that right?  Have you tried configuring multiple sessions, one for each of the frames, then using the frame output single point session?  You should be able to configure each of your frames in the database editor with the timing you are looking for, then create a unique session for each frame on the same port.  For an example of how to configure multiple sessions on the same port, take a look in our Example Finder under NI-XNET under Multiple Sessions.

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

What example is that? I don't see anything in the examples that addresses this particular problem. 

 

I tried using the output single point sessions about a month ago, and was not able to get past the errors. The error for openning multiple sessions comes up every time. I cannot open the same session.

 

Streaming is the only way that the messages would write to can.

0 Kudos
Message 3 of 8
(2,810 Views)

First of all, what have you tried ? show us some code!

 

Second: I can't ether find that exsample, but you should be able to find the "Virtual CAN Device Simulator".

This shows how to create multiple output sessions.

 

Last: What hardware are you using ? What version of LabVIEW and NI-CAN/XNET are you using ?

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

If i change the timing in the NI-XNET database for a frame, why don't the transmission times seen on the bus monitor change? Do I need to restart the VI, save the database and close it, restart the computer, restart LabVIEW? What do I need to do to change the timing for transmission?

 

I am using the Queued Frame Output, as I have it understood that the Streaming Fram Output doesn't take into consideration the transmission timing, but instead throws all the frames out to CAN as soon as it can.

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

How would you simulate a comm loss?

 

I thought by simply using the conditional statement and taking out the write to CAN block, I would not transmit to CAN, but monitoring the bus shows otherwise. I thought about using the stop and erase block or even the flush block, but then realize that the timed loop would not have anything for a session to write to CAN after you enable the conditional statement and the write.VI. 

 

Attached is a subset of the larger VI I am using. All it is is a timed loop in which I am writing to CAN a user controlled CAN message from the UI (front panel), using a queued output mode write.VI after creating a session outside of the loop to write the specific CAN card and frame. 

 

How would I be able to disrupt comms of a particular frame being sent out and then recover it for the purposes of fault injection?

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

How is the Transciever State work within the scope of the NI-XNET API? Could this be used to simulate a comm loss, using the normal and sleep or single wire wake? What block sequence would allow this to run? Is this possible with the use of the API? 

0 Kudos
Message 7 of 8
(2,773 Views)

estradjm,

From your first post, you mentioned that you were having issues with the timing.  Is that resolved?  For different timing, you will need to have multiple sessions open, one session for each different rate you are trying to send frames at.  There is an example on using multiple sessions in the Example Finder.

 

You next asked about simulating a comm loss.  It looks like you got that answere from this forum response.  Finally, you asked about the transceiver state.  There is a sessions property node that will give you the state of the transceiver.  You can find more information about this from our XNET Hardware and Software Manual.  The state information is on page 4-85.

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