LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save date and time of data that saving in array

Hello everyone

i want to save data and time of each data come from serial port in a array same time that data saving in another array.

can anyone help me?

thanks

 

0 Kudos
Message 1 of 7
(2,659 Views)

Do you know how to work with arrays?

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 7
(2,658 Views)

yes i know.

i just need to save date and time of each data save in array

 

0 Kudos
Message 3 of 7
(2,652 Views)

Then where are you stuck?  Attach a VI that shows your attempt.  You should be able to easily build your time information into the array.  If it is a timestamp, you may have to convert it to a double, assuming the rest of the array is a double.

0 Kudos
Message 4 of 7
(2,628 Views)

As you see in my VI, I collecting data that come from serial port and filter them as I want. Then for example if data was equal (5), it will record it. Now I want to see date and time for recording time that when next time value (5) come from serial port, I can see duration between first (5) and second (5).

0 Kudos
Message 5 of 7
(2,587 Views)

Let's clean up many of the problems you have with your VI first.

 

1.  Do you really want to configure the serial port every iteration of the while loop?  The Serial Configure should be before the loop.  You don't need the VISA Open at all.

2.  Bytes at Port is the wrong thing to use 99% of the time.  I'm going to assume (since the serial configure is set for a termination character) that the string coming in is some digits and a linefeed character.  Take advantage of that and set the bytes to read at VISA Read to be a larger number.

3.  Converting from an array to a cluster then unbundling is pure Rube Goldberg.  Use Index Array to get the first and second elements of the array.  (Index Array is expandable by dragging the bottom border downwards to give multiple outputs.)

4.  You have a lot of redundant code where you make numerous comparisons and drive numerous case structures.  Wire your integer to a case structure and have a separate case for each of 1, 2, 3, 4, 5,   Anything in the true case for the respective comparison will just go into the correct case.

5.  Your case structures don't do anything productive.  You are just appending Trues to then end of the array.  And the array to cluster unbundle dance mentioned earlier just yields the same 1st and 2nd true in the indicators.

6.  I see clock functions in each case, but you aren't trying to do anything with them.  It seems to me that value is what you want to store in the feedback node, and you'd take the difference in time between the current value and previous time and append that into an array.

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

 

0 Kudos
Message 6 of 7
(2,584 Views)

Thanks for your complete answer. i will work on it one by one and then let you know result.

thanks again

 

0 Kudos
Message 7 of 7
(2,564 Views)