LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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 Kudos
Message 1 of 15
(3,159 Views)
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 Kudos
Message 2 of 15
(3,158 Views)
I have not worked on Shared varibles can you please send a small example how to implement
0 Kudos
Message 3 of 15
(3,145 Views)

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 Kudos
Message 4 of 15
(3,125 Views)

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 Kudos
Message 5 of 15
(3,108 Views)
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 Kudos
Message 6 of 15
(3,091 Views)

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 Kudos
Message 7 of 15
(3,088 Views)

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 Kudos
Message 8 of 15
(3,071 Views)

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 Kudos
Message 9 of 15
(3,063 Views)
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 Kudos
Message 10 of 15
(3,049 Views)