Hi All,
I have worked with Modbus communication before, but this is my first time with Serial ASCII. I am not sure how to process it. I was wondering if someone could show it with an example.
I have S7-1400 with 2 CM541 basic comm module. They each talk to a scale device which send out the following ASCII message via RS232.
"STX POL DATA SP lbs ST CR+LF"
where STX is start of the message, POL is + or -, DATA is Six char showing wt in real value, SP is space, lbs is unit, ST is status.
I know that I have to setup the start of message as STX and end of message as CR and LF (4th and 5th end char) in the hardware config. I was trying to use Recieve_P2P function block. But i am not sure what should be buffer data type be.
a) should it be an array of 20 char or so with buffer pointing to P#DB1.DBX0.0 Byte 20 .
or b) string of lenght 22 with pointer pointing to the 3rd element of the string.
I just want to display the weight i.e POL and DATA in HMI.
How should i proceed?
I would appreciate all the help.
Thank you.
I have worked with Modbus communication before, but this is my first time with Serial ASCII. I am not sure how to process it. I was wondering if someone could show it with an example.
I have S7-1400 with 2 CM541 basic comm module. They each talk to a scale device which send out the following ASCII message via RS232.
"STX POL DATA SP lbs ST CR+LF"
where STX is start of the message, POL is + or -, DATA is Six char showing wt in real value, SP is space, lbs is unit, ST is status.
I know that I have to setup the start of message as STX and end of message as CR and LF (4th and 5th end char) in the hardware config. I was trying to use Recieve_P2P function block. But i am not sure what should be buffer data type be.
a) should it be an array of 20 char or so with buffer pointing to P#DB1.DBX0.0 Byte 20 .
or b) string of lenght 22 with pointer pointing to the 3rd element of the string.
I just want to display the weight i.e POL and DATA in HMI.
How should i proceed?
I would appreciate all the help.
Thank you.