Search the Community
Showing results for tags 'c to labview'.
Hi, I’m looking to recreate this line of C code in a similar manner in LabVIEW. Any contributions are greatly appreciated, thanks. sscanf(aline, "%d%*1c%1c%1c%*1c%2c%*1c%f%f%d%f%f%*1c%5c%*1c%3c%*1c%5c%*1c%5c", &ic,c1,c2,comm,&axial,&radial,&angular,&efbhs, &holdinch,rext,amppercent,testcode,iac) below are three sample data strings that this function can read: 626 8.45 2.03 226 0.04 0.00 2 13.01 626 627 C 8.47 1.30 293 0.10 0.00 1.00 27 0 628 C 8.48 1.32 296 0.12 0.00 2.00 28 13.01 1 As you can see, in some cases some fields are missing (but still valid). In C this is straight forward to read but in labVIEW I can't seem to account for the cases where the data is not present. My current work around requires ignoring the errors the labVIEW 'scan string' function is throwing but there must be a valid way to do this in labVIEW! Usefull Info: - Fixed number of fields. - Data Not delimited. - Data generated from another program so I can't add delimiters. - The characters (%c) are being read as strings in my current labVIEW implementation.