09-05-2006 01:26 PM
09-05-2006 02:55 PM - edited 09-05-2006 02:55 PM
The value passed to viWrite() and from viRead() is simply a data buffer of bytes. If you pass in a string value you will output the data as a string. If you pass binary data in the buffer, you will output binary values.
viWrite (handle, "123", 3, &count); will output the equivalent ascii values of the string 0x31, 0x32, 0x33
Data[3]={0x01,0x02,0x03}
viWrite (handle, Data, 3, &count); will output the raw binary data values for 0x01, 0x02, 0x03
CVI or C does not need to use the kind of conversion routines you see in the Labview examples, but if you need to do numeric to string conversions there are the Fmt() and Scan() functions in the CVI library which are very powerfull and flexible and also the standard C functions like sprintf(), scan(), atoi() etc.
Message Edited by mvr on 09-05-2006 02:59 PM
09-05-2006 04:13 PM
09-06-2006 08:46 AM - edited 09-06-2006 08:46 AM
Message Edited by mvr on 09-06-2006 08:48 AM