LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding different types of elements into Data Array

Here is a screen shot of what I am trying to add to the end of the Analog Data Array.  I would like to add these 6 elements into the final array before the data file get written.  I would like to keep the hex data in hex, and the double precision in double precision when it writes to the file.  What functions can I use?  I have tried most of them, and can not get any of them seem to work.  I tried to use the insert into array function, and it says I can not connect different dimensions together.  Thanks for any help
0 Kudos
Message 1 of 20
(4,186 Views)
Dear TMDATA,

I will suggest you to build a cluster with the Array and the different others values using the function bundle Cluster.
Then, you are able to save this Cluster to a DataLog File.
Datalog Functions
Cluster & Variant Functions

Best regards
Nick_CH
0 Kudos
Message 2 of 20
(4,161 Views)
Can you give me a little more info.  I am not sure how to integrate the fact I have hexadecimal data that I have to write to file, along with 1D single, and 2D double data.  I have not used these functions before, and its not very clear how I could go about this.  Thanks
0 Kudos
Message 3 of 20
(4,143 Views)
An array is a set of indentical objects, differing only by their value and identified by their index.
 
You cannot e.g. mix DBL with string. Please explain what you want to do. What is the purpose of the array? How do you want to use it later? There are many possibilities, but they all seem pretty mindless (you could e.g. cast all DBLs to strings and create an array of strings, etc.).
0 Kudos
Message 4 of 20
(4,134 Views)
Ok knowing that, everything makes more sense.  I will try my best to describe what I am trying to do.  I would like one array that is DBL data.  I would like to add another array of data after the DBL array that is string data(hexadecimal).  And write all of this data to a spreadsheet.  What I am trying to do is save all the data, so I can compare the analog in data to commands and positions that are being sent and received in hexadecimal.
0 Kudos
Message 5 of 20
(4,128 Views)
A file is nothing more than a very long string. 🙂 Most likely you want your tables to be ASCII formatted strings (elements sperated by a delimiter characters and rows separeated by a newline character) so they are humanly readable.
 
Use array to spreadsheet string twice. Once for the array of strings and once for the DBLs. Select the desired delimiter and formats and just concatenate the two strings at the end before writing the string to a file.
 
(Of course of you later want to read it again into LabVIEW, you need some logic to determine where the numbers end and the hex strings begin, etc.)
0 Kudos
Message 6 of 20
(4,123 Views)
Sorry I would like to save to a tab delimited file.  Each data channel will be in its own column, one after the other.  I will use excel to pull in the data, and Labview will never need to read the file.  I had the vi setup the exact way you said, last night.  I guess the problem I am running into is the hexadecimal data I am reading from a .txt file in is not getting updated frequently enough.  In the .txt file the first column is a time increment, and the second column is the data value.  It seems to only get updated once a sec, and it should be getting updated 10 times a sec.  Does this look correct for pulling in the data off a .txt file?
0 Kudos
Message 7 of 20
(4,109 Views)
TMDATA,

It is not clear to me what you are trying to do that is going wrong.  Generally if you are having trouble with a part of your program it is helpful to isolate that piece and create a VI that uses dummy data if necessary and try to troubleshoot the part that isn't working.

What specifically is not working? Post the piece of code that is not working and what it is you want it to do.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 8 of 20
(4,086 Views)
I found part of the problem I was having.  I still am having a problem with getting the hexadecimal data into its own column.  I have attached a screen shot of the current vi, along with the tab delimited file that i pull into excel.  Any help would be greatly appreciated.  I am completly stuck.  Thanks
0 Kudos
Message 9 of 20
(4,080 Views)
please post actual code.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 10 of 20
(4,077 Views)