We are still working on migrating to the new Bosch Connected Industry Online Portal. Stay tuned! Click here for the latest updates.
12-08-2021 02:37 AM
Hello,
I have the following problem with a unit that I programmed for a device connected with RS485.
I am using an EL6022 and the matching Peripheral version 2.0.5.0. I am only using the first channel and it is configured as RS485 in the OES parameters.
I open the channel like this:
_parCfg.iSerialStream.Open(OpconSerialBaudRate.BAUD_9600, OpconSerialDataFrame.FRAME_8E1, OpconSerialHandShakeType.NO_HANDSHAKE);
I successfully send 14 bytes to the device and the device responds according to its protocol documentation. In order to receive the response, I use:
_parCfg.iSerialStream.Read(ADR(_receiveBuffer), 23, _bytesRead, _timeout);
When the Read() method returns OK, the value in _bytesRead is only 22 though, this is my problem. I checked the Input variables of the serial terminal and I can see that the 23rd byte that the device sent me actually sits in the Data In 0 with Input length set to 1. So the device seems to work correctly, the Beckhoff terminal seems to work correctly, but the EL6022 peripheral seems unable to read more than 22 bytes, which is probably because that's how much data the serial terminal catches with its input variables in a single go.
I tried different handshake mechanisms in the Open() parameter but they seem to have no effect (... are they even used with RS485 in general?). I also made sure that the device's parameters are matching the baud rate and parity settings. But could not get the 23 byte response to work correctly with the Nexeed objects.
The device supports another protocol that only has a 19 byte response. If I use this one then the message fits into the buffer and the entire communication works. So it does not seem to be a problem of the device and probably not in my application either.
Are there any known solutions to this problem? I am curious what the root cause is and how to eliminate it, because I really want to use the 23 byte version of the protocol.
Solved! Go to Solution.
04-21-2022 12:58 PM
Hello, is there any documentation or example of usage for IOpconSerialStream?
04-22-2022 03:40 PM
You can find an example on the Bosch internal release server (...\Nexeed\Automation\ControlPlus\Samples\Serial Example\V1.0).
If you do not have access and want to have the example, please contact our helpdesk.