LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from a file

I have written data to a file and I want to read it back to compare but I can't seem to get the correct data type match.
0 Kudos
Message 1 of 11
(3,823 Views)
Okay...

The first thing to mention is that you are not writing anything to the file. You need to give a filename (and path) at you Open File vi. Or set function to 1: Open or Create file.

The other thing is that you need to convert the decimal string (the format the timestamp was stored) to a decimal value. This is done by using the "Decimal String to Number" vi inside the Functions Palette under the String functions (string / number conversion).

The last step you may want to do is to display both start and end time in normal hours a minutes.

Attached is your modified code.

Have fun and continue experimenting... 🐵

-cheers-

JLV
0 Kudos
Message 2 of 11
(3,823 Views)
In sequence panel 2, use Function -> String -> String/Number Conversion -> Fract/Exp String To Number instead of String To Byte Array and Convert To Double. Converting Byte Array output to double creates an array of doubles. Date/Time output converted to double is not an array. Cannot subtract an array of doubles from a non-array double. Causes type mismatch.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 11
(3,823 Views)
Hi,

I am including a Vi which writes the time stamping into a file at D:\a.txt, then as per the option pressed from the front panel menu, compares the time.

Hope this works. Your feedbacks are welcome.

Best Regards,
Nirmal Sharma
India
0 Kudos
Message 4 of 11
(3,823 Views)
Could you please save your example program in LabView revision 6 since we have not upgraded yet.
0 Kudos
Message 5 of 11
(3,823 Views)
Could you please save your respone in LabView revision 6 since we have not upgraded yet.
0 Kudos
Message 6 of 11
(3,823 Views)
Could you please save your response in LabView version 6 since we have not upgraded yet.
0 Kudos
Message 7 of 11
(3,823 Views)
Here is something in v6.0 that addresses points brought up by others above.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 8 of 11
(3,823 Views)
Hi Ray,

Wish you a Happy new year,

I have attached the same vi in lv 6.0 version.

Pl. write incase of any problems.

Regards,
Nirmal
0 Kudos
Message 9 of 11
(3,823 Views)
Donald,
Thanks for the help but there is one thing I don't understand about the program. Why is there two displays (one in seconds and one in the date time) when a dbl front panel display is connected to the same wire?
0 Kudos
Message 10 of 11
(3,823 Views)