ICP DAS USA ISaGRAF WinCE ViewPAC User Manual page 120

Table of Contents

Advertisement

Get boolean value:
unsigned char UserGetCoil(unsigned short iUserAddress, unsigned char *iStatus);
iUserAddress:1 to 8191 (Variable's network address in ISaGRAF project)
iStatus:
for ex.
unsigned char bVal;
UserGetCoil(5 , &bVal) // get Boolean value at network addr 5
Get word or float or long value:
unsigned char UserGetReg(unsigned short iUserAddress, long *iStatus,
iUserAddress:1 to 8191 (Variable's network address in ISaGRAF project)
iStatus: A pointer to a long type, which stores the data returned
iDType
0: type is word
1: data type is float
2: data type is long (use long for Timer value in ISaGRAF, unit is ms)
for ex.
float
long
long
// get word_val (-32768 to +32767) of ISaGRAF variable with network address 10
UserGetReg(10, &ret_val, 0);
if ( ret_val>=0 && ret_val<=32767 ) word_val = ret_val;
else word_val = ret_val | 0xFFFF0000;
// get float of ISaGRAF variable with network address 11
UserGetReg(11, &ret_val, 1) ;
float_val = *(float *) (&ret_val) ;
// get long of ISaGRAF variable with network address 13
UserGetReg(13, &ret_val, 2) ;
long_val = ret_val ;
Note:
The long integer , timer and float variable's Network Address No. must occupy 2 No. in the ISaGRAF
project.
(Please refer to
section 4.2
WinCE ViewPAC CD-ROM:
\napdos\isagraf\vp-25w7-23w7\english-manu\" User_Manual_I_8xx7.pdf")
7-2
0: boolean is False, 1: boolean is True
unsigned char iDType);
float_val;
word_val, long_val;
ret_val;
of "User's Manual of ISaGRAF Embedded Controllers" or in the ISaGRAF
ISaGRAF WinCE ViewPAC User Manual , V.1.6 , 1/2017 by ICP DAS

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vp-25w7Vp-23w7Vp-4137Vp-25w6Vp-23w6Vp-4136

Table of Contents