Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

rs-232 communication

It takes our time so much.
I could not give the correct format string into “scan from string”. I tried all possibilities for correct format string in the LV Help pages. The substring gives what I want to see, but the “output1” just reads the integer no with decimals. And same for time string too. It comes out with first two digit and “:”.
0 Kudos
Message 21 of 29
(2,070 Views)
The only problem with output 1 is that you have the format & precision set to floating point. right click on the indicator and change it to scientific. I gave you the wrong format string for the Format into String. It should be %e to format a scientific number to a string. I also failed to set the format string in the Write Strings to Spreadsheet. It should be %s. Sorry.
0 Kudos
Message 22 of 29
(2,059 Views)
problem is not these it is from the scan from the string. What do you think about its string? output comes with +a,aaaaaaE-aa. on the otherhand the substring comes with +a.aaaaaaE-aa. It reads only one value.
0 Kudos
Message 23 of 29
(2,056 Views)
I don't know what you mean. Using the values you have on the front panel, with substring = "+7.675133E-11", I get a numeric output of 7.675133E-11 even with the totally unnecessary format specifier of %d. There is only one value because there's only one value returned in the read buffer.
0 Kudos
Message 24 of 29
(2,051 Views)
In the output I cannot read the digits after "dot". Scan from the string shows just the value before the "dot". I think it just read it. Output has a “Comma”.
0 Kudos
Message 25 of 29
(2,049 Views)
Okay, I think I understand now. What you're seeing is the effect of localization. Your instrument is is returning a period (".") but in your locale, your pc is set to use comma (",") as the separator from the whole and decimal part of the number. Under Tools>Options>Front Panel you can select whether or not to use localized decimal. I'm really not all that familiar with other localization options. There may be an option that you can set in the format string to do the same thing. You might want to start a different thread on this issue.
0 Kudos
Message 26 of 29
(2,038 Views)
Thanks, Denise. I just set it up it works ok.
0 Kudos
Message 27 of 29
(1,972 Views)
Hi Dennis,

You seem very knowledgeable about this, so I was wondering if you could help me. I am simply trying to read incoming data which are 24-bit
floating point values, then graph the data over time. The sample VI's that I've seen are able to read the data as a string, but I need it as a binary stream so that I can rearrange it (3 bytes at a time) back into the original float value. Do you have any suggestions?

Thank you,
Jen
0 Kudos
Message 28 of 29
(1,940 Views)
Try using the function String to Byte Array. If you were to provide an example of the string read and what it's supposed to represent, that would help people here provide more details.

p.s. It's generally better to post a new thread instead of a new question to an old one and you should post similar questions to the Instrument Control (GPIB, Serial) board.
0 Kudos
Message 29 of 29
(1,936 Views)