Home

NAP7000P User Manual - Measurement Computing

image

Contents

1. 6 9 VC Demo Programs A wide variety of demo programs showing the usage of the 7000W31 DLL are provided The following provides a very brief description of the demos provided Demo20 17000_Analogln demol Demo21 17000_AnalogIn demo2 Demo22 17000_AnalogIn8 demo Demo23 17000_AnalogOut demo Demo24 17000_Digitalln demo Demo25 _ 17000_DigitalOut demo Demo26 multi speed demo Demo27 17000_17017InS demo Demo28 17000_AnalogOutReadBack demo Demo29 _ 17000_DigitalOutReadBack demo Demo30 17000_NetworkAnalogIn demo Demo3 1 17000_NetworkDigitalIn demo 6 10 7000W31 DLL Driver Source The driver source of 7000W31 DLL are given as following NAP7000P W3 1 7000W31 7000w31 h declaration file NAP7000P W31 7000W31 7000w3 1 def definition file NAP7000P W3 1 7000W3 1 7000w31 mak NMAKE file NAP7000P W3 117000W3 117000w31 c program source file e Use VC 2 0 to make this DLLs 28 For Your Notes 29 For Your Notes 30 31 Measurement Computing 10 Commerce Way Norton MA 02766 508 946 5100 Fax 508 946 9500 info mccdag com www mccdag com
2. 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szResult the starting address of the result string terminated with 0 wTimeOut constant for time out control unit 1ms wCheckSum 0 DISABLE 1 ENABLE O Return Value NoError OK others Error code refer to 7000W31 H 25 6 5 Send_Receive_Cmd Description This DLL will send a command stri ng to CB 7000 then receive the result string from I 7000 This DLL will call Send_Cmd first Then call Receive _Cmd next Syntax WORD Send_Receive_Cmd char cPort char szCmd char szResult WORD wTimeOut WORD wCheckSum Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 szResult the starting address of the result string terminated with 0 wTimeOut constant for time out control unit 1ms wCheckSum 0 DISABLE 1 ENABLE Return Value NoError OK others Error code refer to 7000W31 H 6 6 Send_Str Description This DLL will send a command to a general purpose RS 232 device This DLL is very sim ilar to Send_Cmd except that this DLL will not add any char to the input string Syntax WORD Send_Str char cPort char szCmd WORD wTimeOut WORD wLenT Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 wTimeOut constant for time out control unit 1ms w
3. 1 Introduction The NAP7000P is a Windows DLL designed for Windows 3 1 95 NT user It can be called by VC BC VB Delphi BC Builder LabVIEW and TestPoint Some of the key features of NAP7000P are shown below 1 multi tasking DLLs design 2 multi threaded DLLs design 3 provide general purpose RS 232 application functions 4 provide general purpose CB 7000 send receive functions 5 provide high performance CB 7000 application functions 6 multi speed demos 7 multi data format demos 8 includes over 40 demo programs 9 provides complete diagnostic amp utility program ICPCON EXE 1 1 Readme doc We will co ntinuously upgrade this software NAP70 OP Therefore some in formation may not be given in this manual All the ex tra information will be given in the readme doc There are many readme doc given in the companion floppy disk as following The contents of readme doc can be as following release notes user manual updates demo program documentation compiler amp link documentation application notes We recommended you read the readme doc file prior to using this software 2 Windows 95 NT Applications The UART DLL amp I7000 DLL are Win32 DLLs drivers designed for Windows 95 and Windows NT 3 51 4 0 applications The user can use many programming languages such as VC BC BC Builder VB and Delphi There are also many demo program provided for VC VB Delphi and BC Builder User programs which call U
4. cactus sents Odia Saa e 12 5 5 17000 ANATOG N cui ie eee 12 5 6 17000 ANALOGING coria lA dt lito ates ences 14 A NO 15 SO OOO ANA O GOT ie 16 5 9 17000 ANALOGOUTREADBACK cesccssssecesseeesseceeeesnceceueeseaeeceseeeeaaeceseeseaaeceseeseaaeceeeseaaecenees 17 5 10 T QOOSDIGIPALIN EREE EAEE EER eS 18 5 11 17000 DIGITAL UT ici E Ea SAE EIE EAE S 19 5 12 17000_DIGITALOUTREADBACK osessseessesssesessseeseresseeeseesseeseesreeseessteseresoteeseeeseeseesresseesereseeee 20 5 13 T7000 NETWORKANALOGIN esinen ranana e aa a its 21 5 14 17000 NETWORKDIGITALIN panee a E A a A T E R 22 5 15 VCI7000 DEMO PROGRAMS viii a e ten Deters eg E eias 23 5 16 TO00DLL DRIVER SOURCE ioii ainei Erei A EEEE OE A E R 23 7000W31 DLL FOR WINDOWS 3 1 esssesesesesssoseoeseoscesscoseooscossoeseosseseceseossesseeseceseeseessceseoseeseeese 24 6 1 OPEN COM rocas EKOE REEE vaste cde A cute tes da aida 24 6 2 7 CLOSE COM A A rows cane Baka antes tesa A So 24 O53 GSENDYCMD Gs A E E T E E E 25 6 4 RECEIVE CMD riie scadedas ir A ER ae E dad shee AOE E 25 6 5 SEND RECEIVE UMD iio ponrcaitn nel e o a n a e E cbs 26 6 6 SEND S TReni aa aa a a aa a te aa aa a aa a an 26 63 eE E D DA ESA I AE A E E T S E ido 27 6 8 SEND REGEIVE O TResiri di a tdi 27 6 9 VC DEMO PROGRAMS icics scsseare sevens docoushintanbevedecovsubtesnuvasducteniesseuecelecuncoveucevuestnsuteyvesdesvegsesveettess 28 6 10 7000W31 DLL DRIVER SOURCE n E E i oseveceivens coveusionseneentse 28
5. checksum disable Demo2 send receive command to CB 7000 with checksum enable Demo3 send receive command to Counter ANC PC 202 Demo4 send receive command to OMRON PLC CQM1 or C200 Demo5 multi speed demo Demo6 muti data format demo Demo7 multi speed and multi data format demo Demo20 I17000_Analogln demol Demo21 17000_Analog n demo2 Demo22 17000_Analogln8 demo Demo23 17000_AnalogOut demo Demo24 17000 Digitalln demo Demo25 17000 DigitalOut demo Demo26 multi speed demo Demo27 17000_17017In8 demo Demo28 17000_AnalogOutReadBack demo Demo29 17000 DigitalOutReadBack demo Demo30 17000_NetworkAnalogln demo Demo31 17000_NetworkDigitalln demo 4 UART DLL for Windows 95 NT There are six DLL functions provided in the UART DLLs This section briefly describes these functions and the various parameters used in each 4 1 Open_Com e Description This DLL will initialize the COM port This DLL must be called once before the other DLLs are called to send receive command Syntax WORD Open_Com char cPort DWORD dwBaudRate char cData char cParity char cStop O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate dwBaudRate 1200 2400 4800 9600 19200 38400 57600 1 15200 cData 5 6 7 8 data bit cParity 0 NonParity 1 OddParity 2 EvenParity cStop 0 1 stop 1 1 5 stp 2 2 stop NOTE cData 8 cParity 0 cStop 0 for CB 7000 modules O Return Value NoError OK others Error code refer
6. code refer to 7000W31 H 6 2 Close_Com Description This DLL will free all the resources used by Open_Com This DLL must be called before the program exit The Open_Com will return error message if the program exit without calling Close Com function Syntax WORD Close_Com char cPort O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate O Return Value NoError OK others Error code refer to 7000W31 H Oo Demo Program 24 6 3 Send_Cmd Description This DLL will send a command string to CB 7000 If the wCheckSum 1 this DLL will automatically add the two checksum bytes to the input string This DLL will add the 0x0D to the end of the input command string szCmd Syntax WORD Send_Cmd char cPort char szCmd WORD wTimeOut WORD wCheckSum O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 wTimeOut constant for time out control unit 1ms wCheckSum 0 DISABLE 1 ENABLE O Return Value NoError OK others Error code refer to 7000W31 H 6 4 Receive_Cmd Description This DLL will receive a result string from CB 7000 If the wCheckSum 1 this DLL will automatically check the two checksum bytes of the result string This DLL will check the result string terminator 0x0D Syntax WORD Receive_Cmd char cPort char szResult WORD wTimeOut WORD wCheckSum O Input Parameter cPort
7. from CB 7000 Syntax 17000_AnalogIn WORD w7000 float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H 12 e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7011 7012 7013 7014 7017 7018 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 5 channel number for CB 7017 7018 w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendTo7000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table 7000 0 analog input value return w7000 0 cPort port w7000 1 wAddr Address w7000 2 0x7012 ID w7000 3 0 CheckSum disable w7000 4 wTimeOut TimeOut constant normal 100 w7000 6 1 string debug wRet 17000_AnalogIn w7000 7000 szSend szReceive 13 5 6 17000_Analogin8 e Description Read the 8 channels of analog input values from CB 7017 or CB 7018 Syntax 17000_AnalogIn8 WORD w 7000 float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 700
8. table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7050 7060 7067 7042 7043 7044 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 5 16 bit digital output data w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendT07000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table void w7000 0 cPort port w7000 1 wAddr Address w7000 2 0x7053 ID w7000 3 0 CheckSum disable w7000 4 wTimeOut TimeOut constant w7000 5 wDoVal digital output value w7000 6 1 string debug wRet I7000_DigitalOut w7000 7000 szSend szReceive 19 5 12 17000_DigitalOutReadBack e Description Read back the digital output value of CB 7000 series module Syntax 17000_DigitalOutReadBack WORD w7000 float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code r
9. wSendLen string length of send string wReceiveLen string length of receive string O Return Value NoError OK others Error code refer to 17000 H 4 6 Send Receive _Cmd Description This DLL will send a command t o CB 7000 and receive the response result from CB 7000 If the wCheckSum 1 this DLL will automatically add the two checksum bytes to the input string and check the checksum status of the receive string This DLL will add the 0x0D to the end of the i nput string szCmd The Send Receive _Cmd is not a multi task DLL Syntax WORD Send_Receive_Cmd char cPort char szCmd char szResult WORD wTimeOut WORD wCheckSum WORD wT O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the input string terminated with 0 szResult the starting address of the result string wTimeOut constant for time out control unit 1ms wCheckSum 0 DISABLE 1 ENABLE wT time of send receive interval unit 1 ms O Return Value NoError OK others Error code refer to 17000 H 10 5 17000 DLL for Windows 95 NT The I7000 DLL provides a wide variety of high level calls These are described in the following sections For specific information regarding call usage please refer to one of the many demo programs 5 1 Short_Sub_ 2 e Description Compute C A B in short format short 16 bits sign integer This function is provided for testing purpose To test this DLLs
10. 0 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7017 7018 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendT07000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table 7000 0 analog input value of channel_0 7000 1 analog input value of channel_ 1 7000 7 analog input value of channel_7 14 5 7 17000_7017In8 e Description Read the 8 channels of analog input values from CB 7017 This DLL will send high speed command AAA to CB 7017 The 17000_7017In8 is faster than I7000_AnalogIn8 Syntax 17000_7017In8 WORD w7000 float 7000 char szSendTo07000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address f
11. 0x100 If the thread is finished the status value will be larger than 0x100 The return value will be equal to 0x105 if the send receive operation is OK If the wCheckSum in Send_Cmd is 1 the Recom Com Status will check the two checksum bytes of result string If the checksum is incorrect the D13 of return value will be set to 1 Syntax WORD Read_Com_Status char cPort char szResult WORD wT O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szResult the starting address of the result string terminated with 0 wT time of send receive interval unit 1 ms O Return Value D0 D7 thread status code thread start 1 and stop 5 D8 0 send receive not finished if 1 send receive done D9 1 send receive timeout D10 reserved D11 1 Com handle error D12 1 send receive overflow D13 1 checksum error 4 5 Send_Str e Description This DLL will create a th read to send a command and receive the response result from a g eneral purpose RS 232 device The Send_Str is a multi task multi thread DLL This DLL is very similar to Send_Cmd except that this DLL will not add any char to the input string Syntax WORD Send_Str char cPort char szCmd WORD wTimeOut WORD wSendLen WORD wReceiveLen O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 wTimeOut constant for time out control unit 1ms
12. ART DLL amp I7000 DLL can be executed under Windows 95 and Windows NT 3 51 4 0 without changing any code 2 1 UART DLL The PC RS 232 COM port related DLLs are provided in UART DLL The header file of UART DLL is provided in 17000 H The import library of UART DLL is in UART LIB The related files are given in the NAP7000P as following NAP7000P W32 UART uart dll DLLs for Windows 95 NT applications NAP7000P W32 I7000 I7000 h header file for VC NAP7000P W32 UAR Tiuart lib import library for VC NAP7000P W32 BC_LIB uart lib import library for BC and BC Builder 2 2 17000 DLL The I7000 DLL isd esigned for CB 700 0 series app lications The 17000 DLL will call UART DLL to send command and receive result to the CB 7000 series modules The related files are given in the NAP7000P as following NAP7000P W32 17000 i7000 dIl1_ DLLs for Windows 95 NT applications NAP7000P W32 17000 i7000 h header file for VC NAP7000P W32 17000 i7000 lib import library for VC NAP7000P W32 BC_LIB i7000 lib import library for BC and BC Builder 2 3 Required Files The VC user has to include the following five files 1 NAP7000P W32 UART uart dll RS232 related DLLs 2 NAP7000P W32 UAR Tuuart lib Import library of uart dll 3 AINAP7000PW32117000117000 h declaration file for uart dll 8 17000 dll 4 ANAP7000P1W321170001i7000 dll CB 7000 series related DLLs 5 NAP7000P W32 17000 i7000 lib import l
13. LenT string length of send string Return Value NoError OK others Error code refer to 7000W31 H 26 6 7 Receive_Str Description This DLL will receive are sult string from a general purpose RS 232 device This DLL is very similar to Receive _Cmd except that this DLL will not check result string terminator 0x0d Syntax WORD Receive_Str char cPort char szReceive WORD wTimeOut WORD wLenR O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szReceive the starting address of the original command string terminated with 0 wTimeOut constant for time out control unit 1ms wLenR string length of receive string O Return Value NoError OK others Error code refer to 7000W31 H 6 8 Send_Receive_Str Description This DLL will send a command to a general purpose RS 232 device and receive the response string This DLL will call Send_Cmd first Then call Receive_Cmd next Syntax WORD Send_Str char cPort char szCmd char szResult WORD wTimeOut WORD wLenT WORD wLenR O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 szResult the starting address of the result string terminated with 0 wTimeOut constant for time out control unit 1ms wLenT string length of send string wLenR string length of receive string O Return Value NoError OK others Error code refer to 7000W31 H 27
14. NAP7000P User Manual Va e fas Wi us MEASUREMENT COMPUTING Revisio nlA July 1998 Trademark and Copyright Information Measurement Computing Corporation InstaCal Universal Library and the Measurement Computing logo are either trademarks or registered trademarks of Measurement Computing Corporation Refer to the Copyrights amp Trademarks section on mccdaq com legal for more information about Measurement Computing trademarks Other product and company names mentioned herein are trademarks or trade names of their respective companies 1998 Measurement Computing Corporation All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form by any means electronic mechanical by photocopying recording or otherwise without the prior written permission of Measurement Computing Corporation Notice Measurement Computing Corporation does not authorize any Measurement Computing Corporation product for use in life support systems and or devices without prior written consent from Measurement Computing Corporation Life support devices systems are devices or systems that a are intended for surgical implantation into the body or b support or sustain life and whose failure to perform can be reasonably expected to result in injury Measurement Computing Corporation products are not designed with the components required and are not subject to the testing required to ensure
15. a level of reliability suitable for the treatment and diagnosis of people 1 Table of Contents INTRODUCTION cia ech nc bcedeg caveen IAI REN 1 lt README DOG cita des ge eo A vag aE a EEE EE 1 WINDOWS 95 NT APPLICATIONS scscssssssosscsscsscescssesessssnessccscscesssssesssssnessessessessesseseeses 2 2 1 UART DEL ln he a ea ee ee ee 2 AN QO0 DLE A CI 2 233 REQUIRED FILES crestas 3 2 4 DEMO PROGRAMS a oustasigtenusaen ARO 3 255 NGEP CALL DELS A eee ark been ies 4 2 6 MEC CALL DUE Sea ipei EE ERE R ENE ii 5 WINDOWS 3 1 APPLICATIONS sssssesosseecsososoesesesocoososossesesoesososoesesesoesososeesesocossosesososeosorsesesesoe 6 Sel 7000 W3 DLEE ienen iee i E OA EE EE REOR REEERE E ENERE 6 3 2 gt REQUIRED FILES a E a T A E A TE E A E E O E R TANA 6 3 3 DEMO PROGRAMS EE cdc E EEEE EE SAE EEA EE AE EEE EA 7 UART DLL FOR WINDOWS 95 NT scccssscsscsscesssscsscssssessssnsscesscscessesscssessessessessnessesseseeses 8 Als OPENCAS OMG 4352 RN 8 AD CLOSE COM oil Uasgaeeovantes 8 43 SEND CMD ort cieasi is 9 Ady SREAD COM STA LUS A E S ckencnctevansueaceantona debe E E E S E S 9 A SENDO l OE E E E NOE et 10 4 6 SEND RECEIVE CMD rinoceri danii e E EREE EEEE ENEE 10 17000 DLL FOR WINDOWS 95 NT sscccscsssscssssscsscsscescsssnessssncscessessescsssnsssssnessesscssessessesees 11 Sl SHORT SUB 2 nit di EN RNE E aliada Irina 11 S52 FLOAT SUB AR a ia iii 11 3 GET DEL VERSION sa 12 DAS IO LES S AA
16. can be called by your programming language call this subroutine for testing If this subroutine return the correct value the other DLLs will work OK also Syntax short Short_Sub_2 short nA short nB O Input Parameter nA _ short integer nB short integer O Return Value return nA nB short integer 5 2 Float_Sub 2 e Description Compute C A B in float format float 32 bits floating pointer number This function is provided for testing purpose To test this DLLs can be called by your programming language call this subroutine for testing If this subroutine return the correct value the other DLLs will work OK also Syntax float Float_Sub_2 float fA float fB Input Parameter fA floating point value fB floating point value O Return Value return fA fB floating point value 11 5 3 Get_DII_ Version Description Read the software version of the NAP7000P DLLs Syntax WORD Get _DIl Version void Input Parameter void Return Value return 0x202 Version 2 2 5 4 17000 Test e Description Test function Syntax 17000_Test WORD w7000 float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError 5 5 17000_AnalogIin e Description Read the analog input value
17. d key in UART LIB 17000 LIB in the object library modules field 3 Windows 3 1 Applications 7000W31 DLL is a 16 bit DLL driver designed for Windows 3 1 applications The user can use VC or VB to call the 7000W31 DLL There are also many demo programs provided for VC and VB The DLLs for Windows 3 1 and DLLs for Windows 95 NT are virtually identical in usage 3 1 7000W31 DLL The header file of 7000W31 DLL is provided in 7000W31 H The import library of 7000W31 DLL is shown in 7000W31 LIB The key files in NAP7000P are as follows NAP7000P W3 1 DLL 7000w31 dIl_ DLLs for Windows 3 1 applications NAP7000P W31 DLL 7000w31 h header file for VC NAP7000P W31 DLL 7000w31 lib import library for VC NAP7000P W3 1 7000W31 driver source 3 2 Required Files The VC user must include the following three files 1 NAP7000P W31 DLL 7000w31 dll 16 bit DLLs for Windows 3 1 2 NAP7000P W31 DLL 7000w31 lib import library 3 NAP7000P W31 DLL 7000w31 h declaration file for 7000w31 d1l The VB amp LabVIEW user must include only one file 1 NAP7000P W31 DLL 7000w31 dIl_ RS232 related DLLs 3 3 Demo Programs There are many demo programs designed for VC and VB These demo program are given in the NAP7000P as following 1 NAP7000P W3 1 VCDEMO VC Quick Win demo program 2 NAP7000P W31 VBDEMO 16 bit VB demo program These demo programs are given as following Demol send receive command to CB 7000 with
18. eed demo Demo27 17000_17017In8 demo Demo28 17000_AnalogOutReadBack demo Demo29 17000 DigitalOutReadBack demo Demo30 17000_NetworkAnalogln demo Demo31 17000_NetworkDigitalln demo 2 5 VC Call DLLs All the demo program given in NAP7000P W32 Vcdemo are designed with VC language They have been run under Windows 95 NT and Visual C 4 0 The key points for proper operation are 1 Enter the DOS command prompt under Windows 2 Make sure the PATH include the Visual C compiler 3 Execute the MSDEV BIN VCVARS32 BAT one time to setup the environment The VCVARS32 BAT is provided by Visual C The source program must include I7000 H Copy the UART LIB I7000 LIB UART DLL and I7000 DLL to the same directory with source program Edit the source program refer to nap7000p w32 vcdemo demo demo C Edit the NMAKE file refer to nap7000p w32 vcdemo demo demo MAK Edit the BATCH file refer to nap7000p w32 vcdemo demo c bat Execute the batch file FP OO ON D oO B 0 Execute the execution file 2 6 MFC Call DLLs The usage of NAP7000P DLLs for MFC user is very similar to that for C user These have also been tested in Windows 95 NT and Visual C 4 0 The key points for proper operation are 1 Use MFC wizard to create source code 2 The source program must include I7000 H 3 Copy the UART LIB I7000 LIB UART DLL and I7000 DLL to the same directory with source program 4 Select Build Settings Link an
19. efer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7050 7060 7067 7042 7043 7044 w7000 3 O0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 5 16 bit digital output data read back w7000 6 0 no save to szSendTo07000 amp szReceiveFrom7000 1 szSendT07000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table void w7000 0 cPort port w7000 1 wAddr Address w7000 2 0x7053 ID w7000 3 0 CheckSum disable w7000 4 wTimeOut TimeOut constant w7000 6 1 string debug wRet I7000_DigitalOutReadBack w7000 7000 szSend szReceive w7000 5 digital output read back 20 5 13 17000_NetworkAnalogin Description Read the multi module analog input value from CB 7000 RS 485 network The user can call 17000_AnalogIn to read analog input value one by one or call this function once for easy programming Syntax 17000_NetworkAnalogIn WORD wPort WORD wTotal WORD wT WORD wID WORD wConfig WORD wChksum float 7000 Input Parameter wPort RS 232 port number 1 2 3 4 wTotal number of modules to read wT time out constant normal 100 wID wID module address of module_ from 0x00 to OxFF wConfig if wID 0x7017 then wConfig 08 09 0A 0B 0C 0D if wID 0x7017 then wConfig is ign
20. ess w7000 2 0x7021 ID w7000 3 0 CheckSum disable w7000 4 wTimeOut TimeOut constant w7000 6 1 string debug 7000 0 5 432 DA output value wRet 17000_AnalogOut w7000 7000 szSend szReceive 16 5 9 17000_AnalogOutReadBack e Description Read back the current D A output value of CB 7021 There are two types of analog output read back as following 1 command read back by AA6 command 2 analog output of current path read back by AAS command Syntax 17000_AnalogOutReadBack WORD w7000 float 7000 char szSendTo7000 char szReceiveFrom7000 Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7021 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 5 0 command read back AA6 1 analog output of current path read back AA8 w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendT07000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table 7000 0 analog output read back value 17 5 10 17000_Digitalln e Desc
21. ibrary of i7000 d11 The BC amp BC Builder user has to include the following four files 1 ANAP7000P1W321UARTuart dll RS232 related DLLs 2 NAP7000P W32 BC_LIB uart lib import library of uart dll 3 ANAP7000P1W321170001i7000 d1l CB 7000 series related DLLs 4 NAP7000P W32 BC_LIB i7000 lib import library of 17000 dll The VB Delphi amp LabVIEW user has to include only two files 1 NAP7000P W32 UAR T uart dll RS232 related DLLs 2 NAP7000P W32 I7000 i7000 dll CB 7000 series related DLLs 2 4 Demo Programs There are many demo program designed for VC VB Delphi and BC Builder These demo program in the following directories 1 NAP7000P W32 VCDEMO VC demo program 2 NAP7000P W32 VBDEMO VB demo program 3 NAP7000P W32 Delphi Delphi demo program 4 NAP7000P W32 BCB BC Builder demo program The following provides a brief description of the various demo programs Demol send receive command to CB 7000 with checksum disable Demo2 send receive command to CB 7000 with checksum enable Demo3 send receive command to Counter ANC PC 202 Demo4 send receive command to OMRON PLC CQM1 or C200 Demo5 multi speed demo Demo6 muti data format demo Demo7 multi speed and multi data format demo Demo20 I17000_Analogln demol Demo21 17000_Analog n demo2 Demo22 17000_Analogln8 demo Demo23 17000_AnalogOut demo Demo24 17000_Digitalln demo Demo25 _ 17000_DigitalOut demo Demo26 multi sp
22. mo2 Demo22 17000_AnalogIn8 demo Demo23 17000_AnalogOut demo Demo24 17000_Digitalln demo Demo25 _ 17000_DigitalOut demo Demo26 multi speed demo Demo27 17000_17017In8 demo Demo28 17000_AnalogOutReadBack demo Demo29 _ 17000_DigitalOutReadBack demo Demo30 17000_NetworkAnalogIn demo Demo3 1 17000_NetworkDigitalIn demo 5 16 17000 DLL Driver Source The driver source of I7000 DLL are given as following NAP7000P W32 17000 17000 H declaration file NAP7000P W32 I7000 I7000 C program source file NAP7000P W32 17000 17000 DEF definition file ANAP7000P1W32117000117000 MAK VC 4 0 make file NAP7000P W32 I7000 UART LIB import library of UART DLL e Use VC 4 0 to make this DLLs e The I7000 DLL will call UART DLL therefore the UART LIB must be put in the same directory with 17000 MAK 23 6 7000W31 DLL for Windows 3 1 6 1 Open_Com Description This DLL will initialize the COM port This DLL must be called once before the other DLLs are called to send receive command o Syntax WORD Open_Com char cPort DWORD dwBaudRate char cData char cParity char cStop Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate dwBaudRate 1200 2400 4800 9600 19200 38400 57600 1 15200 cData 5 6 7 8 data bit cParity 0 NonParity 1 OddParity 2 EvenParity cStop 0 1 stop 1 1 5 stp 2 2 stop NOTE cData 8 cParity 0 cStop 0 for CB 7000 modules O Return Value NoError OK others Error
23. ored wChksum if wChksum 1 the checksum of module_ is enable 7000 0 analog value of module_0 channel_0 f7000 1 analog value of module_0 channel_1 7000 7 analog value of module_0 channel_7 f7000 8 analog value of module_1 channel_0 7000 15 analog value of module_1 channel_7 7000 n 8 analog value of module_n channel_0 f7000 n 8 1 analog value of module_n channel_1 7000 n 8 7 analog value of module_n channel 7 Return Value NoError OK others Error code refer to 17000 H 21 5 14 17000_NetworkDigitalln e Description Read the multi module digital input value from CB 7000 RS 485 network The user can call 17000_Digitalln to read analog input value one by one or call this function once for easy programming Syntax 17000_NetworkDigitalln WORD wPort WORD wTotal WORD wT WORD wID WORD wConfig WORD wChksum WORD w7000 O Input Parameter wPort RS 232 port number 1 2 3 4 wTotal number of modules to read wT time out constant normal 100 wID wID module address of module_ from 0x00 to OxFF wConfig reserved wChksum if wChksum 1 the checksum of module_ is enable w7000 0 16 bit digital value of module_0 w7000 1 16 bit digital value of module_1 w7000 n 16 bit digital value of module_n O Return Value NoError OK others Error code refer to 7000W31 H 22 5 15 VC 17000 Demo Programs Demo20 17000_Analogln demol Demo21 17000_AnalogIn de
24. ription Read the digital input value from a CB 7000 series DIO module Syntax 17000_Digitalln WORD w7000 float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H W 7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7050 7052 7053 7060 7041 7044 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 5 16 bit digital input data w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendT07000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 F7000 Float Input Output Table void w7000 0 cPort port w7000 1 wAddr Address w7000 2 0x7053 ID w7000 3 0 CheckSum disable w7000 4 wTimeOut TimeOut constant w7000 6 1 string debug wRet 17000_Digitalln w7000 7000 szSend szReceive 18 5 11 17000_DigitalOut e Description Set the digital output value of CB 7000 series digital I O module Syntax 17000_DigitalOut WORD w7000T float 7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument
25. rom 0x00 to OxFF w7000 2 module type 08 09 0A 0B 0C 0D w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendTo7000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table 7000 0 analog input value of channel_0 7000 1 analog input value of channel_1 7000 7 analog input value of channel_7 15 5 8 17000_AnalogOut e Description Send the analog output command to CB 7000 Syntax 17000_AnalogOut WORD w 7000 float f7000 char szSendTo7000 char szReceiveFrom7000 O Input Parameter w7000 WORD Input Output argument table 7000 float Input Output argument table szSendTo7000 command string send to CB 7000 szReceiveFrom7000 result string read from CB 7000 O Return Value NoError OK others Error code refer to 17000 H e W7000 WORD Input Output Table w7000 0 RS 232 port number 1 2 3 4 w7000 1 module address from 0x00 to OxFF w7000 2 module ID 0x7021 w7000 3 0 checksum disable 1 checksum enable w7000 4 TimeOut constant normal 100 w7000 6 0 no save to szSendTo7000 amp szReceiveFrom7000 1 szSendTo7000 command string send to CB 7000 szReceiveFrom 7000 result string receive from CB 7000 e F7000 Float Input Output Table 7000 0 analog output value w7000 0 cPort port w7000 1 wAddr Addr
26. to 17000 H 4 2 Close_Com e Description This DLL will free all the resources used by Open_Com This DLL must be called before the program exit The Open_Com will return error message if the program exit without calling Close_Com function Syntax WORD Close_Com char cPort O Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate O Return Value NoError OK others Error code refer to 17000 H 4 3 Send_Cmd e Description This DLL will create a thread to send a command to CB 7 000 and receive the response result from CB 7000 If the wCheckSum 1 this DLL will automatically add the two checksum bytes to the input string This DLL will add the 0x0D to the end of the input string szCmd The Send_Cmd is a multi task multi thread DLL Syntax WORD Send_Cmd char cPort char szCmd WORD wTimeOut WORD wCheckSum Input Parameter cPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate szCmd the starting address of the original command string terminated with 0 wTimeOut constant for time out control unit 1ms wCheckSum 0 DISABLE 1 ENABLE O Return Value NoError OK others Error code refer to 17000 H 4 4 Read _Com_ Status e Description The Send_Cmd will create a thread to send a command to CB 7000 and receive the response result from CB 7000 The Read_Com Status will return the status of this send receive thread If the thread is working the status value will be smaller than

Download Pdf Manuals

image

Related Search

Related Contents

théâtre musical de pibrac  シリーズ - ビクセン  Hoffer CAT3 Digital Flow Transmitters for Turbine Flowmeters User  GUIA DO USUÁRIO Multímetro True RMS Extech 430  Track  Pioneer DV-400-S User's Manual  Metropolis H -IT  Euronda-bedienungsanleitung-e  T'nB ETGP038826  取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file