LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa write stops working during loop

I'm working on a small VI (seen in attached picture) which is to be part of a larger program.  I am trying to write an array of data to the serial port until all the points in the given array are completed using a for loop.  Everything seems to work fine until about the 25th or so iteration, which is when the screenshot was taken.  While single stepping, the loop freezes at the VISA Write block indefinitely.  I'm not sure what the hangup is as I've used this VI to write other data sets with no problems as well as the first 25 points of this data set.  Any help is appreciated.

 

Thanks

0 Kudos
Message 1 of 6
(3,092 Views)
I can see several problems. It looks like you are repeatedly calling the VISA Configure Serial Port. You have an auto-indexed for loop and you also have the n terminal wired.
0 Kudos
Message 2 of 6
(3,075 Views)

Can you explain how the configure serial port is repeatedly being called?  Since it is outside the for loop, shouldn't it only be opened once?

 

As far as auto indexing, I was unaware the array into the for loop automatically did that, thanks.  Is there any actual problem with wiring the N terminal as well? Other than being redundant?  I've done this in other loops and never came across a problem.

0 Kudos
Message 3 of 6
(3,066 Views)
You attached an incomplete image. The configure is inside some sort of structure. Unless you attach a VI or snippet, it's impossible to say what the structure is.

In this case, wiring both would have no affect. You can have problems when wiring a constant to the n terminal because the for loop will iterate for the smallest value - the array size or n and may give unexpected results.
0 Kudos
Message 4 of 6
(3,051 Views)

I've attached the vi for your further reference.

 

Thank you for the help so far.

0 Kudos
Message 5 of 6
(3,040 Views)

I haven't solved the or determined the acual problem but I have found a way around it.  Seperating it into two loops, each completing half the data set, seems to work.  Still unsure as to why the single loop stopped working after about 25 iterations.

0 Kudos
Message 6 of 6
(3,007 Views)