LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.dll and status bar

I created a .dll file to download data to flash memory. I could have used labview, but the software I programmed uses mostly link list and I am not sure how labview does it.  Anyway, the thing is the amount of data to download is kind of big and might take a while to completely download. I want to create a status bar in labview to let me know if the download is still going on or if it stopped for some reason. Is it possible? Right now, I have no way of knowing whether or not it has stop downloading.

Message Edited by Newguy100 on 08-23-2005 09:34 AM

0 Kudos
Message 1 of 22
(3,950 Views)
That should not be too difficult.
 
In your DLL create an exported function that will return a number (0-100) of the percent completed.  In LabVIEW use a Call Library Function node and call the exported function which will determine how much still needs to be done, convert this to a number, and return it back to LabVIEW.  Then in LabVIEW just create an indicator for display.  Place in a while loop with a wait in it.  No need to constantly check as fast as you can.  Perhaps 50 or 100 ms.
0 Kudos
Message 2 of 22
(3,932 Views)
Is it possible to create a link list in labview? If it is, I don't have to use a .dll file. I haven't seen any examples on it though.
0 Kudos
Message 3 of 22
(3,930 Views)
Is there a way I could make both call library node run at the same time? I already put both into a while loop and it doesn't work. (See attachment)

Message Edited by Newguy100 on 08-23-2005 10:23 AM

0 Kudos
Message 4 of 22
(3,922 Views)
No, LabVIEW doesnt have pointers so no linked lists.  Of course LabVIEW doesnt really need them.  In LabVIEW this would be an array of strings.
 
For your case since the DLLs already built and working I think it would be easier to keep what you have and just link LabVIEW to it for the interface.
0 Kudos
Message 5 of 22
(3,920 Views)
Remove the while loop.  It serves no purpose.
With no dependancy between the code above it it will natuarally run in parallel.
0 Kudos
Message 6 of 22
(3,911 Views)

The thing is is that the second call library node is dependent on the first one. I create a function called counter that basically counts while its in a wait state. I put this function in the download function so while it is downloading, i am incrementing the counter.

Ex. Download(){

..............

counter();

}

0 Kudos
Message 7 of 22
(3,901 Views)
I modified the code in C so that one of functions in my .dll file increments a global variable and I have a separate function returning that global variable. It outputs once in labview, usually at the at the end. I want it to run simultaneously. Can anyone help me?
0 Kudos
Message 8 of 22
(3,893 Views)
Hmm, sounds like a fine design to me.  So you have download() and, within this counter().
I would set it up like this:
 

global variable counter;
 
readcounter() {return counter}
 
download() {
counter = 0;
...
updatecounter();
...
}

 
Now all you do is call download once at the beginning.
Set up a seperate loop (much as your first picture) and call readcounter multiple times until its done.  How do you know when to stop?  There are several ways to do this.  Perhaps you can have yet another function call which returns a 0 when completed and pass this to the while loop terminal.  Or perhaps download function can write to counter variable a 0 when its exiting so next call to readcounter will exit the loop... how this happens is completely up to you.
0 Kudos
Message 9 of 22
(3,891 Views)
I changed it so its like:
 
Load(){
 
count = 0;
 
while(){
......
count = count +1;
} // end while
} //end Load
 
Status(){
return count;
}
0 Kudos
Message 10 of 22
(3,888 Views)