Analog R/W Functions - ICP DAS USA ISaGRAF WinCE ViewPAC User Manual

Table of Contents

Advertisement

10.4.2 Analog R/W Functions

■UserSetReg_short ■UserSetReg_long ■UserSetReg_float
Description:
These functions are to set 16-bit short integer , 32-bit long integer & 32-bit float value to the specified
Modbus network address.
Syntax:
UserShare.UserSetReg_Short(ushort iUserAddress, out int iStatus)
UserShare.UserSetReg_Long(ushort iUserAddress, out int iStatus)
UserShare.UserSetReg_Float(ushort iUserAddress, out float iStatus)
Parameter:
iUserAddress : Specify the Network Address of Variable (1 to 8191)
iStatus : Set the short or long integer or float value.
Example:
// Set a long value "1234567" to the variable of Modbus Network Address "1".
int temp1=1234567;
UserShare.UserSetReg_long(Convert.ToUInt16(1), out temp );
// Set a short value "-1234" to the variable of Modbus Network Address "3".
int temp2= -1234;
UserShare.UserSetReg_short(Convert.ToUInt16(3), out temp2 );
// Set a float value "2.174" to the variable of Modbus Network Address "4".
float temp3=2.174;
UserShare.UserSetReg_float(Convert.ToUInt16(4), out temp3 );
Demo program :
ISaGRAF WinCE ViewPAC CD-ROM:
 \napdos\isagraf\vp-25w7-23w7\CSharp.net-2008-demo\wp_CSharp02 for R/W analog I/O
 \napdos\isagraf\vp-25w7-23w7\CSharp.net-2008-demo\wp_CSharp03 for R/W internal Boolean, long
integer, Timer and Real (floating-point) values.
Note:
The long integer & timer & real variable's Network Address No. must occupy 2 No. in the ISaGRAF
project. (refer to section 4.2 of "User's Manual of ISaGRAF Embedded Controllers" or in the CD-ROM:
\napdos\isagraf\vp-25w7-23w7\english-manu\" User_Manual_I_8xx7.pdf")
10-7
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