LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie needs help !

Thank god ive found a discussion group, I really need someone's help -
labview is pretty hard.
I've been designing quite a complex website for the company I work for, but
now myself and a colleague have started to trial labview, to incorporate
datalogging and report generating into the site. So far we've had a few
problems getting the supplied hardware to work, it seems that as its not
made by NI - it communicates through a VI that was made the hardware
manufacturers. We've got that setup and so far have successfully logged data
from 2 (temperature) probes, which is then saved to a pretty basic text
file. So here's my questions (oh, if anything comes across as being really
stupid, please forgive me - ive been playing with this program for only
about 4 weeks on and of, coupled with the fact that I only left high school
less than a year ago 🙂 ).
Anyway, the mechanics of the datalogging part is wrapped up in a while loop,
which is set to 600000ms (capture every 10mins) - which is working fine,
though once the VI is stopped the save to file prompt also takes 10 minutes
to appear. Obviously its getting caught up in the while loop. But according
to the diagram, the writefile vi is put outside the while loop, so I cant
understand how to get the writefile to be run straight after the VI is
stopped.
Also, how difficult is it to get the date/time stamp each individual "log"
in the text file. e.g.:
At the moment we have a text file that would display :

13.45
15.67
22.98
24.76
31.65
etc.

but how could we get the current date and time put alongside it like :

13.45 24/06/2001 14:00
15.67 24/06/2001 14:10
22.98 24/06/2001 14:20
etc.

To anyone who's been using labview for a while these questions probably
sound easy, and are even probably written in black and white in the manual.
But I only get to "play" with labview for an hour every other day, and
labviews knowledgebase is tooo big !
I hope someone can help me out with this, and I understand that its
difficult to fix something unless you have it right in front of you. Though
i don't have the VI with me now, anyone who would be kind enough to offer me
some help - I can happily email them the VI or something.
Please help !

Thanks,

Adam.
cronin@poo.co.uk
0 Kudos
Message 1 of 3
(2,890 Views)
Here's an example of what you try to do. It is just one way to resolve this.

The idea is to have a loop that is running faster and to check when it is time to make the acquisition. This will avoid to wait for the function to stop after pressing the Stop button.

It is very easy to format the actual date/time to a string by using the Format Date/Time String function. Have a look at its help for more information.

Because you didn't mention your LV version, I converted the example back to LV5.
Message 2 of 3
(2,890 Views)
Adam,

If I am understanding your first problem correctly, you are in a 10 minute
loop, hit a stop button and want to exit the loop without waiting for the
completion of the 10 minute time. That you should be able to do by using
logic to OR the 10 minute timeout logic with the stop button logic. When
either of the events occur (10 minute timeout or stop button) then exit the
10 minute loop. If your stop button is required in another part of your
block diagram as well, use a local variable (right click on the variable,
"create -> local variable") to get a copy.

The addition of the timestamp is easy. On the block diagram, use
"Functions -> Time & Dialog -> Get Date/Time String" to get the current date
and time strings. Concatinate your data with the date string and the time
string and save the result to your file.

Write back if this isn't clear or if I have misunderstood your questions.

Hope this helps.

Jim


Adam Cronin wrote in message
news:9h5kpi$3nu$1@uranium.btinternet.com...
> Thank god ive found a discussion group, I really need someone's help -
> labview is pretty hard.
> I've been designing quite a complex website for the company I work for,
but
> now myself and a colleague have started to trial labview, to incorporate
> datalogging and report generating into the site. So far we've had a few
> problems getting the supplied hardware to work, it seems that as its not
> made by NI - it communicates through a VI that was made the hardware
> manufacturers. We've got that setup and so far have successfully logged
data
> from 2 (temperature) probes, which is then saved to a pretty basic text
> file. So here's my questions (oh, if anything comes across as being really
> stupid, please forgive me - ive been playing with this program for only
> about 4 weeks on and of, coupled with the fact that I only left high
school
> less than a year ago 🙂 ).
> Anyway, the mechanics of the datalogging part is wrapped up in a while
loop,
> which is set to 600000ms (capture every 10mins) - which is working fine,
> though once the VI is stopped the save to file prompt also takes 10
minutes
> to appear. Obviously its getting caught up in the while loop. But
according
> to the diagram, the writefile vi is put outside the while loop, so I cant
> understand how to get the writefile to be run straight after the VI is
> stopped.
> Also, how difficult is it to get the date/time stamp each individual "log"
> in the text file. e.g.:
> At the moment we have a text file that would display :
>
> 13.45
> 15.67
> 22.98
> 24.76
> 31.65
> etc.
>
> but how could we get the current date and time put alongside it like :
>
> 13.45 24/06/2001 14:00
> 15.67 24/06/2001 14:10
> 22.98 24/06/2001 14:20
> etc.
>
> To anyone who's been using labview for a while these questions probably
> sound easy, and are even probably written in black and white in the
manual.
> But I only get to "play" with labview for an hour every other day, and
> labviews knowledgebase is tooo big !
> I hope someone can help me out with this, and I understand that its
> difficult to fix something unless you have it right in front of you.
Though
> i don't have the VI with me now, anyone who would be kind enough to offer
me
> some help - I can happily email them the VI or something.
> Please help !
>
> Thanks,
>
> Adam.
> cronin@poo.co.uk
>
>
>
>
0 Kudos
Message 3 of 3
(2,890 Views)