12-25-2005 07:15 PM
12-27-2005 02:48 PM
12-27-2005 03:31 PM
12-27-2005 07:35 PM
Your routine that writes the data to the file and reads the data from the file should contain an uninitialized shift register in a while loop (like a "LV2 global vi") that carries all the data in the file.
When you tell the routine to write to the file, it updates the file and the data in the shift register.
When you tell the routine to read from the file it only reads from the file and updates the shift register if it is the first time that it has been called, otherwise it does not read from the file and instead just returns the data contained in the shift register (since it exactly matches what is in the file).
12-27-2005 09:57 PM
12-28-2005 03:18 PM
01-04-2006 07:48 AM
Andy
I've coded some VIs using your idea. I've hit anothe roadblock. I have a VI which has read all the values from the binary file. Now to use them throughout the project I've gotta use global or shared variables or pass them as variables into subVIs. I am not very comfortable passing them as variables to subVIs. I was thinking that inside each subVI I can read the binary file. Would that be fastest or what would you recommend ?
01-04-2006 08:28 AM
01-05-2006 09:17 AM
01-06-2006
08:23 AM
- last edited on
10-19-2025
01:47 PM
by
Content Cleaner
The real answer to this problem is to use reference objects - objects you can get to anywhere that contain arbitrary data that can be easily modified. I can recommend two - LV2 globals and single element queues. Both are discussed, with code samples, in this thread. I have also attached a short and amusing tutorial on large program development which addresses many of the issues you are seeing (LV 7.1 and 7.0 formats).
For complex configuration files, you can't beat one of the free generic hierarchical file systems. I usually use HDF5, but there are others. You can find a LabVIEW API for an older version of HDF5 here. Note that the learning curve is fairly steep and the VIs are not multi-thread safe, so don't try to use them in two places at once. If you do, you will get errors at best and corrupt your file at worst.
Let us know if you have any more problems. ![]()