02-16-2012 10:08 PM
02-16-2012 10:13 PM
The main apx file has the control
this sub vi manipulates the data.
More sub vi s will manipulate the control as they will be added but right now This is my application. This wont run without the apx drivers sorry....
02-16-2012 10:14 PM
and the functional global
02-16-2012 10:29 PM
I think I am trying to simultaneously read and write into the same control that is the problem.
The sub vi should start only if start is true. there are many loops inside the sub vi each has its own exit condition. If any loop reaches its condition
it stops and should turn the start off as well. same goes vice a versa. if start goes off (through user action) then all the loops should stop as well.
02-16-2012 11:08 PM
I am not able to correct it ... pls help..
02-17-2012 01:55 AM
In the sub-vi you use the AE unnecessarily to handle the stop condition. Since you write and decide a value in the inner loop, pass that value out to the loop stop condition. Right now you check if loop should stop, probably, long before you've executed the inner loop. Run the program in Highlight mode and Retain wire values and i'm sure you'll see what's happening.
/Y
02-17-2012 03:37 AM
I will wire the data out in the innermost loops.
but the main prob i am facing - when i change the value of start to false while the vi is running(user action), the data is not entering the AE, I dont understand why..
same thing vice a versa too, when the inner loop (inside subvi) programmetically sends the data it is updated in all loops except the start control...
02-17-2012 04:21 AM
It is obvious that when you start the sub VI it will struck into the while loop inside the sub VI and it will not take the command from the start anymore. One thing you can do is place another while loop parallel to the sub VI and have a control seperately and the LV2G inside it then when you update it it will take it but still this is not the right way of programming. Read the LabVIEW coding guidelines and do the coding accordingly. It would be worthy to read this and this
02-17-2012 05:19 AM
P Anand :
It is obvious that when you start the sub VI it will struck into the while loop inside the sub VI and it will not take the command from the start anymore. One thing you can do is place another while loop parallel to the sub VI and have a control seperately and the LV2G inside it then when you update it it will take it but still this is not the right way of programming. Read the LabVIEW coding guidelines and do the coding accordingly.
Yes I know that is the mistake I am doing but I am not sure how to solve. I read your links. I think a filter event or a qeued state can be used. But I am just a beginner and I am not really sure which to apply and how.
I tried using an event structure which checks for command from start but in case the vi is stopped programmetically instead of the user interaction it goes into an infinite state.
02-17-2012 07:15 AM
In your main vi you have no structure to read/update/handle the Start-button, so it's only handled at program start.
A simple solution could be to add a small while-loop with a 100ms wait that reads the start button and sends it to the AE and/or the opposite.
/Y