LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X-NET Write Dynamic Signal

I am in the beginning stages of writing an application in LabVIEW that will need to read and write to an ECU via CAN and using X-NET. I have a DBC that I use when I set up the write session. The trouble I am running into comes from the fact that a particular signal used as a sequence counter in a given frame needs to be updated with every transmission of the frame. There is also some dynamic signals in the frame that need to be updated in a timely manner.

 

I first tried using a Signal Out, Single Point type session and put a X-NET Write VI in a loop with a loop time equal to the period of that frame that is defined in the DBC. Every time the loop executes, a new value for the sequence counter is calculated and the data to be written is updated. I'm thinking this might not work 100% of the time. If the loop takes 10.1 ms to execute and the frame periodicity is 10 ms, the value may remain the same for 2 transmissions.

 

Is there a better way to do this using a different type of session? I tried browsing around for a session property node that gives some indication of whether or not a transmission was pending or something of that sort, but had no luck.

 

Any ideas here?

0 Kudos
Message 1 of 2
(694 Views)

Hey Mattb1,

 

A good place to start for ideas is chapter 4 of the X-NET manual:

http://www.ni.com/pdf/manuals/372840h.pdf

 

It sounds like you have the logic and just need to make sure that it executes faster than your frame period. You can look at the benchmarking examples in the LabVIEW example finder to time your loops. 

 

Best Regards,

TyVo

0 Kudos
Message 2 of 2
(658 Views)