09-29-2009 07:26 AM
Good Morn everybody
I'm thinking about bringing in the same task twice in my VI but in seperate WLoops. Potential Problems? Is this possible?
Thank you,
BLW
09-29-2009 07:28 AM
Post your code or atleast a snapshot for more help.
Mathan
09-29-2009 07:56 AM
In this snapshot you'll see I am trying to pass a feedback through the loop to my PID. I quickly learned this won't work. I've tried local variable but get some bad values (race condition?).
So, what I would like to do is have two seperate loops.... one that does graphical interface for user output and one that is used inside PID loop for feedback???
Thanks,
BLW
09-29-2009 07:58 AM - edited 09-29-2009 07:59 AM
Doing that, LabVIEW is not going to give you an error or anything like that, but you might be setting yourself up for trouble. Tasks tend to be either Read or Write tasks. So, if you are sending the same Write task to two parallel loops, you could have collisions. When reading in two places, you might read the buffer dry unknowingly. Regardless, it seems your architecture could be modified to prevent this doubling-up.
Edit: You posted while I was typing.
09-29-2009 10:18 AM
10-06-2009 10:14 AM
I tried it and got nothing. The data port of my read channel in the top while loop and the "run protocol" case structure is sending a big fat zero. Please take a look at my code and make suggestions... maybe I need to scrap and start over but I can't think of another way to write this???
Thank you,
BLW
10-06-2009 10:49 AM
You are making a common mistake for beginners. You simply cannot have more than one task for a specific hardware resource. That means that you have to combine all of those separate analog in tasks into one that uses all channels.
If you had automatic error messages turned on or if you had wired the error clusters, you would have seen the 'resource reserved' error.