Home
Data-Sharing API Driver User Manual - Pro
Contents
1. DSAPI_AddVariable UINT32 ST_DSAPI_VARIABLE DSAPI_Init_Ex UCHAR UCHAR UCHAR UCHAR Initializing the Data Sharing API Driver 1 Define the number of targets using DSAPI_SetTarget 2 Create target information IP address and the number of variables set up 3 Register the target information created in Step 2 using DSAPI_AddTarget Targets are mapped with a number starting from zero 0 in the order of regis tration These numbers are administered by the Data Sharing API application 4 Create variable information names and data types 5 Using the variable information created in Step 4 register the number of vari ables in each target using DSAPI_AddVariable Data Sharing API Driver User Manual Initialization Open The order of registered variables corresponds to the Index variable_handler used in Read or Write related functions For details about the order of registered variables see the Index variable_handler section in Chapter 4 6 After targets and variables have been added call DSAPI_Init_Ex to set up the path to the development environment 7 Call DSAPI_Open to open the Data Sharing API Target number setup Call DSAPI_SetTarget 1 Target registration Call DSAPI_AddTarget astTarget 0 Call DSAPI_AddTarget astTarget 1 Variable registration Call DSAPI_AddVariable 0 astVarList1 0 Call DSAPI_AddVariable 0 astVarList1 1 Call DSAPI_AddVariable 0 astVarList1 2 Cal
2. Reads Integer h DSAPI_ Readimeger abies VB UINT32 INT32 DSAPI ReadDiscree Reads Discrete int UINT32 UINT16 E variables VB DSAPI ReadFloat F atvarianes UINT32 float DSAPI ReadSting String variables UINT32 LPTSTR DSAPI Writeinteger N tes Integer int UINT32 INT32 variables VB DSAPI WrieDiscrete rie Discrete int UINT32 UINT16 variables VB DSAPI WriteFloat Hie Bbalvalatis UINT32 float DSAPI_ Writes ting en variables UINT32 LPCTSTR Data Sharing API Driver User Manual 11 Data Sharing API Driver Interface 12 Name Category Parameters Return Remarks Name Category Parameters Return Remarks DSAPI Init Win32 UINT32 nTargetCount Defines number of targets ST_DSAPI_PATH stPath Sets up structure necessary for initialization ST_DSAPI_TARGET pstTargetList Pointer to target information list void Registers the values for various settings for the Data Sharing API This function only registers values internally for the driver The next step is to callDSAPI_Open ST_DSAPI PATH UNICHAR puncLibPath Path to RuntimeAdapter dll UNICHAR puncCurrentPath Path to current execution directory UNICHAR puncSystemPath Path to system directory UNICHAR puncConfigPath Path to configuration file Example C Program Files pro face Docs CFG project cfg ST_DSAPL VARIABLE UNICHAR aunc VarName 60 Variable name BYTE by VarType Variable data type VAR_TYPE_INT 0 VAR_
3. false Use this function to read in data from Float variables DSAPI ReadString Win32 UINT32 nIndex Data list handler LPTSTR pucData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from String variables Data Sharing API Driver User Manual Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Data Sharing API Driver Interface DSAPI Writelnteger Win32 UINT32 nIndex Data list handler INT32 pnData Pointer to 32bit data int Return value If operation is successful true If operation failed false Use this function to write data to Integer variables DSAPL WriteDiscrete Win32 UINT32 nIndex Data list handler UINT16 psData Pointer to Boolean data int Return value If operation is successful true If operation failed false Use this function to write data to Discrete variables DSAPI WriteFloat Win32 UINT32 nIndex Data list handler float pfData Pointer to Float data int Return value If operation is successful true If operation failed false Use this function to write data to Float variables DSAPI WriteS tring Win32 UINT32 nIndex Data list handler LPCTSTR pucData Pointer to String data int Return value If oper
4. 2 VAR_TYPE_DISCRETE 3 ST_DSAPL TARGET UNICHAR puncIPAddress IP address of the target machine UINT32 nVariableCount Number of variables ST_DSAPI_VARIABLE pstVariable Pointer to variable list Data Sharing API Driver User Manual 19 Data Sharing API Driver Interface Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks 20 DSAPL Open WinCE None int Return value If operation is successful true If operation failed false Loads the DataSharing API library into memory and obtains the address for each method Registers the function that is called when data is updated in the driver or the variables to be shared The variable list and other setup items are necessary when this function is called Be sure to call DSAPI_Init to set up all the necessary items before using DSAPI_Open DSAPI Close WinCE None int Returned value If operation is successful true If operation failed false Closes the Data Sharing functions Releases the loaded library from memory DSAPI Read WinCE UINT32 nIndex Defines the Index number of data in the data list void pvData Retums the pointer to stored data UINT16 pnDataType Returns data type bool Return value When data has changed true When data has not changed false nIndex Defines which variable in the variable list to read pwWata pnDataType
5. When data gets updated the pointer stored in this location identifies the data type Data Sharing API Driver User Manual Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Data Sharing API Driver Interface DSAPI Write WinCE UINT32 nIndex Data list handler void pvData Pointer to the write data bool Return value If operation is successful true If operation failed false Defines a handler and writes data to the corresponding variable DSAPI GetError WinCE None int When this function is called returns error information Because error information is overwritten every time an error occurs this function always returns the latest error RTA_CONNECTING 0 RTA_CONNECTED 1 RTA_TAGNAME ERROR 2 RTA_TOO_MANY_TAGS_ERROR 3 RTA_VERSION_ERROR 4 DSAPI Setlarget WinCE UINT32 nTargetCount The number of targets to register void When using DSAPI_lnit_Ex use this function to register the number oftargets DSAPI Addlarget WinCE UNICHAR pucIPAddress IP address of the target machine UINT32 nVariableCount Number of variables int Return value If operation is successful true not 0 If operation failed false 0 Registers target information such as IP address and number of variables Data Sharing API Driver User Manual 21 Data Shar
6. 2 UCHAR pucLibPath Path to RuntimeA dapter dll UCHAR pucCurrentPath Path to current execution directory UCHAR pucSystemPath Path to system directory UCHAR pucConfigPath Path to configuration file void When DSAPI_lnit is not used use this function instead Prior to using the DSAPI_Open function use this function to register necessary information DSAPI_SetTarget DSAPI_AddTarget and DSAPI_AddVariable to the Data Sharing API driver Data Sharing API Driver User Manual 15 Data Sharing API Driver Interface Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks 16 DSAPL Readinteger Win32 UINT32 nIndex Data list handler INT32 pnData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from Integer variables DSAPI ReadDiscrete Win32 UINT32 nIndex Data list handler UINT 16 psData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from Discrete variables DSAPI KeadHoat Win32 UINT32 nIndex Data list handler float pfData Returns the pointer to the stored data int Return value If data has changed true If data has not changed
7. API Driver DSAPIDriver dll for Win32 void int int bool bool int int int int void int int void int int int int int int int int 10 DSAPI_Init UINT32 ST_DSAPI_PATH ST_DSAPI_TARGET DSAPI_Open DSAPI_Close DSAPI_Read UINT32 void UINT16 DSAPI_Write UINT32 void DSAPI_GetError DSAPI_Connect DSAPI_Disconnect DSAPI_Shutdown DSAPI_SetTarget UINT32 DSAPI _AddTarget ST_DSAPI_TARGET_MB DSAPI AddVariable UINT32 ST_DSAPI_VARIABLE_ MB DSAPI_Init_Ex UCHAR UCHAR UCHAR UCHAR DSAPI_Readinteger UINT32 INT32 DSAPI_ReadDiscrete UINT32 UINT16 DSAPI_ReadFloat UINT32 float DSAPI _ReadString UINT32 LPTSTR DSAPI_Writelnteger UINT32 INT32 DSAPI_WriteDiscrete UINT32 UINT16 DSAPI_WriteFloat UINT32 float DSAPI_WriteString UINT32 LPCTSTR Data Sharing API Driver User Manual Data Sharing API Driver Interface Description Retum Parameters DSAPI Init Initializes the void UINT32 ST_DSAPI PATH Data S haring AP I ST_DSAPI TARGET Opens the Closes the DSAPI Read Reads data bool UINT32 void UINT16 DSAPI Wire Writs dat boot None DSAPI Gerror UINT32 void DSAPI Connect Connects variables DSAPI_Disconnect Cuts the connection DSAPI Seffarget See DEU ag UINT32 7 targets DSAPI_AddTarget PED ETE Erde int ST_DSAPI TARGET MB attributes Registers variable UINT32 Initialization function i UCHAR UCHAR UCHAR DSAPI_Init_Ex VB UCHAR
8. PEN 6 Differences in VB and Visual C Development unusssunnnnnnnnnnnnnnenn 6 Initializing the Data Sharing API Driver uuusssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 6 Changing the Registered Variables uuuunnnssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 7 Using DSAPI_Connect and DSAPI_Disconnect unusssseennnnnnnnnnnnnenn 8 CHAPTER 4 READ WRITE DATA 9 Index var able h ndler 9 DSAPIL Add Varlablel u ee 9 CHAPTER 5 DATA SHARING API DRIVER I F 10 DSAPIDriver dil for Win32 uuuuunsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nn 10 DSAPIDriver dil for WinCE 000000000000000000000nnnnnnnnn Ran nn nnnnn nun 18 CHAPTER 6 RESTRICTIONS 25 Restrictions of the Data Sharing API Driver uunnsssnnnnnunnnnnnnnnnnnnnnnnnn 25 N Data Sharing API Driver User Manual Chapter 1 Overview Data Sharing API and the Data Sharing API Driver operate as a process of the Data Sharing API application Data Sharing API Application Sample Sample Code Code for VB for VC Pro Designer DSAPIDriver dll for Win32 DSAPIDriver dll for WinCE RuntimeAdapter dll for Win32 RuntimeAdapter dll for WinCE Diagram 1 1 Process Module Image You can create your Data Sharing API application using the Data Sharing API functions directly However the Data Sharing API is designed for Visual C VC users Visual Basic VB users may find the structure s
9. PI Driver Interface 24 Name Category Parameters Return Remarks Name Category Parameters Return Remarks DSAPL WriteFloat WinCE UINT32 nIndex Data list handler float pfData Pointer to Float data int Return value If operation is successful true If operation failed false Use this function to write data to Float variables DSAPI WriteString WinCE UINT32 nIndex Data list handler LPCTSTR pucData Pointer to String data int Return value If operation is successful true If operation failed false Use this function to write data to String variables Data Sharing API Driver User Manual Chapter 6 Restrictions Because the Data Sharing API Driver uses the Data Sharing API restrictions depend on the limitations in the Data Sharing API This chapter explains the main restrictions in the Data Sharing API Driver For detailed information refer to the Data Sharing API User Manual Restrictions of the Data Sharing API Driver e The maximum number of target machines that can be connected is 16 e There is a limit to the number of variables that can be used for data sharing The following table shows the standard maximum Access Count allowed for each type of target machine i Access Count Windows Compatible PC 400 PL Series GP PSP Factory Gateway However the maximum value given here is not a design limit rather a value given that considers the performance speed of data updates
10. Pro face Human Machine Interface Pro face Data Sharing API Driver A User Manual Preface Thank you for purchasing Pro face s Pro Designer software The Data Sharing API Driver has been developed to make it easier to use the Data Sharing API the program module for accessing Pro Designer variables from a custom user application hereafter referred to as Data Sharing API applica tion The Data Sharing API Driver is provided with Pro Designer This manual explains the functional specifications of the Data Sharing API Driver When actually programming the Data Sharing API application use this document in combination with the sample source code lt Important gt 1 The copyrights to all programs and manuals included in the Pro Designer software hereafter referred to as this product are reserved by the Digital Electronics Corpo ration Digital grants the use of this product to its users as described in the END USER LICENSE AGREEMENT documentation Any actions violating the above mentioned agreement is prohibited by both Japanese and foreign regulations 2 The contents of this manual have been thoroughly inspected However if you should find any errors or omissions in this manual please inform your local representative of your findings 3 Regardless of article 2 the Digital Electronics Corporation shall not be held liable by the user for any damages losses or third party claims arisi
11. TYPE_FLOAT 1 VAR_TYPE_STRING 2 VAR_TYPE_DISCRETE 3 ST_DSAPL TARGET UNICHAR puncIPAddress IP address of target machine UINT32 nVariableCount Number of variables ST_DSAPI_VARIABLE pstVariable Pointer to variable list DSAPI Open Win32 None int Return value If operation is successful true If operation failed false Loads the Data Sharing API library into memory and obtains the address for each method Registers the function that is called when data is updated in the driver or the variables to be shared The variable list and other setup items are necessary when this function is called Be sure to call DSAPI_Init to set up all the necessary items before using DSAPI_Open Data Sharing API Driver User Manual Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Data Sharing API Driver Interface DSAPI Close Win32 None int Return value If operation is successful true If operation failed false Closes the Data Sharing functions Releases the loaded library from memory DSAPI Read Win32 UINT32 nIndex Data list handler void pvData Returns the pointer to stored data UINT16 pnDataType Returns data type bool Return value When data has changed true When data has not changed false nIndex Defines which variable in the variable list to read pwData pnDataType When data ge
12. These values ultimately will depend on the amount of screen data to be processed as well as other factors e When using this Data Sharing API Driver with VB data types that are not supported by the VB programming language such as unsigned Integers cannot be supported Data Sharing API Driver User Manual 25
13. ation is successful true If operation failed false Use this function to write to String variables Data Sharing API Driver User Manual 17 Data Sharing API Driver Interface DSAPIDriver dll for WinCE void int int bool bool int void int int void int int int int int int int int DSAPI_Init UINT32 ST_DSAPI_PATH ST_DSAPI_TARGET DSAPI_Open DSAPI_Close DSAPI_Read UINT32 void UINT16 DSAPI_Write UINT32 void DSAPI_GetError DSAPI_SetTarget UINT32 DSAPI_AddTarget UNICHAR UINT32 DSAPI_AddVariable UINT32 UNICHAR BYTE DSAPI_Init_Ex UNICHAR UNICHAR UNICHAR UNICHAR DSAPI_Readinteger UINT32 INT32 DSAPI_ReadDiscrete UINT32 UINT 16 DSAPI_ReadFloat UINT32 float DSAPI_ReadString UINT32 LPTSTR DSAPI_Writelnteger UINT32 INT32 DSAPI_WriteDiscrete UINT32 UINT16 DSAPI_WriteFloat UINT32 float DSAPI_WriteString UINT32 LPCTSTR Name Deseription Retum Parameters Initalizes Data S haring UINT32 ST_DSAPI PATH DSAPI Open O pens Peer nal int None API DSAPI Read Reads data bool UINT32 void UINT16 DSAPI Write Writes data bool UINT32 void DSAPI GetError DSAPI Seffarget Seb NranummeEot UINT32 targets DSAPI AddTarget ege Ers uret int UNICHAR UNIT32 attributes DSAPI AddVariable Registers variable int UNIT32 UNICHAR BYTE attributes Initialization function l UNICHAR UNICHAR ee VB UNICHAR UNICHAR 18 Data Sharing API D
14. crete DSAPI_WriteFloat ADSAPI_WriteString Index variable_handler depends on the order variables were registered during initialization If there is just one target the order of registered variables is applied directly to Index variable_handler and corresponds to the handlers returned by the Data Sharing API and Data Sharing API Driver When an Integer variable is the first registered variable in the Data Sharing API application use the following to write data to this variable void pvData INT32 nData nData 128 pvData void amp nData Convert Integer variable to void type vari able pDSAPI_Write 0 pvData Write data to the variable in the 0 index Variables are sequentially ordered When multiple targets are registered the first variable of the next target is the variable next to the previous target s last variable DSAPI_AddVariable When DSAPI_AddVariable is used instead of DSAPI_Init it does not use the number of variables that had been registered in each target with DSAPI_AddTarget Instead it uses as the upper limit the number of variables registered using DSAPI_AddVariable Essentially the first Index variable_handler of each target can be easily calculated by controlling the number of variables set up in each target Data Sharing API Driver User Manual 9 Chapter 5 Data Sharing API Driver I F The standard prefix used in the Dat Shring API Driver is as follows DSAPI_ DS
15. ing API Driver Interface Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks 22 DSAPI AddVariable WinCE UINT32 nTargetNum Defines the target UNICHAR auc VarName Variable name BYTE byVarType Variable data type int Return value If operation is successful true not 0 If operation failed false 0 Registers the variable name and type to the variable information in the defined target DSAPI Init_Ex WinCE UNICHAR pucLibPath Path to RuntimeA dapter dll UNICHAR pucCurrentPath Path to current execution directory UNICHAR pucSystemPath Path to system directory UNICHAR pucConfigPath Path to configuration file void When DSAPI_lnit is not used use this function instead Prior to using the DSAPI_Open function use this function to register necessary information DSAPI_SetTarget DSAPI_AddTarget and DSAPI_AddVariable to the Data Sharing API driver DSAPI Readinteger WinCE UINT32 nIndex Data list handler INT32 pnData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from Integer variables DSAPI ReadDiserete WinCE UINT32 nIndex Data list handler UINT 16 psData Returns the pointer to the stored data int Return val
16. l DSAPI_AddVariable 0 astVarList1 3 Call DSAPI_AddVariable 1 astVarList2 0 Call DSAPI_AddVariable 1 astVarList2 1 Call DSAPI_AddVariable 1 astVarList2 2 Call DSAPI_AddVariable 1 astVarList2 3 Initialization of various setup items for VB Call DSAPI_Init_Ex strLibPath strCurrentPath strSystemPath strConfigPath Open DSAPI Call DSAPI_Open Changing the Registered Variables DBAPI _Opencan be executed only once in a single process If you wish to change more than once 2 or more times the settings of the vari ables used for data transfer while an application is running use DBAPI Connect and DAPI Di sconnect instead of DBAPI_Openand DBAPI A ose Data Sharing API Driver User Manual 7 Initialization Open Using DSAPI_Connect and DSAPI_Disconnect 1 Call DSAPI_ Disconnect 2 Set the number of targets using DSAPI_SetTarget 3 4 Register the target information created in Step 3 using DSAPI_AddTarget Create target information the IP address and number of variables to set up Targets are mapped with a number starting from zero 0 in the order of regis tration These numbers are administered by the Data Sharing API application 5 Create variable information names and data types 6 Using the variable information created in Step 5 register the number of vari ables in each target using DSAPI_AddVariable The order of registered variables corresponds to the Inde
17. llows e Target IP Address e Number of variables to be accessed e Variable List This information is defined by the structure data type ST_DSAPI_TARGET Variable Name Variable Type Variable Name IP Address Target No Variable List Variable Type Variable Type Variable Name Variable Name Diagram 2 1 Data Image of Target Information Data Sharing API Driver User Manual Data Sharing API Driver System Variable Data storage area The four basic variable data types are Integer Float String and Dis crete Setup requirements are as follows e Variable name e Data Type This information is defined by the structure data type ST_DSAPI_VARIABLE Environment Settings When using the Data Sharing API driver the following files need to be present in the Application s environment Project cfg This is the Data Sharing API setting file For details refer to the Data Sharing API User Manual An example project cfg is provided in the Pro Designer Docs CFG folder When you wish to use this file simply copy it from this folder DSAPIDriver dll This is the Data Sharing API driver This file is located in the Pro Designer Docs Samples DSAPIDriver DLL folder Here there are two versions for Win32 and for Windows CE When required copy the desired file to a folder in the Application s path Any machine used to run an application must also have either Pro Designer Editor Pro Designer Runti
18. me or Pro Server Communication Tool installed When using Windows CE if you copy the above files to a folder other l than Storage Card1 be sure to use My Computer gt Control Panel Important _ Backup to create a backup Data Sharing API Driver User Manual 5 Chapter 3 Initialization Open This chapter explains the initialization process for the Data Sharing API Driver Among all the processes initialization is the most complex Setup requirements are as follows e Environment setup such as path e Target information such as IP address e Registration of variables you want to reference Specifically the setting that enables you to access Pro Designer variables is defined in the target properties In other words the variable list depends on the target information Differences in VB and VC Development The basic process of an application developed using the Data Sharing API Driver ni ti ali zati on gt en gt Read Wite gt d ose This process will not change even if the Data Sharing API application is devel oped in a VB or VC environment However due to limitations in the VB language VC or VC pointers to structure data types cannot be set up as a user defined type in VB As a result you cannot use DSAPI_Int to assign parameter values Rather than using DSAPI_Int VB is supported by the following initialization functions DSAPI_SetTarget UINT32 DSAPI_AddTarget ST_DSAPI_TARGET
19. ng from the uses of this product 4 Differences may occur between the descriptions found in this manual and the actual functioning of this product Therefore the latest information on this product is pro vided in data files i e Readme txt files etc and in separate documents Please consult these sources as well as this manual prior to using the product 5 The specifications set out in this manual are for overseas products only As a result some differences may exist between the specifications given here and for those of the identical Japanese product 6 Even though the information contained in and displayed by this product may be related to intangible or intellectual properties of the Digital Electronics Corporation or third parties the Digital Electronics Corporation shall not warrant or grant the use of said properties to any users and or other third parties All company manufacturer names used in this manual are the registered trade marks of those companies Copyright 2002 Digital Electronics Corporation Data Sharing API Driver User Manual 1 Preface Table of Contents PREFACE ssssssscossasesiesesestesesecentadesssieossiussiessossdsacosssnnsssevacsuscsdssusiocssbsecesssausteuseseustoessse 1 TABLE OF CON TEN UG icsssaccecasitcccsssccccssaivecdsetesaocdsasstetasavsencionscesiacecsencceasieecasssvansd 2 CHAPTER 1 OVERVIEW CHAPTER 2 STRUCTURE Environment Settings 20ER ee 5 CHAPTER 3 INITIALIZATION O
20. omewhat compli cated The Data Sharing API Driver is designed to make the API structure as simple as possible to meet the needs of users who want to program an application easily IN The Data Sharing API Driver is used by loading the Data Sharing API E Important Any restrictions depend on the limitations of the Data Sharing API For program limitations refer to the Data Sharing API User Manual Data Sharing API Driver User Manual 3 Chapter 2 Structure Functions provided by the Data Sharing API Driver are divided into five major categories Initialize Driver registers various values necessary for using the Data Sharing API Open Initializes the Data Sharing API using the registered values Close Runs the exit process Read Using a variable handler reads in the corresponding data Write Using a variable handler writes a value to the corresponding variable The process of an application using these functions Initialization gt Open Read Write gt Close Appropriate functions differ according to the development environment VB or Visual C For information on the step by step processes in each case refer to the sample source code To use the functions in the Data Sharing API Driver you should understand the data structure A simple explanation follows Target A computer that runs Pro Designer Runtime Projects created in Pro Designer are downloaded to a target Setup requirements are as fo
21. p using DSAPI_SetTargetO DSAPI_AddTarget and DSA PI_Add Variable DSAPI Shutdown Win32 None int Return value If operation is successful true If operation failed false Ends the Data Sharing API process Typically DSAPI_Close is used to end the process However when DSAPI_Disconnect is used to disconnect from the Data Sharing API this function must be used to end the process Data Sharing API Driver User Manual Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Data Sharing API Driver Interface DSAPI Setlarget Win32 UINT32 nTargetCount The number of targets to register void When using DSAPI_lnit_Ex use this function to register the number of targets DSAPI Addlarget Win32 ST_DSAPILTARGET_MB pstTargetList Pointer to the target information list int Return value If operation is success ful true not 0 If operation failed false 0 Registers the target information such as IP address and number of variables DSAPI AddVariable Win32 UINT32 nTargetNum Defines the target ST_DSAPI_VARIA BLE_MB pstVariable Pointer to the variable int Return value If operation is success ful true not 0 If operation failed false 0 Registers the variable name and type to the variable information in the defined target DSAPI Init_Ex Win3
22. river User Manual Data Sharing API Driver Interface Name 1 eseription Parameters Reads Integer DSAPI_Readneger abies vB UINT32 INT32 DSAPI ReadDiscree Reads Discrete int UINT32 UINT16 variables VB DSAPI ReadFloat ce es UINT32 float DSAPI ReadSting String variables UINT32 LPTSTR DSAPI Writeinteger Wes Integer int UINT32 INT32 E variables VB DSAPI WrieDiscrete Wrts Discrete int UINT32 UINT16 variables VB DSAPI WriteFloat m Epalvalatis UINT32 float Writes S tring variables UINT32 LPCTSTR DSAPI_ WriteS tring VB Name DSAPI Init Category A WinCE Parameters UINT32 nTargetCount Defines the number of targets ST_DSAPI_PATH stPath Sets up the data structure data necesary for initialization ST_DSAPI_TARGET pstTargetList Pointer to target information list Return void Remarks Registers the values for various settings for the Data Sharing API This function only registers values internally for the driver The next step is to call DSAPI_Open ST_DSAPL PATH UNICHAR puncLibPath Path to RuntimeA dapter dll UNICHAR puncCurrentPath Path to current execution directory UNICHAR puncSystemPath Path to system directory UNICHAR puncConfigPath Path to configuration file Example Storage Card l project cfg ST_DSAPL VARIABLE UNICHAR auncVarName 60 Variable name BYTE by VarType Variable data type VAR_TYPE_INT 0 VAR_TYPE_FLOAT 1 VAR_TYPE_STRING
23. ts updated the pointer stored in this location identifies the data type DSAPL Write Win32 UINT32 nIndex Data list handler void pvData Pointer to the write data bool Return value If write operation is success ful true If write operation failed false Defines a handler and writes data to the corresponding variable Data Sharing API Driver User Manual 13 Data Sharing API Driver Interface 14 Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks DSAPI GetError Win32 None int When this function is called returns error information Because error information is overwritten every time an error occurs this function always returns the latest error RTA_CONNECTING 0 RTA_CONNECTED 1 RTA_TAGNAME ERROR 2 RTA_TOO_MANY_TAGS_ERROR 3 RTA_VERSION_ERROR 4 DSAPI Connect Win32 None int Return value If operation is successful true If operation failed false Connects to the Data Sharing API using the defined target and variable information DSAPI Disconnect Win32 None int Return value If operation is successful true If operation failed false Disconnects from the Data Sharing API and clears the target and variable information To reconnect to the Data Sharing API using DSAPI_Connect target and variable information must first be set u
24. ue If data has changed true If data has not changed false Use this function to read in data from Discrete variables Data Sharing API Driver User Manual Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Name Category Parameters Return Remarks Data Sharing API Driver Interface DSAPI ReadFloat WinCE UINT32 nIndex Data list handler float pfData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from Float variables DSAPI ReadS tring WinCE UINT32 nIndex Data list handler LPTSTR pucData Returns the pointer to the stored data int Return value If data has changed true If data has not changed false Use this function to read in data from String variables DSAPI Writelnteger WinCE UINT32 nIndex Data list handler INT32 pnData Pointer to 32bit data int Return value If operation is successful true If operation failed false Use this function to write data to Integer variables DSAPI WriteDiscrete WinCE UINT32 nIndex Data list handler UINT16 psData Pointer to Boolean data int Return value If operation is successful true If operation failed false Use this function to write data to Discrete variables Data Sharing API Driver User Manual 23 Data Sharing A
25. x variable_handler used in Read or Write related functions For details about the order of registered variables see the Index variable_handler section in Chapter 4 After targets and variables have been added call DSAPI_Connect to reestablish the connection to the Data Sharing API Disconnect Call DSAPI Disconnect Target number setup Call DSAPI_SetTarget 1 Target registration Call DSAPI_AddTarget astTarget 0 Call DSAPI_AddTarget astTarget 1 Variable registration Call DSAPI_AddVariable 0 astVarList1 0 Call DSAPI_AddVariable 0 astVarList1 1 Call DSAPI_AddVariable 0 astVarList1 2 Call DSAPI_AddVariable 0 astVarList1 3 Call DSAPI_AddVariable 1 astVarList2 0 Call DSAPI_AddVariable 1 astVarList2 1 Call DSAPI_AddVariable 1 astVarList2 2 Call DSAPI_AddVariable 1 astVarList2 3 Reconnect Call DSAPI Connect YN a Important The When performing either reset or initialization be sure to perform all steps in the order given Data Sharing API Driver User Manual Chapter 4 Read Write Data Index variable_handler Index variable_handler must be used as the first parameter in each of the read and write functions listed below This chapter explains how Index variable_handler is applied to variables DSAPI_Read ADSAPI_Write DSAPI Readlnteger ADSAPI_ ReadDiscrete ADSAPI_ ReadFloat DSAPI_ReadString ADSAPI_Writelnteger ADSAPI_WriteDis
Download Pdf Manuals
Related Search
Related Contents
Release Notes - Logistic Engineering Services dvd portátil lease este instructivo antes de usarse manual del usuario #Delete YA-0352 TSP100LAN Hardware Manual Plus d`informations sur les produits CAMSPORTS sur http://www Step 1 - Illinois State Board of Education 1.1 調査の目的 カタログダウンロード(PDF 277kb) Copyright © All rights reserved.
Failed to retrieve file