LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

concatinating array outputs

hai
I am using Labview to collect data from two instruments which have different baud rates and parity , but they are collecting the data at the same frequency. Right now i am collecting data in half hourly files -two files for each instrument readings. Can anybody suggest a method of getting the two files combined to get a single file output having all the recorded variables.
thanks
Jammy
0 Kudos
Message 1 of 6
(2,974 Views)
How do you want the files to be combined? Continuously or intermittently?
0 Kudos
Message 2 of 6
(2,966 Views)
Hai
The program gives the output right now as two files (one for each instrument) as the output of two loops. so for each half hour two files are obtained. The aim is to get a single file instead of the two files as output on a continious basis.
Thanks for the reply
Jammy
0 Kudos
Message 3 of 6
(2,951 Views)
If you post your code, it would be easier to suggest what to do. I am assuming you are writing to each file in Labview. If so, then instead of writing to two files, write to the same file. You could first write the data from instrument 1, then using error in and error out as a means to control execution flow, write instrument 2 data to the same file. See attached gif.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 6
(2,940 Views)
Hai
I am posting the source code. The program outputs two files (one for each instrument)and instead of it i need to get a single file output every half an hour. The data from the LICOR and Sonic anemometer (the two instruments) (a third instrument is also included in the program which need to output as a seperate file) which are to be combined to get a new file
hope it helps
0 Kudos
Message 5 of 6
(2,932 Views)
Now this is an example of a vi that is vastly overblown in size (sorry, don't mean to be so critical, just helpful). How can you make heads or tails with a vi that is this large? First you should try to break the vi into sections that can be made into subvi's. Then call the subvi's from a main vi. It would be much more manageable. As for your problem, instead of using the generic function Write To File, use the Open/Create/Replace File function at the beginning of your code, then use the File Write function to write wherever needed, then use File Close at the end. You will have to wire the refnum output of the Open/Create/Replace File function to each File Write function and to the Close File. This way, only one file will be written. The way you have your vi structured, you may have a problem with two sections trying to write to the file at the same time. You would benefit greatly by reducing this huge vi into several subvi's. It will be much easier to maintain and read, and it will be easier to ensure that you won't have a problem with two or more sections trying to write to the same file at the same time. Using subvi's instead of one huge "do it all" vi is the proper programming technique. Do this. You will be glad you did in the long run. Your future programming projects will become much easier.
- tbob

Inventor of the WORM Global
Message 6 of 6
(2,923 Views)