キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Continous CAN data

I am getting continously data from CAN bus on that i have to some analysis which takes time, in this course i am losing data, what can i do so that i should loose any data
0 件の賞賛
メッセージ1/15
4,898件の閲覧回数
Hi,
you should implement 2 while loops ; one for getins datas of your CAN, and the second for analysing the datas.
A shared buffer will do the link between both while loops.
Best regards,
Vincent
V-F
0 件の賞賛
メッセージ2/15
4,897件の閲覧回数
I have not worked on Shared varibles can you please send a small example how to implement
0 件の賞賛
メッセージ3/15
4,884件の閲覧回数

Hi,
in structures, you can find shared variable, or global variable.
I attached a scrrenshot of an idea to implement your program. I don't know what you want exactly to do, but it is just an idea, and you will have to improve this solution by putting for exemple semaphore (model of the token).

 



Hope it helps you.
Best regards,
Vincent

Message Edité par ramses64 le 02-25-2009 12:04 PM
V-F
0 件の賞賛
メッセージ4/15
4,864件の閲覧回数

1. i got ur point but when i drag shared variable to block it is showing question mark, no option on doble clicking and right click.

 

2. In my application in every CAN read i get  8 elements of string array and it is running continously ,will be dumping in this array.  So as you told i have to take a separate while and delete 8 elements everytime and do process, Pl let me know my understanding is correct.

 

 

0 件の賞賛
メッセージ5/15
4,847件の閲覧回数
Hey Srinivas,

You need to have an indicator put on your block diagram, only then you would be able to select your indicator by clicking on the variable and selecting it. Else you will not be able to do.
That's the reason why you are seeing a question mark.

Regards,
Pavan
0 件の賞賛
メッセージ6/15
4,830件の閲覧回数

ramses64 wrote:

Hi,
in structures, you can find shared variable, or global variable.
I attached a scrrenshot of an idea to implement your program. I don't know what you want exactly to do, but it is just an idea, and you will have to improve this solution by putting for exemple semaphore (model of the token).

 


 


This is NOT a good example of how to transfer data between loops.  It will lose data, or potentially work on the same data twice because of race conditions of the local variable.

 

Look under File / New....   for producer/consumer architecture.  You will want to use a queue to transfer data between loops.

0 件の賞賛
メッセージ7/15
4,827件の閲覧回数

i will be queuing  CAN data in queue in one loop and for calculation in other loop i will be dequeue. Is this method effective as in my case i have to make sure that i will not loose any data.

0 件の賞賛
メッセージ8/15
4,810件の閲覧回数

srinivas wrote:

i will be queuing  CAN data in queue in one loop and for calculation in other loop i will be dequeue. Is this method effective as in my case i have to make sure that i will not loose any data.


 

Yes.  With a queue, you won't lose data.  Look at the producer/consumer architecture as a template for the queue setup.
Message Edited by Ravens Fan on 02-26-2009 09:05 PM
0 件の賞賛
メッセージ9/15
4,802件の閲覧回数
I able to enqueue the data and dequeue data everythink works fine , but  when i try to stop my application everythink freezes, i dont know what is happening , to come out of that i have to do Ctrl Alt Delete.
0 件の賞賛
メッセージ10/15
4,788件の閲覧回数