LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling time increased when arrray loop added.?

hi folks,
 
dont know if anyone saw my other post earlier, but once i put in a for loop into my vi, to send mean power to a excel file, the timer interval increased alot. from 2/3 seconds to 10+ seconds. ? how can i reduce this time?
 
thanks!
 
EMcN
0 Kudos
Message 1 of 17
(3,255 Views)

Need some help here.  Can you post your code.  I am willing to look at it because sounds like something is not right. 

 

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 17
(3,229 Views)
The code is in this post. I think the fundamantal problem is that the write function is inside the loop so he's taking a hit due to the file I/O. The write function should be outside the loop.
0 Kudos
Message 3 of 17
(3,222 Views)

i tried placing the write outside the loop, but it didnt work at all, i mean no data was written.? what can i do here?

 

regards

 

Eric

 

0 Kudos
Message 4 of 17
(3,213 Views)

Eric,

You code could use some comments and you may want to consult the LabVIEW Style Guide for hints on cleaning it up.  I don't think the file write has anything to do with the issue.  I do think it is caused by a serial timeout that it is not finding the termination character.  Since you have no error display you are not seeing it.  Are you initializing the instrument inside of the loop?

Try:

Set serial timeout to 20 seconds and see if it runs even slower

Enable Highlight Execution mode and watch your code run

Let me know what you find,

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 5 of 17
(3,211 Views)

it works perfectly, i know its a bit messy. but when i move the write blocks outside the loop, the vi works as per usual ,but no data actually gets written.

how do you set the serial time out?

 

regards

Eric

0 Kudos
Message 6 of 17
(3,206 Views)
When you moved the write blocks outside the while loop did you enable indexing on the tunnel that gets created at the border of the while loop? If you don't you'll get at best the last data point. See attached update.

As for the serial timeout, that's set with a VISA Property node.
0 Kudos
Message 7 of 17
(3,198 Views)
Timeout is set in the very fist block before starting the while loop.
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 8 of 17
(3,194 Views)
thanks guys, i will do these changes now and let you know i get on!
 
all the best
 
Eric
0 Kudos
Message 9 of 17
(3,186 Views)

ok lads,

 

i changed the timeout, but it didnt make much of a difference, however the value of N in the for loop did, i put this down to 200, will this effect my results been sent to excel?

im still not getting any data sent out though, i put on indexing, on the for loop and the while loop.

 

whats going on, why doesnt the data send out? do i need to assign the measurement block with more signals...?

 

regards

 

0 Kudos
Message 10 of 17
(3,174 Views)