hapetter
Member
Hi
Im new to serial communication. I try to understand how to reed and write to a serial device from a PLC. I use Beckhoff PLC with RS232 port and serial com library.
In the datasheet of the device they say that output is ASCII and in this format: (This is a distance)
0.1oF per unit), <CR><LF>.
How can I decide witch one is what? like saving in two different strings...
Now I like to send a ASCII code to the sensor: one of its settings are:
How to do this? just send a string like "S9999999" or S<9999999>
What do they mean by input switch code?
Sorry for this basic questions, but I like to understand this
Thanks!
Best regards
Han sPettersson
Im new to serial communication. I try to understand how to reed and write to a serial device from a PLC. I use Beckhoff PLC with RS232 port and serial com library.
In the datasheet of the device they say that output is ASCII and in this format: (This is a distance)
[DD]D.DD<CR><LF>
In this configuration, each sample consists of a string of characters as follows: 4
to 6 distance followed by <CR><LF>. characters (possible values from 0.00 to
999.99 inches in 1/100ths of an inch in English output, or 0 to 99999 mm metric)
Values enclosed in [] will not appear if they consist only of leading zeros.In this configuration, each sample consists of a string of characters as follows: 4
to 6 distance followed by <CR><LF>. characters (possible values from 0.00 to
999.99 inches in 1/100ths of an inch in English output, or 0 to 99999 mm metric)
- So how can this be understand? and how can it be read by a read block? What kind of read block would I use: I have receive byte and receive string available...
- I belive i must use string right? How will that string look like after receiving a number? will it include <CR><LF>,? what ecsactly are thouse?
- There are several other readings like this one:
ASCII Data format, Low Level Sensor Outputs Only
[
RRRRRR]R<TAB>[SSS]S<TAB>[AAA]A<TAB>[TTT]T<CR><LF>
In this configuration, each sample consists of characters as follows: 1 to 7 range
characters (possible values from 0 to 4.19 million, decimal format), SPACE, 1 to
4 signal strength characters (0 to 1023), SPACE, 1 to 4 ******t light level
characters (0 to 1023), SPACE, 1 to 4 sensor temperature characters (0 to 1500 in
In this configuration, each sample consists of characters as follows: 1 to 7 range
characters (possible values from 0 to 4.19 million, decimal format), SPACE, 1 to
4 signal strength characters (0 to 1023), SPACE, 1 to 4 ******t light level
characters (0 to 1023), SPACE, 1 to 4 sensor temperature characters (0 to 1500 in
0.1oF per unit), <CR><LF>.
How can I decide witch one is what? like saving in two different strings...
Now I like to send a ASCII code to the sensor: one of its settings are:
Set Sample Interval
3-8 bytes ASCII Code: S<Interval>
(20 <= Interval <= 9999999)
Input switch code: 8<Rate Code>(20 <= Interval <= 9999999)
How to do this? just send a string like "S9999999" or S<9999999>
What do they mean by input switch code?
Sorry for this basic questions, but I like to understand this
Thanks!
Best regards
Han sPettersson