LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling time in seconds?

hi folks,
 
can someone please give me a help here with a vi i got.? i am plotting a power graph from a 25mm module, using the hameg dmm, switching between volts and current.
 
however, i need to sample exactly, every one second/. ? how can i do this? i am use the labview measurement file block, but the time intervals i get are not consistent, they vary.......?
 
 
ps: attached is my vi.
 
 
0 Kudos
Message 1 of 35
(3,880 Views)

You have delays and sequences all over the place as well as delays. The first sequence has 1 sec of delays then you measure voltage, then there is another possible delay in based on sample time (the while loop serves no purpose as you have wired it to only exicute once), then you delay for 500ms, then you delay another 1sec before the current measurement. After all of that you do some data processing and save to a file (this also takes time). Your code should only occupy 1 screen and avoid using sequence structures as they hide code and make it hard to follow.

Use a timed loop to collect data, you shouldn't need to put delays between the VISA writes.

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 35
(3,860 Views)

Here's what I was talking about. This VI has NOT been Tested, as I don't have the equipment. Give it a try you may have to play with the delay. See attached picture, I have also attached the VI saved in LV 7.1.1

Hope this points you in the right direction.

 

Message Edited by AndrewAlford on 02-14-2006 11:31 AM

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Download All
0 Kudos
Message 3 of 35
(3,861 Views)

hi there

 

the reason for all the delays (!), is that if you dont put them in the meter clicks and switches as needed, but no data is sent back to the screen, so the delays probably give the meter time to react before processing the information.

its all very messy, but it works,. but i need to sample 1 sec intervals.

will have a look at your proposal.

 

eric

 

0 Kudos
Message 4 of 35
(3,849 Views)
If you don't have the timed loop, you're going to have some problems. You say you want "exactly" 1 second intervals but "exactly" any time cannot be applied to an operating system such as windows.
0 Kudos
Message 5 of 35
(3,841 Views)
hi dennis
 
can you expain that last sentence again? if i cant get exactly 1 sec theres no point drawing blood here then?! my boss here, wants this done in 1sec intervals. but if it cant be done, i can just tell him. and i can leave it as it is.
 
at the moment i am getting variations of about 300- 500ms between some samples, i mean over a period of time.
0 Kudos
Message 6 of 35
(3,837 Views)

Andrew,

i got version 7 here and cant load your vi's sadly. why is labview like this?! grrrrrrrrr

 

 

 

 

0 Kudos
Message 7 of 35
(3,835 Views)
Windows is not a real time operating system. Neither is Linux or the Mac. All of the OS's are doing stuff in the background that you have no control over and will affect your program. LabVIEW 7.1 introduces the timed loop with a 1msec resolution. You can upgrade. You can accept some variation in time (+/- x msec). You can improve your code. I too had a hard time following your program with all of the sequence structures. Writing to a file takes a large amount of time and you might be better off writing data as binary or defering the saving of data until the end. If the instrument has the capability, you can provide an external trigger from some other piece of hardware. A pulse generator is great for something like this.
0 Kudos
Message 8 of 35
(3,829 Views)
ok, that sound fair. i can just tell him that. we dont have much more time to be using pulse generators id say at this stage/, lots of testing to do.
i am downloading a eval of labview 8 to try Andrews program
 
thanks
 
Eric
 
0 Kudos
Message 9 of 35
(3,824 Views)

hi there

 

can you go through your vi please? i have it running now, but the meter doesnt switch between volts and current, just an endless clicking noise......

how do i change the timing? also you got some blocks i dont understand, the array and the o/p and i/p nodes.

 

regards

 

eric

 

0 Kudos
Message 10 of 35
(3,806 Views)