LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do the construct for 60 different data channels

Hey, I have a txt. data file from 60 sensors, located in different position. In the file, each sensor's data is in one line with time stamp, from the first one to the 60th one, then go back to the 1st as circulation. the raw data need to be processed according to the datasheet.Those sensors are  in 3 different types. what I'm doing now is to import the data, show the sensor's name in a list, by choose the name on the list, the processed data will be plotted on the graph and logged in the background. this was succeed for signal sensor, however, I want to make it capable to choose several sensors together. for example, I push "ctrl" and choose severl sensors together, then i expect several curves will be plotted on the graph at the same time. I used an array to make a lookup table, I pick the certain number from the array and verify the different types. However,my problem is: how do I do the caculation? I dont want to make 60 case structures to do the parallel calculation. how can I acrualize this function?

 

here attached part of the data, please give me some suggestion in how to achieve my design.(this is an example of 3 sensors)

cheers!

 

Base Time,1236337167.745374519
Real Time,03/06/2009,10:59:27
Fractional Seconds,0.745374519
Index,Reading,Value,Unit,Status,RelativeTime,Channel
1,+09.95588 kOhm,9.9558753E3,Ohms 2wire,0,0,000000000,1001+
2,+054.9297 mV,5.4929651E-2,Volts DC,0,0,024938107,1002+
3,-000.0293 mV,-2.9336165E-5,Volts DC,0,0,057852983,1031+
4,+09.95669 kOhm,9.9566896E3,Ohms 2wire,0,0,110721350,1001+
5,+054.9319 mV,5.4931855E-2,Volts DC,0,0,135663986,1002+
6,-000.0301 mV,-3.0136876E-5,Volts DC,0,0,191517353,1031+
7,+10.15015 kOhm,1.0150149E4,Ohms 2wire,0,599,269007444,1001+
8,+055.1064 mV,5.5106418E-2,Volts DC,0,599,292948246,1002+
9,-000.0214 mV,-2.1421115E-5,Volts DC,0,599,325862646,1031+

 

 

cheers

0 Kudos
Message 1 of 6
(2,527 Views)
seems nobody can help~~Smiley Sad
0 Kudos
Message 2 of 6
(2,473 Views)

echomice wrote:
seems nobody can help~~Smiley Sad

 

It can seem that way sometimes.

 

This is what you can do to help us help you.

 

Post an image of your code as it stands now and describe the question (note singular) as clearly as possible. If English is not your primary language, include your Q in your native tongue.

 

Now for the "why".

 

Most of the quick replies you will get on this forum are from volunteers who know the answer to your Q. If you make it too hard for one of us to follow your Q, we (or at least I) will simply move on to the next Q.

 

Just trying to help,

 

Ben

 

PS You will see in the post that will follow this one that Norbert is having trouble following your request as well.

Message Edited by Ben on 05-19-2009 09:59 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 6
(2,465 Views)

I'am sorry but i have quite a hard time to understand your request. Now here is what i understand:

- You have a textfile containing measurements of about 60 different transducers. The file consists of entries in the way your first post shows:

Timestampinfo (three lines)

"Tableheader"

Transducer 1, sample 1

Transducer 2, sample 1

Transducer 3, sample 1

Transducer 1, sample 2

Transducer 2, sample 2

Transducer 3, sample 3

...

...

 

- You want to parse that file and create a graphical display showing the data in a graph indicator. The graph should not neccessarily display all data of all transducer at a time, but it should be selectable which "transducer will be active".

 

This breaks down to a more or less simple string parsing. First of all: do you read the file in a single, very long string or do you read it line per line, building an array containing strings (lines)?

If you have an array of lines, you can sort the lines to match the transducer's IDs. After this, you can extract the values you are interested in for the graphical display.....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(2,464 Views)

sorry for my bad explanation and thanks for the reply.

 

here is my situation again:

I read the file line by line, but the size of file is not a constant. it can be 1000 lines, also can be 1000000lines, depends on the experiment time. on the front panel in the plot chat, I should present the original data from each channel, but processed. for example, data in channel 1 is from the temp. sensor, I shouldnt just show the voltage, I need to plot the temperature value .this needs a formula to do convert in the back.

 

the whole procedure should go through like this:

1:there's a list on the front panel, operator chooses the interesting channels; then click ok or add those channels into another list

2:read the txt. file, at once, the channles' data (those were chosen in step 1) are plotting, show the processed data (temperature, pressure, resistance,and so on)

3:the plot and processed data should be logged in the back.

 

my  question is here:

for 60 channels,there are different convert formula for differenent type of sensor.By clicking and adding a new channel, there's supposed to be a formula for it. how do I do the constructure? should I design 60 cases in my programs?meanwhile ,it is also possible of function changes. that means, for example, channel1 was connected with a pressure sensor, but now it's connected with atemperature sensor, how do I do to make my program be flexible?

 

Thanks very much!

 

0 Kudos
Message 5 of 6
(2,438 Views)

If you read the file line per line, you can distribute the entries regarding their channel into a 2D string array. One dimension are the channels, the second dimension represents the samples per channel. After this, you can parse each string in the array in order to retrieve the numeric measurement value and to scale that.

Please note that this process takes a lot of if(in regard to programming tasks) and will easily eat up your memory possibly leading to "out of memory" errors very soon.

Another approach would be log the data in technical data management format which evolved to TDMS. This is a file format developed for such tasks and handling will be a lot easier....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 6
(2,428 Views)