Home
Win-GRAF-User-Manual
Contents
1. napdos Win GRAF demo project vb net_2008_demo demo_vb03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 13 13 5 4 R W String Variable Functions HI Get_STRING Description This function is to get a Win GRAF String variable Syntax UserShare Get_STRING ByVal iUserAddress As System UInt16 ByVal msg As Byte As Byte Parameter iUserAddress Address of Variable 1 to 1024 msg Get the string value Example Dim str_val As String Dim msg As Byte Get String value of the Win GRAF String variable with address 7 UserShare Get_STRING Convert ToUInt16 7 msg str_val byte_array_to_unicode msg Private Function byte_array_to_unicode ByVal buf As Byte As String Dim tmpmsg As String If buf Length gt 255 Then Return Nothing End If tmpmsg System Text Encoding GetEncoding UTF 8 GetString buf 0 buf Length Return tmpmsg End Function Demo program CD ROM 1 R W String variable napdos Win GRAF demo project vb net_2008_demo demo_vb04 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 14 HI Set_STRING Description This function is to set a String value to the Win GRAF String variable Syntax UserShare Set_STRING ByVal iUserAddress As System UInt16 ByVal msg As Byte As Byte Parameter iUserAddress Address of Variable 1 to 1024 msg the string value Example Dim str_val As String Hello World Dim msg As Byte msg un
2. Description This function is to get a Win GRAF String variable Syntax UserShare Set_STRING ushort addr Byte msg Parameter addr Address of Variable 1 to 1024 msg Get the string value Example String str_val Byte msg Get the String value of the Win GRAF String variable with address 7 msg unicode_to_byte_array str_val UserShare Set_STRING Convert ToUInt16 7 msg Convert String to byte array private byte unicode_to_byte_array string msg byte tmpbuf if msg Length gt 255 return null tmpbuf Encoding GetEncoding UTF 8 GetBytes msg return tmpbuf Demo program CD ROM 1 R W String variable napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp04 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 12 HI Get_STRING Description This function is to set a String value to the Win GRAF String variable Syntax UserShare Set_STRING ushort addr Byte msg Parameter addr Address of Variable 1 to 1024 msg Set the string value Example String str_val Hello World Byte msg Set a string value Hello World to the Win GRAF String variable with address 7 UserShare Get_STRING Convert ToUInt16 7 msg str_val byte_array_to_unicode msg Convert byte array to String private string byte_array_to_unicode byte buf string tmpmsg if buf Length gt 255 return null tmpmsg
3. Return tmpmsg End Function Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 16 Chapter 14 C net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables This chapter lists the procedure for creating the first demo program by Visual Studio NET 2008 development tool There are some sample programs in the WP 8xx8 CD ROM C demo CD ROM napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp01 Digital I O demo with one I 87055W in slot 0 of the WP 8xx8 demo_CSharp02 Analog I O demo with one I 87024W in slot 1 and one I 8017HW in slot 2 demo_CSharp03 Read Write Win GRAF internal integers timers and real variables No I O demo_CSharp04 Read Write Win GRAF internal String variables No I O Win GRAF demo CD ROM napdos Win GRAF demo project demo_vb01 zip demo_vb02 zip demo_vb03 zip demo_vb04 zip 14 1 Add an Existing Win GRAF Project from a ZIP Please refer the Chapter 13 1 14 2 Publishing the Win GRAF Variable for NET Please refer the Chapter 13 2 14 3 Create a New C Project 1 First users need to open Microsoft Visual Studio NET 2008 software And then in the menu of File please run the New Project A Start Page Micros Visual Studio Edit View Tools Test Window Help New Project Ctri N Es dlv New Web SiteM ShifttAlt N New File Gl Open Project Ctrl O Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 1 2 Chec
4. UserShare Set_INT Convert ToUInt16 2 temp2 Set a 64 bit Integer value 123456789012345 to the Win GRAF LINT variable with address 3 long temp3 123456789012345 UserShare Set_LINT Convert ToUInt16 3 temp3 Set a 8 bit Integer value 125 to the Win GRAF SINT variable with address 4 Sbyte temp4 125 UserShare Set_SINT Convert ToUInt16 4 temp4 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp02 2 R W internal Boolean long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 8 ME Get_SINT Mf Get_INT W Get_DINT J Get_LINT Description These functions are to get 8 bit integer 16 bit integer 32 bit integer amp 64 bit integer value from Win GRAF integer variables Syntax UserShare Get_SINT ushort iUserAddress out sbyte iStatus UserShare Get_INT ushort iUserAddress out short iStatus UserShare Get_DINT ushort iUserAddress out int iStatus UserShare Get_LINT ushort iUserAddress out long iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the value of Win GRAF integer variables Example Int64 Dilong_ val Int16 short_val Int32 long val sbyte sbyte_val Get 64 bit integer value from the Win GRAF LINT variable with address 7 UserShare Get_LINT Convert
5. path Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 7 13 5 UserShareNet dll This section we will focus on the description of the application example of UserShareNet dll functions There are some functions that can be used to read write data from to the Win GRAF soft logic The functions of UserShareNet dll can be divided into as listed below 1 R W Boolean 2 R W 8 bit Integer 3 R W 16 bit Integer 4 R W 32 bit Integer 5 R W 64 bit Integer 6 R W 32 bit Float 7 R W 64 bit Float 8 R W String X Refer the Appendix A to get familiar with the definition of Win GRAF variables 13 5 1 R W Boolean Functions HI Set_BOOL Description This function is to set a value to a Win GRAF Boolean variable Syntax UserShare Set_BOOL iUserAddress As System UInt16 ByVal iStatus As byte as Byte Parameter iUserAddress Address of the Variable 1 to 8192 iStatus Set the status For instance iStatus 1 for True iStatus 0 for False Example Set the Win GRAF BOOL variable with address 1 to True UserShare Set_BOOL Convert ToUInt16 1 1 Demo program CD ROM napdos Win GRAF demo project vb net_2008_demo demo_vb01 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 8 MI Get_BOOL Description This function is to get the value from a Win GRAF BOOL variable Syntax UserShare Get_BOOL iUserAddress As System UInt16 ByRef iStatus As byte Parameter iUserAddre
6. Encoding GetEncoding UTF 8 GetString buf 0 buf Length return tmpmsg Demo program CD ROM 1 R W String variable napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp04 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 13 14 5 5 How to Use C to Convert Win GRAF String Variable Before NET program write to Win GRAF String variable The String type has to convert to byte array According your NET program Encode Ex UTF 8 If you need to read Win GRAF String variable Then you have to convert byte array to String There is an C example to show how to convert each other Example Encode is UTF 8 Convert String to byte array private byte unicode_to_byte_array string msg byte tmpbuf if msg Length gt 255 return null tmpbuf Encoding GetEncoding UTF 8 GetBytes msg return tmpbuf byte array to string private string byte_array_to_unicode byte buf string tmpmsg if buf Length gt 255 return null tmpmsg Encoding GetEncoding UTF 8 GetString buf 0 buf Length return tmpmsg Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 14
7. ToUInt16 7 out Dlong_val Get 32 bit integer value from the Win GRAF DINT variable with address 8 UserShare Get_DINT Convert ToUInt16 8 out long_val Get 16 bit integer value from the Win GRAF INT variable with address 9 UserShare Get_INT Convert ToUInt16 9 out short_val Get 8 bit integer value from the Win GRAF SINT variable with address 10 UserShare Get_SINT Convert ToUInt16 9 out sbyte_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp02 2 R W internal Boolean long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 9 14 5 3 R W Real variable Functions MB Get_REAL Mf Get_LREAL Description These functions are to get 32 bit REAL and 64 bit double from the Win GRAF Syntax UserShare Get_REAL System UInt16 iUserAddress out float iStatus UserShare Get_LREAL ByVal iUserAddress As System UInt16 out Double iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 32 bit REAL or 64 bit double value Example float float_val double double_val Get 64 bit double value from the Win GRAF LREAL variable with address 7 UserShare Get_LREAL Convert ToUInt16 7 out double_val Get 32 bit REAL value from the Win GRAF REAL variable with address 8 U
8. Chapter 13 VB net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables This chapter lists the procedure for creating the first demo program by Visual Studio NET 2008 development tool There are some sample programs in the WP 8xx8 CD ROM VB NET example CD ROM napdos Win GRAF demo project vb net_2008_ demo demo_vb01 Digital O demo with one I 87055W in slot 0 of the WP 8xx8 demo_vb02 Analog I O demo with one I 87024W in slot 1 one I 8017HW in slot 2 demo_vb03 Read Write Win GRAF internal integers timers amp real variables No I O demo_vb04 Read Write Win GRAF internal String variables No I O Win GRAF example CD ROM napdos Win GRAF demo project demo_vb01 zip demo_vb02 zip demo_vb03 zip demo_vb04 zip 13 1 Add an Existing Win GRAF Project from a ZIP Please follow these steps to restore the Win GRAF project First Click File gt Add Existing Project gt FromZip Then choose the Win GRAF project zip file which you would like to restore After restoring the project you have to build the project and then download it to the PAC View Tools Window Help i New Project List Open Project List gt i Add New Project j From Disk Print Setup i z z From Tarset 1 CA Win GRAFProjectsiwp_vb01 w51 i po Eg 2 x 2 C Win GRAFProjectswwp_vb03 w51 3 CAWin GRAFProjectswp_vb02 w5l 39D G Demo Program O 8 re 4CA Win GRAFProjectsICPDA
9. S_template w5 O CSharp net_2008_demo 2 ie Exit a O pv iet 2008 demo HRH S L zip A FRAT HASIS a aN demo_vb01 zip v RARA Oaa FALAS ARRUN Zip file zip v aa Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 1 13 2 Publishing the Win GRAF Variable for NET and Soft GRAF HMI If users wish to use NET program to Read Write the Win GRAF variables Except for String variable all of the variables need to use the Open Binding Configuration function to set an address The following demonstrates how to publish Win GRAF variable 1 Click Open Binding Configuration on the toolbar to open the Binding setup window 2 Click PUBLIC 9000 Keep the Address value is blank and Port value is fixed to 9000 Win GRAF Test_3 File Edit View Insert Project Tools Window Help Workspace Ei Test_3 oT 7 Name Type i Exception programs g Name PUBLIC fa Global variables Programs Address la RETAIN variables ae Main g Port 9000 _ Main Watch for debugging BE Soft Scope E Kee EF Initial values 2 pOnBadindex p Address value blank r Name Identifier E e ao i Binding Configuration 39 Global defines A Variables en Types lt 4 gt Binding Variables 3 Before publishing these variables make sure you have declared them in the Variables Area Click Global variables and press the Ins key to insert a new va
10. Sbyte_val as byte Get 64 bit integer value from the Win GRAF LINT variable with address 7 UserShare Get_LINT Convert ToUInt16 7 Dlong_val Get 32 bit integer value from the Win GRAF DINT variable with address 8 UserShare Get_DINT Convert ToUInt16 8 long_val Get 16 bit integer value from the Win GRAF INT variable with address 9 UserShare Get_INT Convert ToUInt16 9 short_val Get 8 bit integer value from the Win GRAF SINT variable with address 10 UserShare Get_SINT Convert ToUInt16 9 sbyte_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_2008_demo demo_vb02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project vb net_2008_demo demo_vb03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 11 13 5 3 R W Real Variable Functions MB Get_REAL Mf Get_LREAL Description These functions are to get 32 bit REAL and 64 bit double from the Win GRAF REAL LREAL variable Syntax UserShare Get_REAL ByVal iUserAddress As System UInt16 ByRef iStatus As Single As Byte UserShare Get_LREAL ByVal iUserAddress As System UInt16 ByRef iStatus As Double As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 32 bit REAL or 64 bit double value Example Dim float_val As Single Dim double_val As Double Get 64 bit double value from the Win GRAF LREAL variable wi
11. b S41 2 A 4gForml wel projectl Option Explicit On sa My Project BS Form vb Imports UserShareNet Open Open With Public Class Forml pF Class Then you can design all required objects and actions inside your VB Forms Refer the Chapter 13 5 for more information about using functions in the UserShareNet dll Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 6 13 4 Compiling the Application When you have finished writing a program you can build compile an application by the following steps 1 Remember to save at any time for safety ERDEI Edit View Project Build Gegh m Rebuild projectl Deploy patmmty E a ee J 7e e UO TO hk Pointer D1 BindingSource Clean pre Build succeeded 3 You can find the execution file in lt Your VB net Project folder gt bin Release lt project_name gt exe Please copy this execution file to the WP 8xx8 s System_Disk Win GRAF path to run it Note The user may copy the VB net execution file to another path to run it but there should contain at least two DLL files with it or it cannot run correctly For ex the project1 exe can run in the Micro_SD folder if there are three files in it The projecti exe UserShareNet dll and Quicker dll The UserShareNet dll and Quicker dll can be copied from the Win GRAF PAC s System_disk Win GRAF
12. ch Online Templates lt A project for Smart Device applications Choose target platform Framework version and template in the next dialog box Name projectl 3 Select the Device Application and Windows CE and NET Compact Framework Version 3 5 then click OK Target platform NET Compact Framework version Templates Windows CE g NET Compact Framework Version 3 5 NET Compact Framework Yersion 2 0 NET Compact Framework Version 3 5 2 B ma Device TK Class Library oOo e o Console Control Application Library Empty Project Download additonal emulator images and smart device SDKs Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS Description 4A project for creating a NET Compact Framework 3 5 forms application for Windows CE Platform 13 4 13 3 1 Add Project Reference The UserShareNet dll library contains all functions of data exchange with Win GRAF variables Before you use the UserShareNet keyword in the program you must add the UserShareNet dll into the reference list of your project 1 Copy the UserShareNet DLL from Win PAC s shipment CD napdos Win GRAF WP 8xx8 vb net_2008_demo wp_vb01 vb01 to your project folder e g C project1 2 Right click on the project name e g project1 in the Efx Solution Explorer window and the
13. e from the pop up Move cursor to top and insert the using UserShareNet in the first statements Sa Properties Jj References H E Open Open With E View Code r 3 i I 5 Ii i Lusing UserShareNet using System Drawing using System Text 1nd orm g namespace wp_CSharpOl E public partial class Formi Form Then you can design all required objects and actions inside your C Forms Refer the Section 14 5 for more information about using functions in the UserShareNet dll Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 4 14 4 Compiling the Application Program When you have finished writing a program you can build compile an application by the following steps 1 Remember to save at any time for safety d dio Debug D ata Form tl ctl A isu File Edit View Project Hega me ia Bui Rebuild projectl All Dex hk Pointer D1 BindingSource Deploy p aiamty Dic io Clean pre Build succeeded 3 You can find the execution file in lt Your C net Project folder gt bin Release lt project_name gt exe Please copy this execution file to the WP 8xx8 s System_Disk Win GRAF path to run it Note The user may copy the C net execution file to another path to run it but there should contain at least two DLL files with it or it cannot run correctly For ex the project1 exe can run in the Micro_SD pa
14. icode_to_byte_array str_val Set a string value Hello World to the Win GRAF String variable with address 7 UserShare Set_STRING Convert ToUInt16 7 msg Convert String to byte array Private Function unicode_to_byte_array ByVal msg As String As Byte Dim tmpbuf As Byte If msg Length gt 255 Then Return Nothing End If tmpbuf System Text Encoding GetEncoding UTF 8 GetBytes msg Return tmpbuf End_Function Demo program CD ROM 1 R W String variable napdos Win GRAF demo project vb net_2008_demo demo_vb04 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 15 13 5 5 How to use VB NET R W to Win GRAF String Variable Before NET program write to Win GRAF String variable The String type has to convert to byte array If you need to read Win GRAF String variable Then you have to convert byte array to String There is a VB NET example to show how to convert each other Encode UTF 8 Convert String to byte array Private Function unicode_to_byte_array ByVal msg As String As Byte Dim tmpbuf As Byte If msg Length gt 255 Then Return Nothing End If tmpbuf System Text Encoding GetEncoding UTF 8 GetBytes msg Return tmpbuf End Function Convert byte array to string Private Function byte_array_to_unicode ByVal buf As Byte As String Dim tmpmsg As String If buf Length gt 255 Then Return Nothing End If tmpmsg System Text Encoding GetEncoding UTF 8 GetString buf 0 buf Length
15. k the Smart Device on the left then selecting the NET framework 3 5 and Smart Device Project Then entering a proper project name and the last click on OK Beene Tonle NET Framework 3 5 ES Database A Y isual Studio installed templates a Reporting la Test WCF act Workflow ee S Other Languages Smart Device Visual C Dorel R My Templates i E i Search Online Templates E m at ETTER E m a A project for Smart Device applications Choose target platform Framework version and template in the next dialog box Name projectl 3 Select the Device Application and Windows CE and NET Compact Framework Version 3 5 then click on OK Target platform Windows CE i NET Compact Framework version NET Compact k Version 3 5 s Tng NET Compact Framework Versi NET Compact Framework EJE ve a 4 gp Ey al gel EA il a Description Device Class Library Console Control Empty Project Application Application Library Congest a A application for Windows CE Platform Download additonal emulator images and smart device SDKs Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 2 14 3 1 Add C Project Reference The UserShareNet library contains all modules functions Before you use the UserShare keyword in the program you must add the UserShareNet dll int
16. n select Add Reference E Jfproject1 Rebuild Deploy Clean Add gt Add Reference Add Web Reference 3 Click the Browse tab and select the UserShareNet dll from your project location NET Projects Browse Recent HPE 1 O projec x 9 2 ea bin My Project obj 2 UserShareNet dll The current project is located in C project1 BOD J RAAT Component Files d11 tlb olb ocx exe v Note You may copy the UserShareNet dll from the CD ROM to your current project path first Then add it to the project reference Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 5 4 When UserShareNet dll is added please double click on My Project to check if the UserShareNet dll is well added Application Compile Debug Unused References Reference Paths References References Resources Sieni Devices Reference Name Type Ver CopyLocal Path System T2000 Fale System Drawing 2 0 0 0 False System ee For NET 2000 False Iy 4 7 ear m Mi d ADA RNA TeerShareNet NET 1010 True C Gans and Setingsuser wings oe Wapdos Min al 5 Right click on the Form1 vb and select View Code from the pop up Move cursor to top and insert the Option Explicit On and Imports UserShareNet in the first two statements Solution Explorer 09 Formi v
17. o the reference list of your application 1 Copy the UserShareNet DLL from WP 8xx8 CD ROM napdos Win GRAF WP 8xx8 CSharp net_2008_demo demo_CSharp01 to your project folder ex C project1 le x 2 Right click on the Project name on the right hand side then select Add Reference Solution Explorer pr X E aay H Build Right Click Rebuild Deploy i Clean Add Add Reference Add Web Reference 3 Click the Browse button Select the UserShareNet dll from your project location NET Projects mat oe HESS ie 1 projectl e em bin i oti hange fol h gt Properties Change fo der ees current project Path S UserShareNet dll Ex C project1 RAW J He Set 1 Component Files d1 b gt olb gt ocx exe v Note You may copy the UserShareNet dll from the CD ROM to your current project path first Then add it to the project reference Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 3 4 When UserShareNet dll are added you can see them in the solution explorer as below Solution Explorer Na yal projectl Sa Properties B oy GGU 43 mscorlib 42 System 4G System Core 43 System Data 43 System Dats DataSetExtensions 43 System Drawing 42 System Windows Fomns 43 System Xml D UserShareNet 5 Right click on the Form1 cs and select View Cod
18. riable The following table demonstrates variables using in the Test_3 project and you can declare them according to the needs of your application Variable name Type Public_BOOL BOOL Public _BOOL Public_INT INT Public_INT INT Public_DINT DINT Sabie DAMM BRE Public WORD WORD Public_WORD WORD Dublin DEAL DEAL 3 Public_REAL REAL iinet 4 As the figure below click on PUBLIC 9000 and drag all the needed variables to the Name area The Identifier will generate an address number automatically If any other VB or NET program wants to use these public variables it must set to the same address number ID NOTE The PUBLIC allows to use up to 8192 variables and the Identifier number JUST can be 1 to 8192 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 2 Binding xX a SSG Network Name Value Y Name Type AE ae 9000 Name PUBLIC Global variables Address Public BOOL BOOL Port 3000 Public _INT INT Public _DINT A DINT Public WORD WORD REAL Name Identifier Public_BOOL Public_INT 2 nae i Public_DINT g7 Public WORD 4 Public_REAL 5 lt gt 4 gt Binding Variables a Value The following procedure will show you how to use the pub_string function to publish the Win GRAF String variable in the ST program Syntax Pub_string Address String_val Address The public address number and its range can be 1
19. serShare Get_REAL Convert ToUInt16 8 out float_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008_demo demo_ demo_CSharp03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 10 MM Set_REAL J Set_LREAL Description These functions are to set 32 bit REAL and 64 bit double value to the Win GRAF REAL LREAL variable Syntax UserShare Set_REAL ushort iUserAddress float iStatus UserShare Set_LREAL ushort iUserAddress Double iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 32 bit REAL or 64 bit double Example Set a 64 bit double value 11234 234567 to the Win GRAF LREAL variable with address 7 UserShare Set_LREAL Convert ToUInt16 7 Convert ToDouble 11234 234567 Set a 32 bit REAL value 123 12 to the Win GRAF REAL variable with address 2 UserShare Set_REAL Convert ToUInt16 8 Convert ToSingle 123 12 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 11 14 5 4 R W String variable Functions HI Set_STRING
20. ss Address of the Variable 1 to 8192 iStatus Get the variable value iStatus 1 for True iStatus 0 for False Example Get the value of Win GRAF BOOL variable with address 1 Dim iStatus As Byte UserShare Get_BOOL Convert ToUInt16 1 iStatus Demo Program CD ROM napdos Win GRAF demo project vb net_2008_demo demo_vb01 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 9 13 5 2 Integer R W Functions Mi Set_SINT W Set_INT W Set DINT W Set_LINT Description These functions are to set 8 bit Integer 16 bit Integer 32 bit integer amp 64 bit Integer value to Win GRAF integer variables Syntax UserShare Set_SINT ByVal iUserAddress As System UInt16 ByVal iStatus As SByte As Byte UserShare Set_INT ByVal iUserAddress As System UInt16 ByVal iStatus As Short As Byte UserShare Set_DINT ByVal iUserAddress As System UInt16 ByVal iStatus As Integer As Byte UserShare Set_LINT ByVal iUserAddress As System UInt16 ByVal iStatus As long As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus the value of 8 bit Integer 16 bit Integer 32 bit Integer or 64 bit Integer Example Set a 32 bit integer value 1234567 to the Win GRAF DINT variable with address 1 UserShare Set_DINT Convert ToUInt16 1 Convert Tolnt32 1234567 Set a 16 bit integer value 1234 to the Win GRAF INT variable with address 2 UserShare Set_INT Convert ToUInt16 3 Con
21. th address 7 UserShare Get_LREAL Convert ToUInt16 7 double_val Get 32 bit REAL value from the Win GRAF REAL variable with address 8 UserShare Get_REAL Convert ToUInt16 8 float_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_2008_demo demo_vb02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project vb net_2008_demo demo_vb03 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 12 MM Set_REAL J Set_LREAL Description These functions are to set 32 bit REAL and 64 bit double value to the Win GRAF REAL LREAL variable Syntax UserShare Set_REAL ByVal iUserAddress As System UInt16 ByVal iStatus As Single As Byte UserShare Set_LREAL ByVal iUserAddress As System UInt16 ByVal iStatus As Double As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 32 bit REAL or 64 bit double Example Set a 64 bit double value 11234 234567 to the Win GRAF LREAL variable with address 1 UserShare Set_LREAL Convert ToUInt16 7 Convert ToDouble 11234 234567 Set a 32 bit REAL value 123 12 to the Win GRAF REAL variable with address 8 UserShare Set_REAL Convert ToUInt16 8 Convert ToSingle 123 12 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_2008_demo demo_vb02 2 R W internal long integer Timer and Real floating point values
22. th if there are three files in it The project1 exe UserShareNet dll and Quicker dll The UserShareNet dll and Quicker dll can be copied from the Win GRAF PAC s System_disk Win GRAF path Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 5 14 5 UserShareNet DLL This section we will focus on the description of the application example of UserShareNet DLL functions There are some functions that can be used to read write data from to the Win GRAF variable The functions of UserShareNet DLL can be divided into as listed below R W Boolean R W 8 bit Integer R W 16 bit Integer R W 32 bit Integer R W 64 bit Integer R W 32 bit Float R W 64 bit Float R W 32 bit String CON DM BP WN FP X Refer the Appendix A to get familiar with the definition of Win GRAF variables 14 5 1 R W Boolean Functions Mi Set_BOOL Description This function is to set a value to a Win GRAF Boolean variable Syntax UserShare Set_BOOL ushort iUserAddress byte iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the status For instance iStatus 1 for True iStatus 0 for False Example Set the Win GRAF BOOL variable with address 1 to True UserShare Set_BOOL Convert ToUInt16 1 1 Demo program CD ROM napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp01 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 6 HM Get_BOOL Descrip
23. tion This function is to get the value from a Win GRAF BOOL variable Syntax UserShare Get_BOOL ushort iUserAddress out byte iStatus Parameter iUserAddress Address of Variable 1 to 8191 iStatus Get the variable status iStatus 1 for True iStatus 0 for False Example Byte iStatus 0 Get the value of Win GRAF BOOL variable with address 1 UserShare Get_BOOL Convert ToUInt16 1 out iStatus Demo program CD ROM napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp01 Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 14 7 14 5 2 R W Integer Functions MI Set_SINT Hf Set_INT Mf Set_DINT lf Set_LINT Description These functions are to set 8 bit Integer 16 bit Integer 32 bit integer amp 64 bit Integer value to Win GRAF integer variables Syntax UserShare Set_SINT ushort iUserAddress sbyte iStatus UserShare Set_INT ushort iUserAddress short iStatus UserShare Set_DINT ushort iUserAddress int iStatus UserShare Set_LINT ushort iUserAddress long iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 8 bit Integer 16 bit Integer 32 bit Integer or 64 bit Integer Example Set a 32 bit integer value 1234567 to the Win GRAF DINT variable with address 1 int temp1 1234567 UserShare Set_DINT Convert ToUInt16 1 temp Set a 16 bit integer value 1234 to the Win GRAF INT variable with address 2 short temp2 1234
24. to 1024 String_val The name of String variable Variables description Name Type Description Init BOOL Set the initial value as TRUE TRUE Binding succeeds ye eect FALSE Binding fails msg1 STRING Length is 100 String variable for demo purpose 2 TRING L h 2 ve 2 SERENS NOTE The String length could be 1 to 255 msg3 STRING Length is 60 ST program If init then Init false add address 1 for share string val Tmp_val pub_string 1 msg1 add address 2 for share string val Tmp_val pub_string 2 msg2 add address 3 for share string val Tmp_val pub_string 3 msg3 End_if Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 3 13 3 Create a new VB NET project 1 First run Microsoft Visual Studio NET 2008 software and then choose File gt New Project New Project New File Shift Alt N Open Project Microsoft Ctrl O 5 Open Web Site ShiftrAlt O Visual Studio 2008 2 Click Smart Device on the left and then select NET Framework 3 5 and Smart Device Project Entering a proper project name and click OK AR TES NET Framework 3 5 qaa S Visval Basic isual Studio installed templates a Windows a Web Smart Device a H Office Database Smart Device Reporting Project Test ASR My Templates Other Languages Other Project Types Test Projects Sear
25. vert Tolnt16 1234 Set a 64 bit Integer value 123456789012345 to the Win GRAF LINT variable with address 3 UserShare Set_LINT Convert ToUInt16 3 Convert Tolnt64 123456789012345 Set a 8 bit Integer value 125 to the Win GRAF SINT variable with address 4 UserShare Set_SINT Convert ToUInt16 3 Convert ToSByte 125 Demo Program CD ROM 1 napdos Win GRAF demo project vb net_2008_demo demo_vb02 for R W analog I O 2 napdos Win GRAF demo project vb net_2008_demo demo_vb03 for R W internal long integer Timer and Real floating point values Win GRAF User Manual V 1 02 Mar 2015 by ICP DAS 13 10 MI Get_SINT Mf Get_INT W Get_DINT W Get_LINT Description These functions are to get 8 bit integer 16 bit integer 32 bit integer amp 64 bit integer value from Win GRAF integer variables Syntax UserShare Get_SINT ByVal iUserAddress As System UInt16 ByRef iStatus As SByte As Byte UserShare Get_INT ByVal i UserAddress As System UInt16 ByRef iStatus As Short As Byte UserShare Get_DINT ByVal iUserAddress As System UInt16 ByRef iStatus As Integer As Byte UserShare Get_LINT ByVal i UserAddress As System UInt16 ByRef iStatus As long As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 8 bit integer 16 bit integer 32bit integer or 64 bit integer value Example Dim Dlong_val As Int64 Dim short_val As Int16 Dim long_val As Int32 Dim
Download Pdf Manuals
Related Search
Win GRAF User Manual kit graf 34 user guide kit graf 34 manual kit graf 342 manual kit graf 34201 manual
Related Contents
ADTRAN Total Access 750 User's Manual 468KB - 古河テクノマテリアル Schaub Lorenz 26LE-4800CT User's Manual Composants du ciseau Deluxe Twist & Fold Activity Gym & Play Mat™ Instructions callpilot desktop messaging user guide 医療機器の添付文書の記載例について(PDF:1695KB) CDX-GT620U Copyright © All rights reserved.
Failed to retrieve file