LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel execution

Remember if things are happening in parallel in a given loop, the order that they execute is can be random.  The LV runtime engine will determine which is node to execute next based on which has all its inputs available and ready for execution.  If 2 nodes have their inputs ready at the same time, then it is pretty random as to which will execute first.
 
If you want to control that the thermostats execute there commands in an order, although to the human eye it would appear simultaneous but it truly isn't, then you need to set up that "gating mechanism" like I showed in this reply.  http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=305962#M305962
0 Kudos
Message 21 of 39
(1,566 Views)
Yeah I remember all of those inputs actually.... but like i had said even then it really has to be in parallel.  guess like you guys are saying it is a hardware issue... what a pain
0 Kudos
Message 22 of 39
(1,562 Views)
I am going to assume you are stuck with the hardware you are currently using.  Since you require so many reads/writes to the hardware, you need to design your software to accommodate the limitations of the hardware.  I had a similar application and I did the following since I did not need precise timing on any of the signals.  Since your DAQmx calls all seem to be single point reads and writes, it might work for you too.

Set up a loop that reads/writes values to all of the inputs/outputs you need to use periodically.  Use global or shared variables with the inputs or outputs grouped so that they can be accessed in an efficient way (parallel data should be separated, I would assume by unit).  Set this loop up to run continously independent of the rest of your program (except for start/stop or course).  Use the global or shared variables to read/write information to the DAQmx calls.  This way you are at least reading and writing data in parallel and hopefully this will work for you.

Attached is an example.  In the real application you would substitute the controls with global or shared variables.  Every DAQmx call in your code would be replaced with the appropriate global or shared variable to pass or read new values from this loop.


Message Edited by rpursley8 on 05-08-2008 01:29 PM
Randall Pursley
Download All
0 Kudos
Message 23 of 39
(1,557 Views)
Thank you. I am going to try this out and get back to you ASAP. Thanks again!
0 Kudos
Message 24 of 39
(1,542 Views)


rpursley8 wrote:
In the real application you would substitute the controls with global or shared variables.  Every DAQmx call in your code would be replaced with the appropriate global or shared variable to pass or read new values from this loop.
Could you tell me what exactly this means please?
0 Kudos
Message 25 of 39
(1,532 Views)
I didn't take the time to create global variables for my example.  Instead, I just used local variables tied to the front panel controls.  For your application you would create global variable of the same type as all off the controls.  Read the LabVIEW help on global variables to see how they are created and used.

Under the Structures category in the Functions pallete is a global variable icon.  Drag this to your block diagram and double click it.  It should open up a window for called global 1.vi or something like that.  You can place controls and indicators on this front panel.  Once they are in this front panel, you can go back to your block diagram and click the right button on the global variable and select which control it will be linked to.

Once you have set up all of your global variables, then you can start removing all of your DAQmx calls from your main code and replacing them with global variables.  For example, instead of writing a boolean to the DAQmx task Power1 you would write the boolean to the global variable named Power1 and the DAQmx loop function will continuously read that variable and write that value out to your card.

Does this answer your question?

What version of LabVIEW are you running?


Message Edited by rpursley8 on 05-08-2008 03:14 PM
Randall Pursley
0 Kudos
Message 26 of 39
(1,520 Views)
I think I have used global variables in my previous code. Do you think you could take a look? I think what you are saying makes sense. I will try it out and let you know as well. I am using LV 8.5.1.
0 Kudos
Message 27 of 39
(1,516 Views)
So, I guess when I told you the same thing in reply #15 it didn't make sense?
0 Kudos
Message 28 of 39
(1,513 Views)
Attached is the example I built up with the global variables added.  You will probably have to change the digital line definitions to whatever you are using.
Randall Pursley
0 Kudos
Message 29 of 39
(1,502 Views)


smercurio_fc wrote:
Ahh, so this has been discussed before. I have to say I didn't think to look in a 10-page post about push buttons to find out if a discussion about parallelism had been talked about. Smiley Very Happy


You'd be surprised how much stuff got covered in those 10 pages.  Actually it was a lot of back and forth as the stated requirements changed every other post.  This thread is more of the same.  In this case, parallel, but independent, but run the thermostats in sequence.  In the other thread, it seemed like the boolean logic for the hardware pushbutton kept changing.  First a true input of the digital read meant start, or run.  I posted code showing how to do that.  Then the code came back with just the opposite where the true meant stop or not run.  Revised the example to show that.  Then it switched back again.Smiley Mad  This poster seems to only read about half of what is suggested, and then only actually implements about half of those suggestions.
0 Kudos
Message 30 of 39
(1,487 Views)