LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual

LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual
Pages 97
Views 756
Downloads : 2 times
PDF Size : 572.7 KiB

Summary of Contents

LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual

  • Chapter 2Extensions to LabVIEWLabVIEW LEGO MINDSTORMS NXT Module2-48ni.comNXTFileWriteParameters:This system call method attempts to write Length bytes of data to the file opened with the handle specified by File Handle. If you use all of the memory allocated for the specified file, the NXTFileWrite method writes partial contents of the Buffer data to the file. The method sets Length to the number of bytes actually written, but does not modify the Buffer. If you intend to write more data, you need to close this file and use NXTOpenWrite to create a new file.If the return value is zero, the file write operation succeeded. If the return value is non-zero, an error occurred attempting to write bytes from the file.Successive calls to NXTFileWrite with the same file handle write new data each time. Each write operation advances the internal file write cursor.NoteNXTFileWrite involves writing to flash memory, so this system call method is subject to the performance issues described above. Because NXTFileWrite often is called many times in quick succession to stream data to a file, the NXT firmware provides some buffering to help minimize the performance cost. This buffering means that a 4–6 ms delay might occur for every 256 bytes written.ParameterData CodeI/O DirectionDescriptionStatus CodeU16outputRefer to the 57,File Access Status 57,Codes 57, section.File HandleU8input-outputUnique handle to identify open fileBufferstringinput-outputFile data in string formatLengthU32input-outputNumber of bytes to write (in); number of bytes written (out)