Could you comment for RS422 communication with X20-CS1030.
Serial communication (sending and receiving) is carried out cyclically in an infinite loop.
There are some blocks which have about 100 values (each value is about 24bytes).
The X20CS1030 transmits and receives serial frames. The actual data contained in the frames can be of any type and needs to be parsed by the receiver based on some predetermined definition.
Communication is typically done using the DVFrame library. In order to send a frame, you have to pass the FRM_write function block the address to a data buffer. The data buffer is an array of single byte characters, so you can just use a STRING for this. If you want to see an example, you can one to your project by selecting Library Samples in the Toolbox while in the Logical View.
Hi Jaroslav, thank you for asking. I have rx-tx, I have some feedbacks coming through port but datas are very complex to me, I try to understand which data type will be used.
I need to send correct data frame for requesting block.
I need to select correct clusters, data types of receiving block.
Serial communication is essentially just a string of characters with all of the data packed into each message. You have a definition of what data should be included in each message and how the messages need to be formatted so this is a good start! Next, I would recommend making some functions to create each message. The input could be a pointer to a custom data structure containing all of the data for that message and the output would be a string that can be sent via RS422. You’ll have to pack the data into a string using the memcpy (or brsmemcpy) function. Unfortunately, I don’t have a good example for this because the process is very dependent on the data you’re working with.
Once you have your data buffer, you can send it at some set frequency using the functions you already have working.