07-16-2013 04:47 AM - edited 07-16-2013 04:55 AM
Hi Folks,
I need a suggestion about how to get DATA continously and trigger another events simultaneously .
Here is my vi snippet with continously monitoring the motor value and direction but wanna trigger and change it movement in rel and abs.
I also have two hall sensors as end switch called in events.
Can you help me ??
07-16-2013 05:03 AM
Hello Maveen,
I would advise you to use a produce/consumer template, with:
- an event structure inside a while loop: FP commands to trigger the change will be there
- the main while loop: VISA instructions will be sent there to your motor, to change the motor motion
- a secondary while loop: read data from sensors and make some computation to display motor value and direction
That's only my idea, but someone more experienced may tell you better.
Good luck.
Florian
07-16-2013 06:20 AM
The attached picture tells nothing about, what you've done in your code or what design pattern are you using now...!!
flongnos said correctly, some design pattern based out of 'Parallel Loops' is needed, when you have two or more processes that need to run simultaneously and continuously (may be at different rate).
You should check:
07-16-2013 07:41 AM
There is absolutely nothing wrong with having multiple loops in a VI. Things that need to run in parallel should be in separate loops. Study the Producer/Consumer architecture. You can communicate between loops using Queues, Notifiers, or User Events.