From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

xnet cyclic messages

Hello,

 

I have the following situation:

 

In my application I already defined the CAN Frames. I use different CAN controllers to send/receive CAN messages, and now is the time for NI Card 8512.

 

Until now I send single Frames using CVI timers to simulate cyclic messages , because the CAN controller does not support sending cyclic messages by them self (as NI 8512 does). So I want to use this feature. I created a database in memory, defined my cyclic messages and started a session.

 

My problem is that when starting the session, the whole cyclic Frames start to send the payload data, and have no possibility to control (start/stop) each Frame. I want to control programatically the cyclic messages. I found the possibility to change the cycletime by changing nxPropSessionSub_CANTxTime for that Frame, but could not stop it, without stopping the session. I wanted to start one session for all messages and start/stop some messages as cyclic frames and the others in event-driven manner.

 

The only possibility for doing that now (after my opinion) is to start for each cyclic frame a session, and for other frames (event driven) only one session. But for that all cyclic messages should be defined in database (static) or in :memory:

 

Thank you in advance,

Daniel

 

0 Kudos
Message 1 of 4
(6,601 Views)

ping

0 Kudos
Message 2 of 4
(6,571 Views)

danis_rom wrote:

I wanted to start one session for all messages and start/stop some messages as cyclic frames and the others in event-driven manner.


That is not how sessions work. All frames in a session start and stop together. If you want to start and stop some of your frames separately, put them into a separate session.

 

The only "workaroud" that I can think of would be to use the properties nxPropSessionSub_CANStartTimeOff, which schedules how long after a start the frame will delay before sending out the first frame (used for cyclic objects) and nxPropSessionSub_CANTxTime, which sets the cyclic rate for an object. If you want to "pause" an object, you can set the StartTimeOff for a very long time and then set the CANTxTime for a very long time, which effectively pauses the object. To set it back, you can then set StartTimeOff to 0 and CANTxTime to the desired time to make it restart the object. 

0 Kudos
Message 3 of 4
(6,567 Views)

Hello,

 

thank you for the answer. This is a possibility, and I will try to implement it.

Do you know what is the maximum for nxPropSessionSub_CANTxTime and nxPropSessionSub_CANStartTimeOff ?

 

 

0 Kudos
Message 4 of 4
(6,554 Views)