AXL SE RS485 Serial Communication
Hi Phoenix Contact Team,
Currently, I am working to read data from GPS. I see some example and the configuration was only available on AXL F RSUNI.
Can I use AXL SE RS485 to read data from GPS?
Currently, I am working to read data from GPS. I see some example and the configuration was only available on AXL F RSUNI.
Can I use AXL SE RS485 to read data from GPS?
Comments
Yes, it is. The configuration can be matched between the GPS Unit and the serial module.
I am using AXL Com Serial Function Block to read the data. As you know, the GPS Module transmit in the NMEA 0813 standard.
In the AXL SE RS485 config settings, I cannot config the Transmission type (Transparent, end to end) and CR LF as the delimiters.
Also on the arrRcvData variable was in the BYTE type, how can I convert it to char as the messages from GPS?
If you dont mind, the example project from you will be helpful.
Thanks Martin.
You can use the BUF_TO_STRING function block to convert a byte array to a String variable. There is information on how to use this FB in the PLCnext Engineer help pages.
Please let us know if you need any more information.
Can you explain more about this?
Yes, I've tried to use BUF_TO_STRING function block to convert byte array to STRING Variable.
But the messages that appear is like below picture.
Can you give more explanation?
Thanks Martin
The BUF_TO_STRING function is useful when the byte array contains data representing ASCII codes. You mentioned that you wanted to convert the bytes to "char" data, so I assumed this was the case. If the data you are receiving from the partner device is ASCII, then it looks like it is sending all sorts of non-printable ASCII codes. So, perhaps the device is not sending ASCII codes at all. The data sheet for the partner device should tell you exactly what each byte in a transmitted message represents.
If you would like more help with this specific project, you can get personal support from the local Phoenix Contact office in your country. If you would like someone to contact you directly, please let me know.
When that message is received by the PLCnext Control device (via the SE module) into a byte array, what are the data values in each of the array elements (in hexadecimal or decimal)?
e.g.
Message transmitted by the GPS device: Hello World<CR><LF>
Bytes received by the PLC (hex): 48 65 6c 6c 6f 20 57 6f 72 6c 64 0d 0a
This will tell us if the problem is in the byte array, or in the BUF_TO_STRING conversion.
I check the BYTE value and convert each bytes to character and I think yes it was the problem on the BYTE array value.
It show unique character when I convert the BYTE value.
Do you have any idea what cause this?
I just can do parse the raw data after confirm the GPS messages received correctly on the SE module.
There could be a few reasons for this, related to the hardware and/or the software setup.
With your permission, someone can contact you (on the email address you used to register on this forum), to go through the specifics of your setup, and help find the source of the problem.
Thanks for your help Martin.