07-09-2007 10:41 PM
07-09-2007 10:59 PM
@feidaodeng wrote:I use VISA to read data from serial port,then display them in the chart.The data I sent are HEX string like"00 01 02 03 04 05",but the data I received are like"..................... !"#$%&'()*+,-./".
The thing to remember is that the only difference between an output of
2E20 2122 2324 2526 2728 292A 2B2C 2D2E 2F
and
. !"#$%&'()*+,-./
(which by the way are equal) is the display format selected in the indicator.So all their value displayed in the chart are 0,but the value what I want are"0 1 0 3 4 5".A solution is use the "String To Byte Array",But another question is how to combine two serial string into a new value?
Unless I misunderstand what you mean, the same way you would any two strings - a string concatenator...Thank you!
07-09-2007 11:32 PM
Can you attach a simplified example containing the strings you get and the outputs you want?
You cannot wire a string to a chart so it is not clear what you do to get the "0". String to byte array is a very special case if you know your desired final datatype is U8. In a more general case, you would typecast or unflatten to the desired datatype.
@feidaodeng wrote:
A solution is use the "String To Byte Array",But another question is how to combine two serial string into a new value?
It is not fully clear what you mean, but do you possibly want to extract a multibyte datatype (e.g. 2 bytes for I16) from the string? In this case, the first part of my answer will give you the solution. 🙂
07-10-2007 04:24 AM
07-10-2007 04:34 AM
07-10-2007 04:40 AM
Reply to altenbach:
Thanks for your reply.
The date read from serial port is format string,so used the "Hexadecimal String To Number " then wired it to a chart ,the value displayed in the chart is "0".
07-10-2007 04:51 AM
07-10-2007 05:05 AM
07-10-2007 06:06 AM
07-10-2007 06:30 AM