EasyManuals Logo

Brainchild PR20 User Manual

Default Icon
479 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #473 background imageLoading...
Page #473 background image
Page 473 of 479
DiData = (bool)MAKEWORD(MsgBuf[4], MsgBuf[3]);
// Step 2: Repeat Step 1 for getting another DO data
}
8.3.9 Read External Function
bool ReadExtData(void)
{
unsigned char MsgBuf[128];
unsigned char Addr = 1; /* Slave Id */
unsigned short StartRegAdd = 401;
unsigned short RegQuantities = 20;
unsigned short ExtData;
// Read register data from remote device
ReadData(Addr, StartRegAdd, RegQuantities, MsgBuf);
// Step 1: Parsing data for Ext1
DiData = MAKEWORD(MsgBuf[4], MsgBuf[3]);
// Step 2: Repeat Step 1 for getting another Ext data
Note:
*1: Above sample code is according to the PR20 setting, if user need changing the MsgBuf size and
RegQuantities value from PR10 or PR30, please refer to the user manual.
Because the Input Register Ext data is same like Holding Register Ext data, so the data type of
the ExtData must according to the setting of real case, if the data type of ExtData is 4 bytes, please
refer to “ReadMathData” function in Step 1, Step 2, Step 4 and Step 5 to convert data type of
customer
Requirement (Such as: Int32 or UInt32 or float data type).
}
8.4 Appendix
8.4.1 Modbus RTU Slave / TCP Server Register data type table
Field Name
Data Size
Data Type
Note
AI
2 Bytes
WORD
Little Endian
Math
4 Bytes
UINT32
Little Endian
DI
2 Bytes
WORD
Little Endian
AO
2 Bytes
WORD
Little Endian
DO
2 Bytes
WORD
Little Endian
External
2 Bytes / 4 Bytes
WORD / DWORD
Little Endian
8.4.2 Inquire AI range
The Modbus scale range for each AI channel is available in the channel configuration page as
shown below.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Brainchild PR20 and is the answer not in the manual?

Brainchild PR20 Specifications

General IconGeneral
BrandBrainchild
ModelPR20
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals