Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET CAN "disturb" signal

Solved!
Go to solution

Hello XNET'er,

 

I have a running Signal Single Point session with let's say 500 Signals. I keep track on which signal has which value - I store the data simply in an array of numbers. All the holding frames of the signals are cyclic frames.

 

Now I want to change a signal value from 0 to 1, but the new value has to be sent strictly a specific number of times, in my current case only once. After the value of 1 for the signal has been sent, on the next time the frame will be sent, the value has to be again 0. How can I be sure, that the value 1 has already been sent to the CAN bus (physically) ?

 

Madottati

0 Kudos
Message 1 of 4
(3,397 Views)

You can try using a Signal Output XY session type for the signals that only need a specific number of frames transmitted. The Signal XY session offers you the ability to queue up values and they will be sent to the bus as timing allows. Simply queue up the specific signals and then add the default value to the end of the queue. There are some caveats though. If the signal list contains signals that are in the same frame the XNET Wait(Transmit Complete).vi will block execution for us. If the signals are not in the same frame we must take care to allow the frames time to transmit. I have attached a quick example that I made to help demonstrate their usage in conjunction with the description on page 4-41 of the XNET manual.

Signal Output XY Example.png

You can run the example against the bus monitor using the XNET Example database. It will send out the event frame immidiately and then send out the CANCyclicSignal1 values 1 -> 5 -> 1. The CANCyclicSignal2 values will stay constant with the value of 2. The two case structures demontstrate what hapens when we overwrite a value before it has a chance to complete transmission. If we remove the Event Signals from the signal list then the remaining signlas are in the same frame. Transmit complete will then tell us when our three frames have been sent.

Jeff L
National Instruments
Message 2 of 4
(3,380 Views)

Hi Jeff,

 

great solution, thank you!

 

But there is another problem. This solution works if I want to send the signal sequence only in this session. But in my case, there is another session (Signal Single Point Out) running parallel, containing the signal to be changed. So the containing frame will be sent to the bus every 60ms. If I create an XY output session with this signal, it will send the values in addition to my other session.

 

1. The Signal Single Point Out session sends always the value 0  every 60ms

2. The Signal XY session sends in also every 60 ms, but depending on the start time of the session let's say the values of this session will be active for 30 ms, then the first session sends this frame again with its default values...and my ECU doesn't really know what to do.

 

What is the solution? Stopping sending the frame by the 1st session while the 2nd session sends, is a quite complicated process. The signal must really be just "disturbed" for one or two sending cycles, then it should continue run as before.

Important: The rest of the signals in the same frame must be untouched by the XY session.

 

Madottati

 

 

 

0 Kudos
Message 3 of 4
(3,366 Views)
Solution
Accepted by topic author Madottati

I would suggest replacing the single point session with the XY sessions. Notice from the example that we can queue up several value changes for a specific signal and leave the rest with emply arrays. In this regard the XY session will behave exactly like a single point session and transmits the most recent value provided or the default value if the signal hasn't been written to yet.

Jeff L
National Instruments
Message 4 of 4
(3,354 Views)