Home

to USER MANUAL for ADR2100

image

Contents

1. PD6 PD4 PD2 PDO PC6 PC4 PC2 PCO PB6 PB4 PB2 PBO PA6 PA4 PA2 PAO 5V ONTRAK CONTROL SYSTEMS INC 25 27 www ontrak net APPENDIX B ELECTRICAL SPECIFICATIONS ADR2100 Supply Voltage Supply Current Operating Temperature all digital outputs unloaded Analog Inputs 4 Resolution Accuracy Range Protection Input Impedance PWM Outputs 2 Resolution Frequency Output Type Output Current Digital I O 32 Sink Current Source Current 5VDC 10 or 7 9VDC via wall adaptor 30mA Typical 40mA Maximum 0 50C 10 bits 0 1 0 5VDC OVP to 15VDC 1Mohm 10 bits 9 76Khz TTL Sink 20mA Maximum Source 20m A Maximum 20mA Maximum per pin 20mA Maximum per pin NOTE The following sink and source currents must not be exceeded Total of PAO PA3 Total of PA4 PA7 and PBO PB3 150mA Total of PORTC PORTD and PB4 PB7 Total of all digital I O Auxillary Output 1 Sink Current 60mA Maximum Source Current N A Maximum Voltage 12V Event Counters 2 Type TTL or Contact Resolution 16 bits Communication Interface RS232 and RS485 9600 baud 8 bit words no parity 1 start bit Daisy chain via RS485 Sink Source 80mA 80mA 100mA 150mA 100mA 300mA 200mA Stepper Indexer dual Maxsteps per move 49999 Min Speed 10s s Max Speed 1000s s Speed Accuracy 1 Accel Decel None Interrupts 4 Scan Rate standard 100us Scan Rate indexer once step Visit our web site at h
2. 10 OPEN COM1 9600 n 8 1 CS DS RS AS 1 20 PRINT 1 CPA00000000 FOR X 0 to 255 40 PRINT 1 MA X 50 NEXT X 60 END RECEIVING DATA When reading analog inputs or the digital port data is sent from the ADR2100 to the host computers serial buffer This data can be retrieved using INPUT 1 commands The INPUT 1 command should be used following PRINT 1 commands if data is expected to be sent by the ADR2100 Ifa single piece of data is expected then one variable name should be used with the INPUT 1 command If eight pieces of data are to be received as with the RPA command then eight variable names must be used with the INPUT 1 command Examples of both cases are shown below ONTRAK CONTROL SYSTEMS INC 12 27 www ontrak net 20 PRINT 1 RDO 30 INPUT 1 ANADAT 40 PRINT 1 RPA 50 INPUT 1 PA7 PA6 PA5 PA4 PA3 PA2 PA1 The variable names used in the INPUT 1 commands now contain the data sent by the ADR2100 The data can now be scaled printed displayed saved or whatever is required by the application A BASIC PROGRAM EXAMPLE A complete BASIC program which reads analog port 0 and sets PAO if the analog portis above decimal value 512 2 5 volts is shown below 10 OPEN COM1 9600 n 8 1 CS DS RS AS 1 opens and configures serial file 20 PRINTZ1 CPA11111110 configures PAO as output 30 REM FORCES CR 40 PRINT 1 RESPAO resets PAO 50 REMFORCES lt CR gt 50 PRINT 1 RDO ssends RAO command 60 INPUT
3. 1 ANO receives data into variable ANO 70 IF ANO gt 512 then PRINT 1 SETPAO GOTO 50 SETPA0 command if ANO gt 2 5V and returns to line 50 80 PRINT 1 RESPAO GOTO 50 sresets PAO and returns to 50 Visit our web page at www ontrak net for additional programming examples in BASIC Visual Basic and C 5 SENDING COMMANDS IN TURBO C TO THE ADR2100 This section will demonstrate how to send and receive data from the ADR2100 using TURBOC It outlines the commands used to configure the serial port bioscom send data out through the serial port fprintf and receive data through the serial port fscanf Commands used in TURBO C to access the ADR2100 require the following include files to be declared at the start of TURBO C programs include lt stdio h gt include lt bios h gt CONFIGURING THE SERIAL PORT The first step in accessing the ADR2100 via the serial port is configuring the serial port to the proper communication parameters which are 9600 baud 8 bit words no parity This is done using the bioscom command The syntax for this command is bioscom O settings com 1 where settings is previously defined as HEX E3 and com is defined as 0 Defining settings and com 1 should be done using define com1 0 define settings OxE3 ONTRAK CONTROL SYSTEMS INC 13 27 www ontrak net These statements should be placed immediately following your include files see programming examples The bioscom comm
4. 27 www ontrak net 3 ADR2100 COMMANDS a ANALOG INPUT COMMAND There are 4 analog inputs with a resolution of 10 bits on the ADR2100 labeled ANO to AN3 The analog input range is 0 to 5 VDC RDn Returns status of analog port specified in decimal format n 0 to Input voltage range used for conversion 0 to 5VDC example RDO lt CR gt 0786 To convert to voltage voltage reading 1023 5 Ex ANO is at 786 1023 5 volts 3 842 volts b DIGITAL PORT COMMANDS There are 4 eight bit digital ports on the ADR2100 labeled PORT AB C and D The individual I O lines are labeled PyO Py7 A B C or D There is also one open drain output capable of sinking 60mA labeled AUX The following commands allow the user to configure individual bits an inputor output SET or RESET individual bits read individual bits read entire port in binary or decimal format write to entire port in binary or decimal format turn AUX output on and off NOTE PORT A bits 0 1 2 and 3 have built in pull up resistors active when configured as input Care should be taken when using these pins as output because on power up all digital I O is configured as input pulling these pins high CPyXXXXXXXX Configures each bit of PORT y All eight bits mustbe specified Order is MSB LSB 1 for input x 0 for output example CPA11110000 CR PA6 PA5 are configured as inputs and PA2 PA1 PAO are configured a
5. relay requires one digital I O line to operate and requires no other external components The sample BASIC program demonstrates how the relayis turned on Note that the I O line is RESET before the CPB command is used to configure the port as output to avoid the relay turning on unexpectedly when the port is configured ONTRAK CONTROL SYSTEMS INC 19 27 www ontrak net ADR2100 DIGITAL I O BIDQDVAVAVAVAS H1 K A KAKA KAKA K A rroo E Aa B Bd P3 Dd PX Dd PX DX P3 Ed D3 Dd A 2 2 2 O gt N oO gt P F 265 gt Dw ANALOG INPUT EVENT PWM POWER 10 OPEN COM1 9600 N 8 1 CS DS RS AS 1 opens com port 20 CLS clears screen 30 PRINT 1 RESPBO resets PBO 40 REM forces lt cr gt 50 PRINT 1 CPB11111110 60 REM Turn on relay 70 PRINT 1 SETPBO 80 REM Turn off relay 90 PRINT 1 RESPBO configures PBO as output forces lt cr gt turns relay on forces lt cr gt turns relay off e Solid State Temperature Measurement The LM335 is a solid state temperature sensor with an input span of 40 to 100C It outputs temperature 10mV per degree Kelvin Only one external componentis required to use the LM335 with the ADR2100 R1 is a 1Kohm resistor used to bias the LM335 The sample software program reads the sensor using an RDO command converts the result to Celsius and displays the
6. temperature on the video screen 0 OPEN COMT 9600 N 8 1 CS DS RS 5 1 open com port Die OSOSOSOSOSOS gt ow ANALOG INPUT EVENT PWM POWER R1 1kohm LM335 SENSOR 20 CLS 30 LOCATE 1 1 40 PRINT 1 RDO 50 INPUT 1 READING 60 TEMPERATURE READING 1023 5 2 73 100 70 PRINT Temperature is TEMPERATURE display it 80 GOTO 30 repeat procedure voltage on inputis converted to Celsius by subtracting 2 73 273 and multiplying by 100 clear screen locate cursor send RDO command to ADR2100 retrieve data from ADR2100 convert data to Celsius ONTRAK CONTROL SYSTEMS INC 20 27 www ontrak net f Event Counter Connections The event counter accepts both TTL and dry contact inputs TTL type inputs may be connected directly to the ECA or ECB input while dry contacts must be connected between GND and the ECA or ECB inputs Events are counted on the rising edge ofthe input which is when the TTL signal switches from low to high or the dry contact opens The sample program reads the dry contact input and displays the count result continuously on the video screen NOTE The event counter inputs are configured for dry contact input from the factory To use with TTL inputs the debounce capacitors must be removed from the ADR2100 PCB To convert ECAto TTL
7. 7 SETPA3 lt CR gt PA3 is set Controls open drain auxiliary output n 1 for ON n 0 for OFF A1 lt CR gt AUX open drain output is turned on AO0 CR AUX open drain outputis OFF high impedance c PWM OUTPUT COMMANDS There are two 10 bit PWM outputs ADR2100 labeled PWMA and PWMB The output frequency is fixed at 9 76KHz and the duty cycle is variable from 0 to 100 The commands used to setthe duty cycle are TAdddd ONTRAK CONTROL SYSTEMS INC 8 27 www ontrak net Sets the period of PWMA output dddd 0000 to 1024 0000 0 1024 100 example TA512 lt CR gt period is set to 512 1024 50 TBdddd Sets the period of PWMB output dddd 0000 to 1024 0000 0 1024 100 example TB232 lt CR gt period is set to 232 1024 22 65 d EVENT COUNTER COMMANDS The ADR2100 is equipped with two 16 bit event counters ECAand ECB that accept TTL or contact input There are three commands available to read and clear the event counters If the maximum count of 65535 is reached the counter will rollover to 00000 REy Returns decimal value of event counter y Aor B example REA lt CR gt 00456 Present count in counter Ais 456 CEy Clears event counter Aor B example CEB CR Event counter B is cleared to 00000 RCy Reads and clears event counter Aor B example RCA lt CR gt 12034 ECA countis returned 12034 and counter is reset to 00000 e STEPPER IND
8. ADR2100 ANALOG DIGITALRS232 RS485 INTERFACE USER MANUAL V 3 0 Caution The ADR2100 is a static sensitive device Observe proper procedures for handling static sensitive devices ONTRAK CONTROL SYSTEMS INC 764 Notre Dame Avenue Unit 1 Sudbury Ontario CANADA P3A 2T2 705 671 2652 VOICE 705 671 6127 FAX www ontrak net WEB Ontrak Control Systems Inc reserves the rightto change product specifications to improve the product Although every attempt has been made to insure accuracy of information contained in this manual Ontrak Control Systems Inc assumes no liability for inadvertent errors Warranty This ADR2100 is warranted from defects in workmanship and materials for a period of 90 days Liability for defects is limited to the purchase price ofthe product This warranty shall not apply to defects resulting from improper modifications or use outside published specifications Hyperterminal and Windows are trademarks of Microsoft Corporation APPLE MACINTOSH and MAC are trademarks of Apple Computer Inc PC XT AT PS 2 are trademarks of International Business Machines Inc COPYRIGHT 1998 ONTRAK CONTROL SYSTEMS INC TABLE OF CONTENTS READ ME FIRST 1 Communication options a The ADR2100 RS232 Interface b The ADR2100 RS485 Interface 2 Powering the ADR2100 3 ADR2100 Commands a Analog Input Commands b Digital Port Commands c PWM Output Commands d Event Counter Commands e Stepper Mo
9. B example QB lt CR gt 3200 Motor B move register contains 3200 E Emergency stop Stops all motor movement G Go starts indexer and executes present moves f INTERRUPT COMMANDS The ADR2100 has four digital I O lines that can be enabled to provide interrupts to the host when the lines are pulled LOW PAO PA1 PA2 and have built in pull up resistors when configured as input When interrupts are enabled bringing anyor these lines low will return a two digit interrupt code to the host The first digitin the code is the board address 0 9 and the second identifies the pin that generated the interrupt 1 for PAO 2 for PA1 3 for PA2 4 for PA3 For example an interrupt on PA1 on board 0 returns 02 an interrupt on PAO of board 3 returns 31 PAO has the highest priority while PA3 has the lowest priority and in the case of a dual interrupt the highest priority interrupt will be sent first Once an interrupt is sent the interrupt for that pin is disabled until re enabled using the IE command Upon power up all interrupts are disabled IE Enables interrupts on PORT Abits 0 to 3 ONTRAK CONTROL SYSTEMS INC 10 27 www ontrak net ID Disables all interrupts IS Returns status of interrupts 0 if disabled 1 if enabled E ID COMMAND IDN Returns ID code 2100 may be omitted ONTRAK CONTROL SYSTEMS INC 11 27 www ontrak net 4 SENDING COMMANDS IN BASIC TO THE ADR2100 OPENING A SERIAL HLE Commands may be s
10. ED s to Digital Ports LED s maybe controlled using the digital I O lines on the ADR2100 Only one additional component is needed to drive LED s Acurrent limit resistor is required for each LED with a value of around 220 Ohms The LED is the turned on by resetting PBO to a logic zero or turned off by setting PBO toa logic one The sample BASIC program demonstrates how to turn the LED on and off ADR2100 DIGITAL 0 12 6 6 6 6 6 PBO ANALOG INPUT EVENT PWM POWER DS a 6 3 O N w x 220 OHM LED1 10 COM1 9600 N 8 1 CS DS RS AS 1 com port 20 CLS clears screen 30 PRINT 1 SETPBO sets PBO 40 REM forces cr 50 PRINT 1 CPB11111110 configures PBO as output 60 REM Turn on LED forces cr 70 PRINT 1 RESPBO turns on LED 80 REM Turn off LED forces lt cr gt 90 PRINT 1 SETPBO turns off LED 100 END PBO remains in high impedance state until the CPB command is used to configure the port as output d Driving Solid State Relays Solid State relays that require a DC voltage to operate may be driven by ADR2100 digital I O lines directly if the current input specification for the relayis 20mAor less The relay must be rated for the proper voltage and current required by the load Each
11. ESS d B 6668 REI d L d p ore 4 d 9 4 d EH b d bd F HT BRE pum fee DIGITAL ANALOG INPUT EVENT Pwr DIGITAL VO SESS RS z 222 2 82 4 Sls 52655850 05 x P 0202602602602626 8 Bs 212 ANALOG INPUT EVENT POWER ILLI o ANALOG INPUT EVENT pw POWER The Daisy chain cable can be connected from J3 to either J1 or J3 on additional ADR2100 interfaces Both J1 and J3 have identical pinouts for RS485 and power signals used for daisy chain applications Figure 5c shows a typical daisy chain application If a Powered daisy chain cable is used power need only be connected to J2 on any one ADR2100 in the chain Figure 5c Typical Daisy Chain Application C Sending Commands Once a board is jumpered it will respond onlyto commands preceded byits address as a single digit integer number For example to read analog port 0 on board 3 the command 3RDO cr is sent To set PA4 on board 7 the command 7SETPA4 lt cr gt is sent Spaces sent between the board address and commands are ignored Board zero will respond to both commands with no preceding address and commands preceded with a zero for reasons of continuity Never connect two boards with the same address on the same chain This will result in both boards responding at the same t
12. EXER COMMANDS The ADR2100 has a dual stepper indexer that will provide step and direction information to two stepper motor translator circuits The indexer uses PORT A when configured to indexer mode to provide drive signals and read limit switches See section 7g of this manual for further information CPASTEP Configures PORT Ato indexer mode and assigns the following functions to PORT A PAO Motor A Reverse CCW limit INPUT PA1 Motor A Forward CW limit INPUT PA2 Motor B Reverse CCW limit INPUT Motor B Forward CW limit INPUT PA4 Motor ASTEP output OUTPUT PA5 Motor A DIR output OUTPUT PA6 Motor B STEP output OUTPUT PA7 Motor B DIR output OUTPUT ONTRAK CONTROL SYSTEMS INC 9 27 www ontrak net MSddd Sets speed of moves for both motors from 10 to 1000 steps second ddd 1 to 100 Actual speed ddd 10 example MS23 CR Sets speed of moves to 230 steps per second LmFddddd Loads move register for motor m Aor B with move information and sets direction to forward ddddd 0 to 49999 example LAF10000 CR Loads motor Amove register with 10000 and sets direction for motor Ato forward CW LmRddddd Loads move register for motor m Aor B with move information and sets direction to reverse ddddd 0 to 49999 example LBF4400 lt CR gt Loads motor B move register with 4400 and sets direction for motor B to reverse CCW Qm Returns contents of move register specified bym Aor
13. adapter cable will be required to connect to the ADR2100 cable This adaptor is available at most computer dealers If desired the DB25 connector on the supplied cable may be removed and a female DB9S connector can be soldered in its place using the following wiring diagram ADR IBM etc DB9P male DBO9S female RC 3 RED 3 TX TX 7 WHITE 2 RC GND 2 BLACK 5 GND r7 RTS 8 CTS r 1 DCD r 6 DSR 4 DTR Figure 2 Modified Wiring Diagram For 9 PIN SERIAL PORTS Ifthe host computer has a female DB25 connector a male to male adapter is required to use the supplied cable This may be purchased at most computer dealers Apple Macintosh computers may be connected to the ADR2100 using MAC to DB25 DTE conversion cable Once connected to the RS232 based host computer or terminal the RS232 port should be configured to the following specifications to allow communication with the ADR2100 9600 baud 8 bit words 1 stop bit no parity If using BASIC or C consult the appropriate section in this manual for details on how to configure your serial port If a terminal or terminal emulation program is used configure your terminal to the above specifications using the operations manual for your terminal equipment or terminal emulation program ONTRAK CONTROL SYSTEMS INC 4 27 www ontrak net 1b THE ADR2100 RS485 INTERFACE The ADR2100 RS485 interface is a two wire connection meeting all
14. and needs only to be executed once before the ADR2100 is accessed SENDING COMMANDS TO THE ADR2100 To send commands to the ADR2100 the fprintf command is used For example the following command sends an RDO read analog port 0 command to the ADR2100 fprintf stdaux RDO WD The WD suffix sends a carriage return after the command which is needed by the ADR2100 to recognize a command Integer variables may also be used in the command line For example the following command sends a MAddd make port A ddd command where DOUT is a previously defined integer value of 0 to 255 fprintf stdaux MA 96d xD DOUT RECEIVING DATA FROM THE ADR2100 If a command sent to the ADR2100 is a responsive command that is one that results in data being sent back to the host the data is retrieved using the fscanf command After this command is used the serial buffer must be re initialized using the rewind command The syntaxfor this command is rewind stdaux This command is executed after data is retrieved using the fscanf command For example the following commands send a RDO command and stores the retrieved data in an integer variable named ANO fprintf stdaux RDO WD fscanf stdaux D amp an0 rewind stdaux In this example the command read port A Jis sent to the ADR2100 and the retrieved data is stored in an integer variable named PORTA fprintf stdaux PA WD fscanf stdaux 96D amp PORTA r
15. cised In disabling interrupts as the ID command may collide with interrupt data being sent by the ADR2100 if an interrupt is generated at that instant Because of this the command IS interrupt status is provided to query the ADR2100 as to the status ofits interrupts This command returns a 1 if the interrupts are enabled or a O if they are disabled The IS command should be used after the ID command to verify interrupts are disabled STEPPER INDEXER MODE If the ADR2100 PORT Ais operating in stepper indexer mode the interrupt functions operate to alert the host to a limit switch being activated or the successful completion of a move The inputs are checked before each step and thus the scan rate is set by the actual motor speed setting The interrupts will return a two digit code where the first digit is the board address 0 9 and the second digitindicates a successful move or a limit switch being activated as per table below board address is zero CODE Cause 00 Indicates successful move completion 01 Motor A Reverse limit CCW reached 02 Motor A Forward limit CW reached 03 Motor B Reverse limit CCW reached 04 Motor B Forward limit CW reached Once an interrupt is generated the motors can not be restarted until new information is loaded into the move registers Interrupts need not be re enabled after each move They are only disabled if the ID command is sent or the portis configur
16. ed to another mode using the CPA oooooox command ONTRAK CONTROL SYSTEMS INC 24 27 www ontrak net APPENDIX A CONNECTION DIAGRAM J1 RS232 485 1 GND J3 2 GND RS485 3 RC RS232 1 GND 4 and 8 TR RS485 2GND J2 5 and 9 TR RS485 4 and 8 TR RS485 7 9VDC 6 VDC 5 and 9 TR RS485 2 1mm 7 TX RS232 6 VDC Center Negative ONTRAK eADR2100 7 m SYSTEMS 00 l cj E 8421 oc ADDRESS c mo EJ CONTROL SYSTEMS ONTRAK 9824 c og j 24 POOOSDSDSDSDS H1 gt gt gt ZzZz 0O a K KKK 626508005 Sig 5 DIGITAL ANALOG INPUT EVENT PWM POWER OD N wo aD o o mM ui QN 9 S A om wo og om EU EORR CR 330431 29827252321 119 017 XX1 5 D 3 0311 039 7 5 11 34x32 X30 X28 x26 X22 D20 Xi skhokhaki2kiokxls 6 4 2
17. entto the ADR2100 using a terminal emulation program such as Hyperterminal by simply entering commands and pressing cr With BASIC the ADR2100 is connected to the computer via a serial cable and BASIC treats the ADR2100 as a serial file Before commands can be sentto the ADR2100 this serial file must be opened and initialized This should be done atthe start of any program that is to access the ADR2100 The command to open a serial file is shown below 10 OPEN COM1 9600 n 8 1 CS DS RS AS 1 This line opens a serial file and labels itas serial file 1 This allows access to the ADR2100 using PRINT 1 and INPUT 1 commands SENDING COMMANDS Sending commands in BASIC to the ADR2100 can be done using PRINT 1 commands For example sending an RDO command could be done as shown below 20 PRINT 1 RDO Extra spaces inside the quotes are ignored by the ADR2100 Avoid sending commands on consecutive lines because a CR is not sent after the first command resulting in an unrecognized command This problem arises with the configuring of a digital port and then trying to access the port immediately after it is configured AREM statement should be inserted between consecutive PRINT 1 commands as shown below 20 PRINT 1 CPA00000000 30 REMFORCES lt CR gt 40 PRINT 1 SETPAO Variable names mayalso be used with PRINT 1 commands One example of this shown below This program configures PORT Aas output and the increments it from 0 to 255
18. ewind stdaux The following test programs outline the proper syntaxfor using the commands in simple applications The first program retrieves the status of analog port 0 and displays the data on the video screen The second program configures PORT Aas output sets the portto decimal 255 reads back the port status and displays the data on the video screen ONTRAK CONTROL SYSTEMS INC 14 27 www ontrak net PROGRAM EXAMPLE ONE ANALOG PORT TEST PROGRAM include lt stdio h gt include lt bios h gt define com1 0 define settings OxE3 main declare an0 as an integer number int anO configure com 1 9600 baud 8 bit words no parity bioscom 0 settings com 1 send RDO command to ADR2100 on com1 fprintf stdaux RDO WD read data from com1 and store itat address of anO fscanf stdaux od amp an0 initialize com1 buffer rewind stdaux print data on screen printf ANALOG PORT 0 2 d n an0 PROGRAM EXAMPLE TWO DIGITAL PORT TEST PROGRAM include lt stdio h gt include lt bios h gt define com1 0 define settings OxE3 main declare PORTA and DOUT as integer numbers int PORTADOUT Set DOUT to integer 255 DOUT 255 configure com 9600 baud 8 bit words no parity bioscom 0 settings com 1 send CPA00000000 command to ADR2100 on com 1 fprintf stdaux CPA00000000 WD send MAddd ddd DOUT command to ADR2100 on c
19. fore a move is started however they may be loaded while the indexer is operating to extend moves The registers may be read back using the QA or QB command whether the indexer is operating or not This allows the hostto monitor moves in operation STEP4 Starting a Move Once the move registers are loaded and the speed is selected a move may be started The command to start a move is G GO command Once initiated the indexer will begin the move and decrement the move registers with each step The move will continue until all move registers are zero or a limitis reached If a limitis reached all movement stops and cannot be restarted until new move information is loaded into the move registers and a new GO command is given STEP5 Stopping a Move Once a move is started it will terminate in one of two ways The firstis if after the move registers decrement to zero meaning the move was successfully completed The second is ifthe hostsends an E emergency stop command In this case the motors will stop and move registers maintain present count values and may be restarted by sending a G GO command Using Interrupts with the Stepper Motor Indexer Interrupts may be used to signal the host that a move has been completed or a limit switch has been activated See section 7h for details 7h Using Interrupt Functions The ADR2100 has interrupt capabilities using the first four bits of PORT A PAO PA1 PA2 PA3 All four bits have built in
20. ime and will cause contention on the network with possible damage to the ADR boards 7 Interfacing to the ADR2100 Basic Examples The following interface examples show basic examples of interfacing various devices to the ADR2100 Sample programs are written in BASIC and demonstrate proper command syntax A Reading Potentiometer Position To monitor potentiometer position potentiometer must be biased with 5VDC The wiper of the potis then connected to one ofthe analog inputs The sample BASIC program reads the potentiometer position using the RDO command which responds with a decimal value between 0000 and 1023 The value is then converted to a percent and displayed on the video screen ONTRAK CONTROL SYSTEMS INC 17 27 www ontrak net DIGITAL I O 1 ANALOG INPUT EVENT PWM 10 OPEN COM1 9600 N 8 1 CS DS RS AS 1 20 CLS 30 LOCATE 1 1 40 PRINT 1 RDO 50 INPUT 1 POT 60 POT POT 1023 100 70 PRINT Potentiometer Position is POT 80 GOTO 30 B Connecting Switches to Digital Ports POT com port clear screen locate cursor RDO command to ADR2100 retrieve data from ADR2100 convert data to percent display it repeat procedure To connect switches to digital I O lines only one additional compone
21. input remove C3 To convert ECB to TTL input remove C4 DIGITAL I O TB1 ANALOG INPUT 10 OPEN COM1 9600 N 8 1 CS DS RS ASH 20 CLS 30 LOCATE 1 1 40 PRINT 1 CE 50 PRINT PRESENT COUNT IS COUNT 60 PRINT 1 RE 70 INPUT 1 COUNT 80 GOTO 50 g Using the Stepper Motor Indexer DRY CONTACT open com port clear screen locate cursor clears event counter displays count data RE command to ADR2000 retrieves count data repeat procedure Stepper motor translator and drive circuits typically require STEP and DIRECTION input signals to operate Atypical system is shown in Figure 7g CW TRANSLATOR AND DRIVE STEP DIRECTION STEPPER MOTOR gt Figure 7g Typical Stepper Motor Drive System The ADR2100 has a dual stepper indexer that will provide step and direction information to two stepper motor translator circuits and provide limit switch checking on both axis The indexer uses PORT A when configured to indexer mode to provide drive signals and read limit switches The limit switch inputs have built in pull up resistors to allow use of mechanical or inductive proximity switches NPN When limit switches are activated all motor movementis stopped and disabled i
22. mA if the ADR2100 is to source current from the digital outputs Care must be taken to avoid improper power supply connection as permanent damage to the ADR2100 may result if connected improperly No connection to J2 is to be made if the ADR2100 is powered by a regulated 5 volt supply POWER UP USING AWALL ADAPTOR The ADR2100 has an on board 5 volt regulator allowing the use of a 9 volt wall adaptor to power the internal circuits The regulator should be able to provide from 300 500mA MODE 68 950 1 The regulator must have a standard 2 1mm center negative coaxial connector The connector can then be inserted into J2 on the ADR2100 When the ADR2100 is powered by a wall adaptor the on board regulator also may provide a regulated 5 volts DC out to provide power to external circuits This 5 volt supplyis available on TB1 The amount of current available depends on the amount of current sourced by the digital ports For safe operation no more than 100mA should be drawn from the power terminals to power external circuits Maximum current out 200mA Total current sourced by digital I O ONTRAK CONTROL SYSTEMS INC 5 27 www ontrak net ANALOG INPUT COMMAND SUMMARY RDn Returns status of analog port specified byn in decimal format n 0 to 3 DIGITAL COMMAND SUMMARY y AB C Configures PORT 1 for input 0 for output Output binary data to PORT y x 1 RPy Retu
23. n a daisy chain cable must be constructed The cable must provide two connections for the RS485 signals Atypical daisy chain cable is shown in Figure 5a DB9P male DB9P male TX 5 5 TX TX 4 4 TX Figure 5a Daisy chain cable Power may be shared in daisy chained ADR2100 series interfaces if two extra conductors are added to the daisy chain cable Care should be taken that the output current limitation on the power supply ONTRAK CONTROL SYSTEMS INC 16 27 www ontrak net is not exceeded The connections for a powered daisy chain cable are shown in Figure 5B NOTE Power sharing is available only if power is applied via J2 7 9VDC DB9P male TX 5 DB9P male TX TX 4 9VDC 6 GND 1 TX 9VDC GND aOR Figure 5b Powered Daisy chain cable To jest i IL im Wee TT rpm TT re mn n ge suc tuus gn M c eADR2100 Tt i amp m eADR2100 TE me i Sm ADR2100 m i E TH bc D ef prs g A F t B ks E g B H g 8421 o d di T 8421 o g di 8421 TENE m gg uy ta vu gj us W B ADDRESS B B ADDRESS E ADDR
24. n the corresponding direction If interrupts are enabled an interrupt is generated and sentto the host ONTRAK CONTROL SYSTEMS INC 21 27 www ontrak net ADR2100 PA7 DIRB TRANSLATOR STEPPER RS232 485 PA6 STEPB AND DRIVE B MOTOR to Host PAS DIRA UI DIRECTION E porra PM STEPA STER CCWLS cwLs PA3 CWLSB PA2 CCWLSB CWLSA CCWLSA Figure 7f Typical Stepper Motor Application with ADR2100 as Indexer STEP1 Configuring PORT A The first step in using the indexer is to configure PORT Ato indexer mode This is done with the command CPASTEP This configures the port and assigns the following functions to PORT A PAO Motor A Reverse CCW limit INPUT PA1 Motor A Forward CW limit INPUT PA2 Motor B Reverse CCW limit INPUT PA3 Motor B Forward CW limit INPUT PA4 Motor ASTEP output OUTPUT PAS Motor A DIR output OUTPUT PA6 Motor B STEP output OUTPUT PA7 Motor B DIR output OUTPUT NOTE When configured into indexer mode all commands to read and write PORT Aare still active and extreme care should be used when using commands to write to PORT A while the indexer mode is selected This practice may alter the operation of the indexer and is notrecommended STEP2 Selecting Motor Speed The motor speed is adjustable from 10 to 1000 steps second using the MSddd comma
25. nd where ddd 1 to 100 The actual speed is setto ddd 10 For example MS23 sets the speed of all moves to 230 steps per second The speed is changeable on the fly or anytime regardless of whether a move is in progress or not If no speed is selected the default speed is 10 steps second STEP3 Loading Move Registers Each motor has a move register associated with itthat allows move lengths of 0 to 49999 steps to be loaded The load commands also setthe direction outputs to the proper level 1 for Forward CW or 0 for Reverse CCW One or both move registers may be loaded before commencing a move to allow concurrent control of two motors The commands used to load the move registers are LmFddddd Loads move register for motor m Aor B with move information and sets direction to forward ddddd 0 to 49999 example LAF10000 lt CR gt Loads motor Amove register with 10000 and sets direction for motor A to forward CW LmRddddd Loads move register for motor m Aor B with move information and sets direction to reverse ddddd 0 to 49999 ONTRAK CONTROL SYSTEMS INC 22 27 www ontrak net example LBR4400 lt CR gt Loads motor B move register with 4400 and sets direction for motor B to reverse CCW Ifa number is not specified in the command string ex LAF LAR LBF LBR the indexer is set for continuous move operation and will run until a limitis reached or an emergency stop command is sent Typically move registers are loaded be
26. nt is required Each digital input line used to read a switch must be tied to 5V via a 10Kohm resistor This is to avoid leaving the digital port floating when the switch is in the open position The switch is then connected between the digital port and ground The sample BASIC program first configures the digital I O lines as input and then reads the switches and displays their status on the video screen DIGITAL I O H1 K KKK Xk K K K K K Bd D DX Dd D9 DX D3 Dd Dd K DX K DX Dd Dd PBO PB1 BIDQVOVAVAYS ANALOG INPUT 10 OPEN COM1 9600 N 8 1 CS DS RS AS 1 20 CLS 30 LOCATE 1 1 40 PRINT 1 CPB11111111 50 REM 60 PRINT 1 RPBO ONTRAK CONTROL SYSTEMS INC 18 27 com port clears screen locates cursor configures port as input forces lt CR gt PBO SW1 www ontrak net 70 INPUTZ1 SW1 saves status in variable SW1 80 PRINT 1 RPB1 reads PB1 5 2 90 INPUTZ1 SW2 saves status in variable SW2 100 T1 CLOSED IF SW1 1 THEN T1 OPEN define T1 110 T2 CLOSED IF SW2 1 THEN T2 OPEN define T2 120 PRINT SW1 is T1 sprint SW1 status 130 PRINT SW2 is T2 sprint SW2 status 140 GOTO 60 procedure Note Switches connected to PAO PA1 PA2 or PA3 do not require pull up resistors as they are built into those four inputs C Connecting L
27. om1 fprintf stdaux MA d WD DOUT send PA command to ADR2100 on com1 fprintf stdaux PA WD read data from com 1 and store at address of PORTA fscanf stdaux d amp PORTA initialize com 1 buffer rewind stdaux print data on screen printf PORT Ais d DECIMAL M PORTA ONTRAK CONTROL SYSTEMS INC 15 27 www ontrak net 6 Daisy Chain Options for the ADR2100 Daisy chaining ADR2000 series boards involves three steps A Setting Address Jumpers B Physically Connecting Boards C Sending commands A Setting Address Jumpers The ADR2100 can be daisy chained regardless ofthe type of serial interface provided bythe host computer Each board on the chain must be assigned an address the BCD address jumper block on the ADR2100 Up to ten boards may be daisy chained The following table shows how to jumper the address jumper block to select a board address Position 8 Position 4 Position 2 Position 1 Address OPEN OPEN OPEN OPEN B OPEN OPEN JUMP OPEN OPEN OPEN JUMP JUMP OPEN JUMP OPEN OPEN 4 OPEN JUMP OPEN JUMP 5 OPEN JUMP JUMP OPEN 6 OPEN JUMP JUMP JUMP 7 JUMP OPEN OPEN OPEN 8 JUMP OPEN OPEN JUMP Bc Table 1 Address Jumper Settings B Physically Connecting Boards The ADR2100 series interface boards have two DB9 connectors that allow daisy chaining The data format used in daisy chaining is RS485 regardless of the host communication type To connect boards on a chai
28. rns status of all I O lines in PORT yin binary format RPyn Returns status of I O line in PORT y specified n2 0 to 7 Myddd Outputs decimal data ddd to PORT y ddd 0 to 255 Py Returns status of PORT yin decimal format RESPyn Resets I O line specified in PORT y nz 0to 7 SETPyn Sets I O line specified in PORT y n2 0to7 An Controls auxillary output if nz1 then aux ON if n 0 then aux OFF PWM OUTPUT COMMAND SUMMARY TAdddd Sets period of PWM module A dddd 0 to 1024 TBdddd Sets period of PWM module B dddd 0 to 1024 EVENT COUNTER COMMAND SUMMARY CEx Clear Event Counter Aor B REx Returns present count of counter RCx Returns present count of counter and clears event counter Aor B INTERRUPT COMMAND SUMMARY IE Enable interrupts ID Disable interrupts IS Returns status of interrupts 1 if enabled 0 if disabled STEPPER INDEXER COMMAND SUMMARY m A for Motor A B for Motor B CPASTEP Configures PORT Ato stepper indexer mode MSddd Sets step speed from 10 to 1000 hz ddd 1 to 100 LmFddddd Loads motor m move register and sets direction to Forward CW LmRddddd Loads motor m move register and sets direction to Reverse CCW Qm Returns present countin motor m move register E Emergency Stop stops all motor movement G Go executes present move ID COMMAND IDN Returns 4 digit product identifier code 2100 ONTRAK CONTROL SYSTEMS INC 6
29. s outputs SPyxxxxxxxx Outputs binary data to PORT y All eight bits must be specified Order is MSB LSB Individual bits configured as input are not effected by this command x 1 example SPA10101000 lt CR gt PAS are set PA6 PA2 PA1 PAO are reset RPy Returns status of all I O lines in PORT yin binary format Order is MSB LSB Individual lines configured as output will return last data set on the port ONTRAK CONTROL SYSTEMS INC 7127 www ontrak net example RPyn example Myddd example Py example RESPyn example SETPyn example An example example RPA lt CR gt 01110010 PA7 PA2 PAO are low PA6 PAS PA4 PAT are high Returns status of I O line in PORT y specified by n n 0 to 7 RPA4 lt CR gt 1 is high Outputs decimal data ddd to PORT y Individual lines configured as input are not effected by this command ddd 000 to 255 MC255 lt CR gt All lines of PORT C are set Returns status of PORT yin decimal format Individual lines configured as output will return last data set on PORT y PA lt CR gt 128 is high PA6 thru PAO are low Resets I O line specified byn in PORT y This command has no effect on I O lines configured as input n 0 to 7 RESPD4 lt CR gt PD4 is reset Sets I O line specified in PORT y This command has no effect on I O lines configured as input n 0 to
30. the standards ofthe EIA RS485 interface specifications The supplied cable is NOT an RS485 cable To communicate via RS485 the host computer must have an RS485 port and be connected directly with two wires TR and TR Atypical connection diagram is shown in figure 2 ADR Omega COM 485 DB9P male J1 or J3 DB9P male TX 5 8 TX TX 4 9 TX Figure 2 Typical RS485 Connection Note that both J1 and J3 are RS485 compatible ports Connection from the host to the ADR2100 should be made using J1 and then J3 is used to enable daisy chaining additional ADR2100 series products The host RS485 port should be configured with the following specifications to enable communications to the ADR2100 9600 Baud 8 bit words 1 stop bit no parity Line feeds should NOT be sent after commands as they may collide with data being returned from the ADR2100 2 PROVIDING POWER TO THE ADR2100 The ADR2100 may be powered using a regulated 5 volt power supply or a suitable wall adaptor Power to daisy chained ADR2100 may also be supplied via the daisy chain cable See the Daisy chaining section of this manual for further information POWER UP USING A 5 VOLT REGULATED SUPPLY If the ADR2100 is to be powered using a regulated 5 volt power supply the 5VDC and GND connections are to be made to the ADR2100 via the main terminal block TB1 The supply mustbe able to provide a minimum of 60mA and up to 240
31. tor Indexer Commands f Interrupt Commands g ID Command 4 Using BASIC with ADR Products 5 Using TURBO C with ADR Products 6 Daisy Chain Options for the ADR2100 7 Interfacing to the ADR2100 basic examples a Reading Potentiometer Position b Connecting Switches to Digital Ports C Connecting LED S to Digital Ports d Driving Solid State Relays e Solid State Temperature Measurement f Event Counter Connections g Using the Stepper Motor Indexer h Using Interrupt Functions APPENDIX A CONNECTION DIAGRAM B ELECTRICAL SPECIFICATIONS C MOUNTING DIMENSIONS ONTRAK CONTROL SYSTEMS INC 2 27 ona ss gt 13 16 17 17 18 19 20 20 21 21 23 25 26 27 www ontrak net READ ME FIRST Thank you for purchasing this ADR2100 Serial Data Acquisition Interface There are three steps to using the ADR2100 1 Connecting your computer or terminal to the ADR2100 2 Providing power to the ADR2100 3 Sending commands to the ADR2100 This manual will provide guidance for completing these steps along with BASIC and TURBO C programming tips An applications section is also provided to describe how to interface various electronic transducers and other devices to the ADR2100 Additional applications and programming examples are available on our web page at http www ontrak net FEATURES 4 10 bit analog inputs 0 5 VDC 2 10 bit PWM outputs 2 16 bit contact or TTL input event co
32. ttp Wwww ontrak net for additional applications and programming examples ONTRAK CONTROL SYSTEMS INC 26 27 www ontrak net APPENDIX C MOUNTING DIMENSIONS ADR Interface Mounting Dimensions in inches 3 0 gt ADR101 ADR112 O ia Ext Dim 3 0 X 2 8 Hole Pat 2 6X2 4 4 Hole Dia 0 125 FRONT 4 5 4 gt z ADR2000A ADR2000B M 5 0 ADR2100 ADR2010 ADR2200 Ext Dim 5 4 X 2 8 Hole Pat 5 0X2 4 Hole Dia 0 125 2 4 VORNE FRONT Q 7 8 ADRTERM i Ext Dim 7 8X 1 5 15 11 37 Hole Pat 7 4 X 1 1 ME s Hole Dia 0 125 ONTRAK CONTROL SYSTEMS INC 27 27 www ontrak net
33. unters 32 digital VO lines individually programmable as input or output high current digital I O lines sink 20mA source 20mA 4 interrupt lines TTL dual stepper motor indexer function on board RS232 to RS485 converter daisy chainable up to 10 boards daisy chainable power supply low power requirements 5 volts at 30mA Typical power up via standard wall adapter optional simple yet versatile commands easy to use with Visual BASIC or TURBO C programs compatible with ADR2000 interfaces ONTRAK CONTROL SYSTEMS INC 3 27 www ontrak net 1a THE ADR2100 RS232 INTERFACE The ADR2100 communicates via a standard RS232 port utilizing a simple three wire interface The only signals used are received data RC transmitted data TX and ground GND Most RS232 ports use hardware handshaking i e DTR DSR CTS RTS signals to control the flow of data on the port For this reason the cable required to connect to the ADR2100 must have jumpers on the DB25 end to satisfy these handshaking requirements IBMor compatible computers may be used as a host computer with the supplied cable The supplied cable has the following connections ADR IBM etc DB9P male DB25S female RC 3 RED 2 TX TX 7 WHITE 3 RC GND 2 BLACK r 4 RTS X 05 CTS 1 6 DSR 7 GND 8 DCD 20 DTR Figure 1 Supplied Cable Wiring Diagram If the host computer has 9 pin serial port connector a 9 pin to 25 pin
34. weak pull ups when configured as digital inputs to facilitate contact inputs The Interrupts operate in two modes determined by the mode of PORT A STANDARD MODE In standard mode PORT A configured as digital I O with no stepper indexer functions the interrupts can be used to signal the host when a digital I O line is brought low by an external event such as a key press The inputs are scanned 10 000 times per second requiring a pulse width of 100us to guarantee an interrupt When interrupts are enabled the host will return a two digitinteger code upon interrupt where the first digitis the board address and the second digit is the interrupt number The interrupt number corresponds to the digital I O line that generated the interrupt as follows PAO PA1 PA2 For example if interruptis generated by PA2 brought low on board 0 the ADR2100 will return 03 cr Or if PAO is brought low on board the ADR2100 will return 31 lt cr gt Interrupts are enabled using the command IE and must be enabled after the is used to configure the port When the portis configured using the CPA ooooocx command ONTRAK CONTROL SYSTEMS INC 23 27 www ontrak net interrupts are disabled Once an interrupt is generated for a particular I O line itis masked and no longer checked until re enabled byan IE command sent bythe host Interrupts may be disabled using the ID command Care should be exer

Download Pdf Manuals

image

Related Search

Related Contents

Bosch Appliances D1265 Home Security System User Manual  republique du mali - African Water Facility  FHT-41307N-PD9  tSENSE VAV No Disp User manual  USER`S MANUAL Embedded Printer    Manual de Instruções  Manual do Utilizador  m-89 manual de usuario horno eléctrico whirlpool chile  CS-5000S  

Copyright © All rights reserved.
Failed to retrieve file