Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Frame Signal Conversion With XNet

Thanks when I get some time I'll look into supporting this.  I did notice that Signal_K is used when the Mode Value is 2, and your Multiplexer (Signal_M) is only one bit, so the value of 2 can never happen.  If you are using this in an actual device you might want to fix that, if you made this as a demo just for me then nevermind. 

0 Kudos
Message 11 of 30
(7,262 Views)

Dear  ,

 

Thanks for pointing out.

 

Please correct my mistake.

 

I'm not using this DBC in actual device. It's Just demo

 

Please add one more byte (So, Total 2 Bytes).

Munna
0 Kudos
Message 12 of 30
(7,258 Views)

You probably already got a notification but I just updated the frame to channel conversion to support multiplexed signals, and added an example showing it working.

Message 13 of 30
(7,233 Views)

Dear Hooovahh,

 

Thanks a lot for your help.

Now, it’s working well.

 

I have few questions about this, Please help me.

  1. Why you added “Wait (ms).vi” with Zero (0) ms values. Is there is any specific reason?
  2. In “Get Mux Information.vi”. Instead of using “Conditional Auto-Indexing Tunnel.vi” , why can’t we use same For loop for Indexing with Conditional.

As per your approach, If No. of signals are more, Index size will increase. Please correct me if I’m wrong.

 

Index.png

 

 

 

Small issue:

In “Basic Frame Signal Conversion Example.vi”,

I have sent specific signals to “Fame Signal Conversion.vi”. Here problem is,

  1. If I’m passing only one multiplexed signal for Data conversion (Frame to Signal), it should give only one signal values. But, here it’s giving signal values & corresponding Multiplexor values (Because you have added corresponding MUX signal to XNET Session but you have not deleted).
  2. If I’m passing Multiplexed Signal & corresponding Multiplexor, here also giving same like above.

 

I think, depends on user request, it should convert data Frame to Signal (vice versa).

 

Mux.png

Munna
0 Kudos
Message 14 of 30
(7,226 Views)

1. The Wait 0 is probably not needed, but the intent is to minimize CPU usage by allowing the processor to be interrupted to perform some other tasks.  If I have a while loop with a False wired to the stop, it will consume lots of CPU usage for no reason.  Adding a Wait 0 helps fix this.  So if a loop may have a large number of iterations I generally add a Wait 0 but it probably won't make a difference.  Here is the help.

 

Wiring a value of 0 to the milliseconds to wait input forces the current thread to yield control of the CPU.

 

2. Had this library been designed on LabVIEW 2012 and newer I'd use the conditional index, but this was made to be in 2011 and newer and 2011 didn't have that function.

 

As for you minor complaint:

 

I knew that this would be a problem, and I knew it would be a lot of work to fix it.  From your original post it seemed Frame to Signal was the main issue, and so I didn't put as much effort in the Signal to Frame conversion.  What should happen obviously is two frames should be made, one for each value of the multiplexer.  But what about the values of all the other signals in those frames?  In this case they are zero because they aren't specified, but what if a value for a static frame is specified.  Is it intended that this value be used in both frames?  I couldn't think of a good way that would satisfy all situations, so I figured if you are crating mux frames, you can do that one conversion at a time, instead of doing it all in one shot.  It could be supported, it would just take some more time.

0 Kudos
Message 15 of 30
(7,216 Views)

just wondering. is it posssible to use the 'formula node' in order to to convert the data of CAN bus to physical value in labview? thanks in advance

0 Kudos
Message 16 of 30
(6,986 Views)
Sure I guess if you want to use text like a cave man. But seriously using a formula node won't work as well depending on what you mean.
0 Kudos
Message 17 of 30
(6,973 Views)

I am having some problem with your great library, because in project I'm working on I would like to use two dbc files, because I will monitor two different devices. But when I put them together and even if I close session after operation I always have a fault. Would be great if you could take look.

 

 

asd.png

0 Kudos
Message 18 of 30
(6,710 Views)

The first issue you may see is the fact that when importing a database the name of the database is set to "temp_database".  So you can't import two databases at once, but closing one and opening another should work.  What might be a better approach is to generate a random name on the import, but then you could have an issue of many random named databases so maybe there could be a cleanup option which deletes databases, whos files don't exist anymore.

 

But these issues only exist if you try to open two sessions at once.  I see no reason why opening a database one at a time wouldn't work.  Can you give more details on what the "fault" is, when you see it, and under what conditions you see it.

0 Kudos
Message 19 of 30
(6,706 Views)

Ok it started to work after some time and debuging, seems like I didn't close the session correctly. But maybe I could set the name of the database to temp_database 1 and temp_database 2, would that work? I would really need two databases at the same time, one database all the time translates data from the battery control unit and the other sets the DC power supply unit.

0 Kudos
Message 20 of 30
(6,702 Views)