Read Di Function - Brainchild PR10 User Manual

Paperless recorder
Hide thumbs Also See for PR10:
Table of Contents

Advertisement

Math
switch(decimal value)
{
case 1:
ScaleLo = ScaleLo / 10;
break;
case 2:
ScaleLo = ScaleLo / 100;
ScaleHi = ScaleHi / 100;
break;
case 3:
ScaleLo = ScaleLo / 1000;
break;
case 4:
ScaleLo = ScaleLo / 10000;
break;
case 5:
ScaleLo = ScaleLo / 100000;
break;
default:
break;
}
// Step 4: Parsing data for Math1
RegData = (UINT)MAKELONG(MAKEWORD(MsgBuf[j+1],
MsgBuf[j]),
MAKEWORD(MsgBuf[j+3],
MsgBuf[j+2]));
// Step 5: Execute converted function
MathData = ConvertData(ValueRangeLo,
ValueRangeHi,
ScaleLo,
ScaleHi,
RegData);
// Step 6: Repeat Step 1 to Step 5 for getting another data of Math
}

8.3.6 Read DI Function

bool ReadDIData(void)
{
unsigned char MsgBuf[96];
unsigned char Addr = 1; /* Slave Id */
unsigned short StartRegAdd = 50;
ScaleHi = ScaleHi / 10;
ScaleHi = ScaleHi / 1000;
ScaleHi = ScaleHi / 10000;
ScaleHi = ScaleHi / 100000;
Page 471 of 479

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pr20Pr30

Table of Contents