LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combination of two data streams

Spoiler
 

I got two attached programs to read sensors. For the Continuous.vi file, it is used as a converter to convert the Arduino data into Labview. The data sheet of the sensor read in this file is http://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=86BSD&DocType=DS&Doc.... And for the displacement.vi file, it is used to read the data of the displacement sensor(https://www.sick.com/us/en/distance-sensors/displacement-measurement-sensors/od-value/od2-p30w04i0/p...) in Labview. My concern for now is to combine the two data streams into one .vi file, which means that I could get the readings of both sensors meanwhile. Please help this out. I appreciate it so much.

0 Kudos
Message 1 of 4
(2,526 Views)

Without seeing your code (I don't have 2017 installed, it has Fatal Flaws for my work) I have a few questions:

  • You've got two independent data streams that you want to combine in a single data file.  Are the streams "hardware-synchronized" in some way, i.e. if you acquire data for 1 second from both instruments, will you have exactly the same number of points from each?
  • If the answer to the previous question was "Yes", you could simply make a 2D array (Channel 1 and Channel 2) and save that.  If the answer is "No", you can make a Cluster (Channel 1 and Channel 2) which would hold different sized arrays (but that's not a problem).  You could also use the Cluster method if the arrays were identical in size (he said belatedly).

Bob Schor

0 Kudos
Message 2 of 4
(2,471 Views)

Hi,

 One .vi file is to convert the data reading in arduino into Labview and the second .vi file is built in Labview to collect the data. I am new to Labview so I could not understand clearly what you said. Could you please show me an example to build the file? Thank you

 

 

0 Kudos
Message 3 of 4
(2,451 Views)

On the first page of the LabVIEW Forums, you'll see this:

LabVIEW Training Resources.png

Click on the first Link, and review the first 5-6 lessons (actually, you should review all of them, it won't take much time).  All of the (elementary) concepts I discussed are presented here, and you should try them for yourself and write some very simple code to create simple arrays, combine two 1D arrays into a 2D array, see what happens if you take a 5-element array and combine it with a 10-element array to make a 2D array, create a cluster, create a cluster of two 1D arrays, etc.

 

Once you've mastered that, write a little routine to simulate what you are trying to do.  Using a While or For loop, with a Random number generator inside (to generate Fake Data) and a Wait (ms) function (to simulate sampling at, say, 100 Hz), build a 2-independent-DAQ system and try saving the two independent streams of data.  First save into an indicator (so you can quickly see if you are getting what you want), and when that works, try writing it to disk.

 

Start small, do simple things, test, debug, fix, add some more, test, debug, fix, and before you know it, you've got a fully-working, understandable (to you, at least) complete project.  And you Did It Yourself!

 

Bob Schor

0 Kudos
Message 4 of 4
(2,436 Views)