02-25-2009 09:13 AM
02-25-2009 09:19 AM
02-25-2009 10:09 AM
02-25-2009 12:03 PM - edited 02-25-2009 12:04 PM
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
02-25-2009 01:31 PM
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.
02-25-2009 10:32 PM
02-25-2009 10:47 PM
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.
02-26-2009 03:33 PM
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.
02-26-2009 08:05 PM - edited 02-26-2009 08:05 PM
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.
02-27-2009 01:02 PM