Evc++ Program Access To Isagraf Variables - ICP DAS USA ISaGRAF WinCE ViewPAC User Manual

Table of Contents

Advertisement

Chapter 7
Important Notice:
Please store your application programs and data files in the \Micro_SD . Don't store them
in the \System_disk. That is because the \System_Disk is using Nor Flash memory. Its size is
small and major purpose is for storing OS, ISaGRAF driver, some basic utilities and DLL . The
Nor Flash memory is not good for frequently updating files. If update files frequently in the
\System_Disk (for example, update a file every 1 to 5 seconds, then it will be about ten thousand
more updates in one day), the data or files in the \System_disk may crush or lost for some days
or months later.
User can write his EVC++ 4.0 application to access to the ISaGRAF variables running at the same
VP-2xW7/4xx7 by using the below functions for Read/Write Boolean, word, long and float value.
The include file and library at design time are "WinConAgent.h" and "Quicker.lib". (ISaGRAF WinCE
ViewPAC CD-ROM: \napdos\isagraf\vp-25w7-23w7\evc++-lib\ ). The DLL at run time is the "Quicker.dll"
which is in ViewPAC's \System_Disk\isagraf\
compilation to the ViewPAC 's \System_Disk\isagraf\ and then run it.)
Set boolean value:
unsigned char UserSetCoil(unsigned short iUserAddress, unsigned char iStatus);
iUserAddress:1 to 8191 (Variable's network address in ISaGRAF project)
iStatus:
for ex.
Set word or float or long value:
unsigned char UserSetReg(unsigned short iUserAddress, long *iStatus, unsigned char iDType);
iUserAddress:1 to 8191 (Variable's network address in ISaGRAF project)
iStatus: A pointer to a long type, which stores the data to set
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
// set word_val (-32768 to +32767) to ISaGRAF variable with network address 1
word_val = -20000 ;
temp_val = (long *)(&word_val);
UserSetReg(1 , temp_val, 0);
// set float_val to ISaGRAF variable with network address 2
float_val = 1.2345 ;
temp_val = (long *)(&float_val);
UserSetReg(2 , temp_val, 1);
// set long_val to ISaGRAF variable with network address 4
long_val = 12345678 ;
temp_val = (long *)(&long_val);
UserSetReg(4 , temp_val, 2);

EVC++ Program Access To ISaGRAF Variables

0: set boolean to False, 1: set boolean to True
UserSetCoil(100 , 1) // set Boolean at network addr 100 as True
float_val;
word_val, long_val;
*temp_val;
ISaGRAF WinCE ViewPAC User Manual , V.1.6 , 1/2017 by ICP DAS
(Please copy the execution file after successfully
7-1

Advertisement

Table of Contents
loading

This manual is also suitable for:

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

Table of Contents