> So, say I wanted to pass a status back to LabVIEW while the CIN were
> in it's loop for the purpose of drawing a status bar. Is it possible
> to do that?
>
From what I understand, you want to do is call a CIN, and in parallel,
update a status bar to show approximately when the CIN will be completed.
You have several options. If you can change the CIN to work on chunks
of the computation, then it can return periodically with a status, you
can update the panel of the VI, then dive back into the CIN. This
requires that the CIN be changed, and depending on what it is doing,
this could be very difficult, but it could be easy, so I listed it first.
Another option is to make sure that before you call the CIN, you call a
VI that will runs in parallel in another execution system and periodically
check some external data to see how the CIN is doing. The external data
can be TCP, file, or another call into a CIN/lsb. Probably the easiest
is a file. Open a tmp file and pass the path to both the CIN and the
progress subVI. Have the CIN occasionally seek to the beginning and write
out a percentage string or number. Have the subVI periodically seek and
read.
To make the subVI have a different execution system, use the VI Properties
dialog on the execution page. Assuming everything else is in the Standard
execution thread, make this on be Other2 or something like that. This will
ensure that the same thread isn't supposed to be running the CIN and in the
subVI. Since CINs aren't compiled by LV, they can't share threads the way
that VIs do.
Make sure to call the subVI first, or it won't get started until the CIN
finishes. The subVI can check the file and the sleep a few seconds. Be
sure that the LV file Open doesn't block any other access since you want
both of the pieces to have the file open at the same time. Alternately,
you could have them open, read/write, and close the file each time. Then
you can just ignore failed opens and catch it the next time.
If the status bar isn't on your subVI, try using control references to update
it, or alternately, leave this file reading in your upper level diagram, but
make the CIN call from another subVI set to another execution system.
One other thing to make sure of. If you do not mark you CIN as being reentrant,
it will run in the UI thread, and there is no chance of updating any LV panel
while the CIN is running.
Greg McKaskle