LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save and write data from array to file - easy one

Solved!
Go to solution

Okey, i figrued that out and then i tried with this solution: 

But when I open my file I dont think to get any responsible data out of it.. 

Ofc I have a file path but I just removed in this pic... 
Setup2.PNG

0 Kudos
Message 11 of 17
(1,534 Views)

One thing you'll want to do is make sure that the open and close file options are outside of the while loop, since that's the benefit of low level file I/O. You may want to have a look at some of the examples in LabVIEW, if you look under help > find examples > directory structure > File IO > TDMS then you'll find a number of examples of how you can write to a TDMS file. You can also use this to explore other file types in LabVIEW.

 

Regards,

Jake A

Applications Engineer
National Instruments UK and Ireland
Message 12 of 17
(1,499 Views)

Okey, thanks i tried that now. 
The Open function can be wired proberly, but the Close function wont allow me to wire it, when I move et outside my loop. Why is that? 

I also looked at some example and think I done most of the same that they are doing, but i my case I got more loops than they do. How can I do it different?

0 Kudos
Message 13 of 17
(1,490 Views)

Addressing why Close doesn't work when you bring it out of the loop, take a look at the output tunnel carrying the File Reference from the Write to the Close.  As it goes through the edge of the loop, is it an "ordinary" tunnel (looks like a solid square) or an "indexing" tunnel (looks like a square-within-a-square)?  The latter is the usual appearance when bringing tunnels out of a For loop, and indicates that an Array is being created.  You don't want an array!  Right-click the tunnel, choose "Tunnel Mode", then choose "Last Value".  Now the File Reference should connect to the Close properly.

 

Bob Schor

Message 14 of 17
(1,472 Views)

I looked it up and it is already on Last Value under tunnel mode 😕 

This error occer: 
Error.png
I know I changed the values but didnt seem to make any different? 

0 Kudos
Message 15 of 17
(1,462 Views)

So what type is the wire comming into that tunnel?

'What is the output tunnel of the For-loop?

 

 

And do remember to wire all the cases of the case structure.

0 Kudos
Message 16 of 17
(1,454 Views)

Yes, the problem is two tunnels earlier, where you come out of the For loop with an "Indexing" tunnel, turning the Refnum into an Array, then passing the Array out through the next two tunnels and wiring it into ... a Refnum (can't connect Array of Refnum to Refnum).  Fix the first tunnel and the error should go away.

 

Bob Schor

Message 17 of 17
(1,438 Views)