LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW NI-XNET CAN WRITE DELAY

Hi,

I am really happy that I can read this article because it seems like it is the similar problem that I am facing right now. I also has a really bad CAN update delay when I want to write Data on CAN bus.  I was trying to following your solusion here, use frame in single point, frame out single point. But I am not so sure that I can continue. In our labview, we use frame in/out stream(sorry the screenshot cut is wrong). But if I want to change it to frame in/out single point, it will show an error saying: mising wiring on NI-XNET block.

 

In our labview, we use a big sequence loop. So what in saw in the 1st pic I attached is the first sequence, then in the 2nd sequence we had a Frame Can write frame. Then in the 3rd one, which is in the 2nd pic, it shows the CAN write frame that contain a lot of message that I would like to write on CAN bus.

 

The problem here is sometimes the CAN loop takes 0.3s(I use a shift register in the 3rd sequence showing CAN loop time) to update which is too low for me to use Vector Canalyzer to record data. For example, I did a 10 sec test of recording using Canalyzer, it only has 59 values from Labview. 

 

In your article it said I need to 'Frame in single point' for my reads, and 'Frame out single point' for my writes. I do know i can use database editor to build a session and define every frame and signal it it. However, I do not know where to put it then? is that connect to NI-XNET write frame? It is the only thing I can think of to do now? But is that meanning all the blocks in the second pic would be deleted.

 

Because our grogram is really very very big and it including so many info, I do not think I can post VI. I thought there might be possibility that because of the ''BIG'' thing has something inside that culprit for CAN transmission delay. But I have tried to move  everything except CAN in this loop to another newly built loop. The problem is still there. 

 

 

 

Thank you so much. can in.pngcan write.png

0 Kudos
Message 1 of 7
(4,166 Views)

In your first screenshot, you are performing a Frame Write to an Input session. This should throw an error. You should read from input sessions and write to output sessions.

 

Where do you configure your output session? You don't show that on your screenshots. If you don't configure an output session, I'm surprised that the transmission works at all.

 

Do you have an XNET database or created objects that your are using in a project?

 

EDIT: Also, does the device you are communicating with actually use REMOTE frames?

0 Kudos
Message 2 of 7
(4,148 Views)

I am sorry, the first screenshot is wrong, it is a 'Frame Out Stream' connect to the 'Frame CAN Write'.

 

I do not have an XNET database. And I am not sure what do you mean by 'created objects'. I indeed have the object that showing on the second screenshot that indicate the ID and payload that will write on the CAN.

 

For 'Remote Frame', we have indeed that send query message on bus to ask for status of power supply. Is this the remote frame you are pointing?

 

 

 

Bests,

Sandy

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

You actually always have an XNET database. It's just a matter of whether you use an external database or whether you create objects on the fly.

From your screenshot, it looks like you are creating objects on the fly using the in memory database.

 

Looking at your frame configuration, I was surprised to see Remote frames being configured. Most devices that I've encountered don't use them.

 

So what sort of session are you trying to create? Frame Out Stream does not allow for cyclic transmission. You can repeat transmissions using a software loop. If you really have cyclic frames, Frame Out Single Point or Frame Out Queued would work. The post you referred to earlier was using the Frame Out Single Point.

 

The XNET help is actually pretty good about breaking down the session modes. From that help, "...  this mode does not repeat its transmit. Unlike the Frame Output Queued mode, the Frame Output
Stream mode does not use CAN frame properties from the database."

 

So if you're using this mode and getting unexpected delays, it's likely due to your sequencing.

0 Kudos
Message 4 of 7
(4,073 Views)

Here's a snippet of how to configure for single point using an in memory database.

You'll likely need to configure the frame properties individually.

 

I left out some of the good housekeeping that should be included such as closing the session and database.

XNET Single Point Setup.png

0 Kudos
Message 5 of 7
(4,063 Views)

The problem is like showing in this attatchment. I use vector analyzer to log in data from labview. But it seems like every 35 data, it will have an real data from labview, which is 50 0.7 in it. So it means that I have a fast sampling rate but the labview sends data too slow. that is why I was trying to use frame out single-point, because I read some article from this forum that frame out single-point can avoid deley.

0 Kudos
Message 6 of 7
(3,952 Views)

So do you recommend me to use frame out single-point instead of frame out stream? can this avoid delay. I did what you said that I remove any calculation in the loop which has CAN communcation to other loops. But it still has this delay problem

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