LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read files, written function API WriteFile

I try to read through the files created by function API WriteFile. In files the array of numbers 0, 1, 2, 18,-345 is written down. Reading occurs incorrectly. Help, please.
0 Kudos
Message 1 of 13
(3,050 Views)
Hi,
What type of behavior are you expecting and what type of behavior are you getting.  Let me know what you project is trying to acomplish.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 2 of 13
(3,027 Views)
In my example I try read float, double, short, long, long long. In my file readfile.zip are files this types and my vi.
Thanks for the help!
 
0 Kudos
Message 3 of 13
(3,015 Views)
Try setting the byte order input of the Read Binary File to little endian. The default for LabVIEW has always been big endian. Because of the labels, I'm guessing that the program that created the files was a C++ program on windows and the default for that is little endian.
Message 4 of 13
(2,966 Views)
I make for int, long and short, and could not for float, double and long long. Help, please.
0 Kudos
Message 5 of 13
(2,953 Views)

I didn't notice that you were using such an old version of LabVIEW. With newer versions, you just set the endian order with the read function and its done. Here's are to convert to SGL and DBL. I'm not sure about the EXT. Do a search of the forum for 'endian' and see what you can come up with.

You also need to fix the file close where you are reading the SGL.

Message 6 of 13
(2,948 Views)
Thanks for help! Unfortunately, In LabView 6 there are no all functions for realization of your decision. I have decided to solve a problem by means of DLL. However function readdata in DLL does not work, though other test function (summa) works in my DLL  normally. Help please, to understand with DLL. Would like to receive also more information on the methods of debugging DLL caused from LabView.
0 Kudos
Message 7 of 13
(2,915 Views)
I believe all of those functions in the image exist in 6.0. The file read and close have different icons, that's all. the other functions are the Type Cast (Advanced>Data Manipulation palette), Initialize Array, and Reverse 1D Array (both on Array palette).
0 Kudos
Message 8 of 13
(2,911 Views)
I use Type Cast , Initialize Array, and Reverse 1D Array, but Labview given error. See, please, my example 2.
It would be desirable to understand also with mine DLL, in the future to create correct DLL skill can be necessary for work with LabView for me.

0 Kudos
Message 9 of 13
(2,898 Views)
You wired up the second type cast functions incorrectly. The integer array should be wired to the x input and the numeric (SGL or DBL) should be wired to the type input.
0 Kudos
Message 10 of 13
(2,895 Views)