LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Redundant Tasks in VI?

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

0 Kudos
Message 1 of 7
(3,389 Views)

Post your code or atleast a snapshot for more help.

 

Mathan

0 Kudos
Message 2 of 7
(3,388 Views)

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 

0 Kudos
Message 3 of 7
(3,372 Views)

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.Smiley Wink

 

 

 

Message Edited by Broken Arrow on 09-29-2009 07:59 AM
Richard






Message 4 of 7
(3,369 Views)
Your proposed architecture is fairly standard. Splitting the UI from the processing is generally a desirable thing to do.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 7
(3,339 Views)

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

0 Kudos
Message 6 of 7
(3,272 Views)

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.

0 Kudos
Message 7 of 7
(3,262 Views)