LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Issue Using Type Cast

Solved!
Go to solution

Hi,

 

I would like to ask for your help regarding the issue on time output using type cast.

See attached VI for the simulation of the issue:

  • I used numeric inputs/outputs with absolute time display format for time.
  • Dummy input/output is just there for me to simulate what I used on the actual program (build array and index array).
  • Type cast is used to convert numeric array to text that can be an input for the written to text file and to return it to array when reading the text file.
  • DESIRED OUTPUT: input and output side must have the same values for time and dummy, respectively. Program works fine until time input 06:13:19 AM
    01/19/2019
  • ISSUE: Program does not output the same as input starting 06:13:20 AM
    01/19/2019

You may vary the time input to see the issue. I need to know why this happens and what work-around can be done since most of our source code uses array-type cast combinations.

 

Thanks and Best Regards..

0 Kudos
Message 1 of 4
(2,276 Views)
Solution
Accepted by topic author CHL

The problem is you are using write to text file for what is really binary data.  But because you have the option Convert EOL checked, it takes any byte that is 0D and converts it to 0A (carriage return to linefeed.)

 

Right click on both the Read and Write functions and uncheck "Convert EOL".  Then it will work fine.  But really it would make sense to use Read and Write Binary file.

Message 2 of 4
(2,254 Views)

Thank you very much for this very useful information. I'll definitely use this moving forward.

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

@mem_on wrote:

Thank you very much for this very useful information. I'll definitely use this moving forward.


Then please accept that reply as solution (and give it a kudo).

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