Home
Sartorius Data Input YDI150. Port Drivers for YDI 150
Contents
1. The Serial Port Device Driver SER150 The serial port device driver SER150 manages the input and output of data to or from a serial interface port This driver is embedded in the operating system OS as an OS device driver In addition the driver can be used with the standard input and output commands of your favorite compiler without requiring the DOS application program inlets DOS API The SER150 driver supports the following features otocol modes character and block orientation Different p free running character by character block terminated by special character block terminated by block length block terminated by timeout between characters SARTONET master slave protocol with special interface hardware Timeout check 3 programmable values are available for the timeout WRITE timeout READ timeout Block start timeout Programmable transmission parameters baud rate 110 baud to 38 400 baud word length parity stop bits Individual and automatic checking and setting of handshake lines Data Terminal Ready RTS Request To Send DSR Data Set Ready RI Ring Indicator CTS Clear To Send DCD Data Carrier Detect XON XOFF protocol The size of the input and output buffers is programmable Installation of the SER150 Driver To install the SER150 device driver on
2. io ctrl struct s setline t unsigned unsigned unsigned unsigned setline struct s write 2nd buff unsigned char buff2 1o control int int int int char char int int int Long Long Long char char int int int int int dev status dev Len dev bgn dev prm protmode protmode 2 endvalue obuff size uartset timea timeb timec xon char xoff char func rts dtr tx break func dataL 201 typedef struct s change uart unsigned unsigned unsigned t_change_uart int int char func port int_number 20 void main void int end int error int status char bufferL1001 fh open V24 0_RDWR O_BINARY io ctrl dev status SET PROTOCOL io ctrl timea 500001 50 milli second 000000L 1 second io ctrl timeb 1 10000000L 10 seconds io ctrl timec io ctrl uartset BAUD 9600 STOPBIT_1 WORDLEN PAR EVEN io ctrl protmode MODE ENDCHAR io ctrl endvalue 10 Block terminator LineFeed status ioctl fh IOCTL_WRITE amp io_ctrl sizeof io ctrl2 printfC nIOCTL returns Zd n status close fh H The example program shown sets the protocol parameters of the SER150 driver All available IOCTL WRITE commands are documented in the following sections The required function is defined in the first 2 byte integer field dev status of the io ctl CHanguage format Function
3. 9804 7 000 73 Sartorius Data Input YDI 150 Port Drivers for YDI 150 Data Input Terminals UAT AMAA Sa rtorius Contents Making a Working Copy of Your Driver Disk The Digital I O Port Driver I2CDRV BIN The Port Device Driver Accessing the Ports Digital Output Port Digital Input Port Dip Switch Port Turbo Pascal DeviceMode Function The Serial Port Device Driver SER150 nstallation of the SER 150 Driver Use of the SER150 Driver in an Application Program OPEN the Driver WRITE Command Send Data READ Command Receive Data Control WRITE Command Function MOUNT Memory for Input Buffer Function 1 PURGE Memory lor Input Buffer Function 2 SET PROTOCOL Parameters Function 3 FLUSH INPUT Buffer Function 4 FLUSH OUTPUT Buffer Function 5 FLUSH OUTPUT2 Buffer Function 6 FLUSH ALL Buffers Function 7 SET UARTLINES Function 8 WRITE BUFFER 2 prenom 9 Change UART Func 10 Set MUX Channel VO Cone READ Command The V24_ SET Program SARTONET MASTER Settings SARTONET SLAVE Settings All Other Protocol Settings Sartorius Software License Agreement Legal Notice SARTORIUS Registration Card Q OO Ont d e Enclosure 31 2 inch program disk Making a Working Copy of Your Driver Disk You should make a working copy of your driver floppy disk If this copy is damage
4. SARTONET slave address before activating the READ function The READ function returns characters read if the SARTONET slave does not respond within 50 milliseconds The READ function returns 1 character read if the slave responds but has no data available After a successful readin with the READ function the first byte of the input buffer contains the SARTONET slave address Control WRITE Command The control WRITE command is used to program the characteristics nd the transmission parameters All settings you make will remain valid even after osing the device driver Because the WRITE command is not supported y the standard MS DOS device drivers compilers that are unable to support this ommand may exist he compiler must be able to support function 44h subfunction O3h of the interrupt h Otherwise use the V24 SET program to set the parameters for the devic river see the section entitled The V24 SET Program The C function description refers to the following data structure define IOCTL READ 2 Hdefine IOCTL WRITE 5 Hdefine IOCTL INSTAT 6 Hdefine IOCTL_OUTSTAT r4 Hdefine STOPBIT 1 0x0000 define STOPBIT 2 0x0001 define WORDLEN 5 0x0000 define WORDLEN 6 0x0002 define WORDLEN 7 0x0004 Hdefine WORDLEN_8 0x0006 define PAR EVEN 0x0000 Hdefine PAR ODD 0x0008 define PAR ZERO 0x0010 define PAR NONE 0x0018 define BAUD 1
5. an MS DOS computer you must enter of the following lines in the CONFIG SYS file in the root directory of your boot device usually this fle is C NCONFIG SYS DEVICE lt path gt SER150 SYS lt buffsize gt lt port gt lt interrupt gt lt name gt or DEVICE lt path gt SER150 SYS lt name gt or DEVICE lt path gt SER150 SYS 12 The parameters have the following meanings path The full path for the directory that contains the SER 150 SYS file lt buffsize gt The length of the input buffer 1 6 byte paragraphs as a hexadecimal value e g 800 8000 hex bytes 32K default 80 800hexbytes 2 port The I O address of the serial port you want to use as a hexadecimal value for COMI use 3F8 for COM2 use 2F8 and for MUX use 300 default 3F8 COM1 lt interrupt gt The number of the interrupt that the serial port is using as a hexadecimal value for COMI use OC for use OB and for MUX use OF default OC COMI name The name you want to use to open the device driver The name may be up to 8 characters long Note Check to make sure that no other file or directory has the same name extension does not matter Otherwise you will overwrite this file or directory and it will no longer be accessible e g 24 default factory setting V24SART The parameters buffsize port interrupt and lt name gt may be omitted In this case the
6. default value is used Example CONFIG SYS FILES 20 BUFFERS 20 DEVICE C DRIVERS SER150 SYS 200 2F8 OB SER2 This CONFIG SYS file installs the driver SER150 SYS that resides in directory C DRIVERS An input buffer of 2000 hex 8 is reserved The serial port is selected and the name for the OPEN command is SER2 Use of the SER150 Driver in an Application Program Use the driver with the appropriate INT 21h command of the MS DOS operating system if you need to write assembler programs or if you use the commands of a Higherlevel programming language for example C or PASCAL The following is an application example for a C compiler If you use a different compiler refer to the corresponding manual or to the documentation of the MS DOS operating system for further details OPEN the Driver Before you transmit characters you must open the device driver with the OPEN function e g void main void t int v24 handle v24 handle open ser1 0 RDWR BINARY open for READ and WRITE in BINARY mode if v24 handle 1 t printf Error at OPEN of device ser1 n exit 95 error exit else Ok no error during open With the programming language C you must store a numeric value 2 byte for handle which is returned by the OPEN function because all O functions refer to this value WRITE Command Send Data You can use the WRITE
7. dip switch or relay port is addressed The following characters indicate the state of the individual O lines Characters 2 3 4 represent the I O lines 0 1 2 The string length is therefore defined by the number of individual lines port The input ports have 8 lines the relay and dip switch ports have 4 lines I O port identifiers ASCII character O 4 Digital Output port ASCII character I 0x49 Digital Input port ASCII character R 0x52 Relay output port ASCII character D 0 52 Dip port Lines status ASCII character 0 0 30 Logical O ASCII character 1 031 Logical ASCII character X 0x58 No change Example To turn the first 2 relays on and leave the second 2 unchanged the following string would be written to the device file DIGI RTTXX Digital Output Port The YDI 150 has an output port with 8 open drain FET output lines They are internally connected to 5 volts via pull up resistors The output lines are set by writing a control string to the device file DIGI The control string consists of 9 characters the output port identifier O and 8 characters representing the output lines O 7 which are encoded as follows Open Drain Output Control During execution of the WRITE function the device driver modifies the control string so that the X is replaced by the current output value AS
8. handle buffer 1 if status 0 printf Slave not connected Nn if status 1 printf Slave is busy n if status Len 1 return OK else return NOT OK READ Command Receive Data Use the READ function to receive characters from the serial port The character block remains unchanged during transfer and includes an end of block character With the READ command the maximum number of characters to be read is specified but the SER 150 driver sends only the characters up to the end of the current block being transferred If the READ function reads less than the number of characters in the block the remaining characters are stored and can be read with the next READ command You can program the SER 1 50 driver to recognize th end of a block by end ofblock character a fixed block length a timeout between two characters SARTONET protocol For example the following function reads an ASCII NUL 4erminated string of a given maximum length int readstring int v24 handle char input int maxlen int len Len read v24_handle input maxlen if Len 1 printf Read error at device SER1 n return NOT_OK if Len 0 printf No data at device SER1 n return NOT OK inputL Len 0 terminate string for return OK With the SARTONET master protocol mode selected you must set the first byte of the input string to the desired
9. in input buffer status of Clear To Send CTS line status of Data Set Ready DSR lin status of Ring Indicator RI line status of Data Carrier Detect DCD line c c c UJ 09 U2 V 00 C2 U2 VV OO 00 E Co 2 OD c I II cu The following program example shows two functions that use IOCTL READ The first function reads the complete protocol setting the second function returns the error status O if no error occurred read protocol settings C int v24 handle struct io control io_ctrl t ioctlCv24 handle IOCTL READ io ctrl sizeof struct io control 2 H int read status Cint v24 handle t char status ioctlCv24 handle IOCTL READ amp status 1 return status The 24 SET Program The V24_SET EXE program can be used to set the transmission parameters of the device driver with an MS DOS command line e g in a batch file without having to activate the IOCTL function within an application There are three different forms of settings possible SARTONET MASTER Settings To set the interface port as a SARTONET master use the following command V24 SET name SNET MASTER name gives the name of the MS DOS device driver Len gives the length of the SARTONET output and input buffers default setting is 256 bytes SARTONET SLAVE Settings To set the interface port as a SARTONET slave use the following comm
10. 0 MOUNT Memory for Input Buffer With the MS DOS operating system the size and location of the input buffer is defined during the boot process in the CONFIG SYS file However you can use function O to relocate the buffer For this purpose the function needs the following information in the io ctrl C language format dev status 2 byte integer defines function mount dev Len 2 byte Buffer length in paragraphs 16 bytes dev bgn 2 byte integer Buffer start segment in paragraphs 16 bytes dev prm 2 byte integer Input buffer size used This field is only important if you read the IOCTL information with the IOCTL READ command Except with SARTONET this value is equal to dev len With SARTONET the value is lower db the amount of memory that is used for the output buffer All other parameters are not recognized by function O Function 1 PURGE Memory for Input Buffer You can also use this command in the MS DOS environment but it will not deallocate the buffer dud The program itself must deallocate the input buffer memory The only commands that are available without a mounted buffer are OPEN CLOSE IOCTL WRITE and IOCTL READ dev status 2 byte integer 1 defines function 1 purge All other parameters are not recognized by function 1 22 Function 2 SET PROTOCOL Parameters This function is used by the V24 SET program and can also be accessed from your application prog
11. 10 0x0000 define BAUD 150 0x0020 define BAUD 300 0x0040 define BAUD 600 0x0060 define BAUD 1200 0x0080 define BAUD 2400 0x00a0 define BAUD 4800 0x00cO0 define BAUD 9600 0x00e0 define BAUD 19200 0x0100 define BAUD 38400 0x0120 Hdefine CONTROL RTS 0x0400 Hdefine CONTROL DTR 0x0800 Hdefine CHECK XONXOFF 0x0200 define CHECK CTS 0x1000 define CHECK DSR 0x2000 Hdefine CHECK RI 0x4000 define CHECK CD 0x8000 Hdefine MODE FREERUN 0 define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define MODE_ENDCHAR MODE_BLOCKLEN MODE_TIMEOUT MODE_SNETSLAVE MODE_SNETMASTER ERR_OVERRUN ERR_PARITY ERR_FRAMING ERR_OVERFLOW ERR_SENDTIME ERR_RECTIME ERR_WAITTIME ERR_BLKCHECK STAT_OUTBUFF2 STAT_OUTBUFF1 STAT_INBLOCK STAT_INBUFFER STAT_CTS STAT_DSR STAT_RI STAT_DCD MOUNT PURGE SET_PROTOCOL FLUSH_INPUT FLUSH_OUTPUT1 FLUSH_OUTPUT2 FLUSH_ALL SET_UARTLINE WRITE_BUFFER2 CHANGE_UART 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x0100 0x0200 0x0400 0x0800 0x1000 0x2000 0x4000 0x8000 struct t unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned
12. CII character 0 0x30 FET is conducting the output is tied to the reference potential O volts ASCII character 1 Ox31 FET is the output changes to 5 volts without a load ASCII character X 0x58 No change During execution of the WRITE function rad device driver modifies the control string so that the X is replaced by the current output value Examples Say you want to set the FET at Output line 5 to conducting state i e to reference potential Assume that all the output lines are initially non conducting i e tied to 5V via the pull up resistors The following cone sine OXXXXXOXX should be written to the device driver After the write operation the control string is modified to D11111011 Turbo C int handle char ctrl strL103 strcpy ctrl str OXXXXXOXX digi O WRONLY O BINARY write C handle 9 ctrl str close handle Turbo Pascal CONST O Binary True VAR Ctrl_Str ArrayL0 81 of Char Handle File BEGIN Ctrl_Str OXXXXXOXX Assign Handle DIGI ReSet Handle 1 Does not open files in binary mode DeviceMode Handle O Binary See last page in this section for BlockWrite Handle Ctrl_Str 9 function listing Close Handle END Quick Basic OPEN DIGI FOR BINARY AS 2 CTRL STR OXXXXXOXX PUT 2 STR CLOSE 42 Relay Output Port The YDI 150 has a relay port with 4 sing
13. F OAhex V24 SET SER2 9600 E 7 1 800 1000 1000 CHAR 0xOa DTR RTS CTS Sartorius Software License Agreement The terms of this Agreement governing the use of Sartorius software by you the end user also referred to hereinafter as the LICENSEE are described below By opening this sealed disk package and by signing the registration card you are agreeing to become bound by the terms of this Agreement For this reason please read the following text carefully in its entirety If you do not agree to the terms of this Agreement do not open the disk package In this case promptly return the unopened disk package and any other items including all written materials hardware supplied along with the software and the ackaging which are part of this product to the place where you obtained them for a full refund Sartorius software license 1 Subject Matter of the Agreement The subject matter of this Agreement is the data medium floppy disk containing the computer program the user s manual and the accompanying written material In the these will also be referred to the SOFTWARE Sartorius hereby calls your attention to the fact that based on the present state of the art it is impossible to produce computer software which will operate without error for all applications and in all combinations The subject matter of th Agreement is thus only a software program which can be used in principle as described in the user s man
14. ND Quick Basic OPEN DIGI FOR BINARY AS 2 CTRL_STR RXOOX PUT 2 CTRL_STR CLOSE 2 Digital Input Port The YDI 150 has an input port with 8 TTL input lines They are internally connected to 5 volts via pull up resistors The input line settings are read from the device file DIGI into a 9 character long control string The first character identities the input port and must be initialized to I before calling the read function The remaining 8 characters representing the individual input lines O 7 are returned as follows ASCII character 0 0x30 The input is shortcircuited to the reference potential or less than 0 8 volts are applied to the input with respect to the reference potential ASCII character 1 0x31 The input is not connected or more than O 8 volts are applied to the input with respect to the reference potential or the input line was n and set fo 5 volts through the internal pull up resistors Examples Assume inputs 3 4 and 5 are shortcircuited to the reference potential The other inputs are not connected After the read operation the control string is modified to 1 110001 1 Turbo C int handle char ctrl strL103 ctrl strL01 I digi O RDONLY O BINARY read K handle 9 ctrl str close handle Turbo Pascal CONST Binary True VAR Ctrl Str ArrayL0 81 of Char Handle File BEGIN Ctrl S
15. RFLINES will be overwritten during the next READ or WRITE command Important Note If you set the DTR line manually with the device driver in the SARTONET mode the SARTONET protocol will be disrupted or in the worst case the line driver chips will be destroyed Function 7 uses a different control format struct s_setline unsigned int func unsigned int rts unsigned int dtr unsigned int tx break setline void main void t fh open V24 0 RDWR O_BINARY setline func SET UARTLINE setline rts 1 setline dtr 1 setline tx break 1 ioctLCfh IOCTL WRITE S amp setLline sizeof setline The fields of setline have the following meanings func 2 byte integer 7 defines function 7 SET UART LINES rts 2 byte integer set Request To Send line RTS to set RTS to 1 2 leave RTS unchanged dtr 2 byte integer set Data Terminal Ready to set DIR to 1 2 leave unchanged tx_break 2 byte integer set Transmit line to break condition 1 set Tx to 1 standard setting without transmission 2 leave Tx unchanged Function 8 WRITE BUFFER 2 This function is used in the SARTONET slave mode to write data in the output buffer 2 This buffer has a higher priority than output buffer 1 The buffer is written with the standard WRITE function The WRITE BUFFER 2 command is executed if the output buffer 1 already contains data that has not yet bee
16. S check O Bit 13 DSR check 0 Bit 14 RI check O Bit 15 CD check O 4 byte long integer no RTS control RTS line control is set before transmission and reset to O afterwards no control DTR line control is set if more than 16 bytes are available in the input buffer and is reset if less than 16 bytes are available in the input buffer no CIS line check CIS line check before transmission no DSR line check DSR line check before transmission no RI line check RI line check before transmission no CD line check CD line check before transmission Timeout during sending of data in microseconds The resol 4 byte long ution of the integer Timeout occurred when a b the start o th timer is millisecond ock was received as measured from e block first character to the end of the block In protocol mode 3 timeout this value defines the timeout between two characters wh 4 byte long Timeout o CC integer urred during a READ command from the start of a ich terminates the block READ command to the arrival of the first character of the block xon char l byte integer ASCII code of the character that is used as the XON character for the XON XOFF protocol xoff char 1 byte integer ASCII code of the character that is used as the XOFF character for the XON XOFF protocol Important Note SARTONET Transmiss
17. and V24 SET name SNET SLAVE addr tc name gives the name of the MS DOS device driver addr gives the SARTONET slave address 0 3 1 tc timec receive timeout in milliseconds 32 33 All Other Protocol Settings To operate the interface port with another protocol mode use the following command V24 SET name baud parity wordlen stopbit ta tb tc mode ctl gives the name of the MS DOS driver baud rate 110 150 300 600 1 200 2 400 4 800 9 600 19 200 38 400 baud parity odd E even Z zero length 5 to 8 bits name baud parity wordlen stopbit ta tb tc mode ctl The following example handshake and blocks word number of stop timer timer timer gives the block transfer mode NONE CHAR ccc bits to 2 bits a send timeout in milliseconds endo start of bloc TIMEOUT b LEN Len b contro parameters RI CTS DSR CD hands output bloc ock has a fixed length o buffer k receive timeout in milliseconds k receive timeout in milliseconds no block transfer ccc is the end ofblock character ock terminated by timeout tb between two characters en RTS enable checking control of the hake lines sets XON XOFF for software handshake OBUF len sets th ngth len of an nables driver ser2 with 9 600 baud hardware terminated by L
18. changing the SOFTWARE or creating derivative works based on the written materials Ownership of Software By purchasing the product you have obtained ownership only of the physical data medium on which the SOFTWARE has been This does not constitute the purchase of rights to the SOFTWARE itself In particular Sartorius The SOFTWARE an copy for backup pu mb nu It is expressly forbid whole or in part or the written mater incorportated in oth retains title to the SOFTWARE and all rights with respect to the publication copying processing and usage of the SOFTWARE d the accompanying written material are If the rooses The removal of copyr ers from the SOFTWARE is prohibited den to copy or duplicate in a he original SOFTWARE any al al or any of these in combin er software the terms of this Agr expressly forbidden Term of the Agreem to Use eement nt if you fail to comply including modified copies if any Compensation for Damages in the Event Sartorius draws your attention to the fact that you are liable for all SU T NSE is effective until terminated his LICENSE will terminate automatically without notice from Sartorius ation w SOFTWARE is not copy protected you are permitted to make a single working ight sym bols or registration ny other manner either in tered form of the SOFTWARE th other softwa
19. cters are written arameter For the SARTONET protocol mode a buffer must be defined In the SARTONET mode obuff_size also length of input data defines the maximum Important Note You must ensure that sufficient buffer memory is MOUNTed to the driver to hold all of the buffers Compute this value as follows required buffer bytes 2 obuff_size endvalue 16 SARTONET mode Or required buffer bytes obuff size 16 for all other protocol modes If there is not enough buffer memory space the IOCTL WRITE command returns the value for O transmitted characters uartset Bit O Bit 1 2 Bit 3 4 Bit 5 8 Bit 9 2 byte integer Stop bits O stop bit 2 stop bits Word length 00 5 bits O 6 bits 10 7 bits 8 bits Parity 00 even parity O odd parity 10 zero parity no parity Baud rate 110 38 400 0000 lObits s 000 150 bits s 0010 300 bits s 00 600 bits s 0100 1 200 bits s 010 2 400 bits s 0110 4 800 bits s Ol 9 600 bits s 1000 19 200 bits s 100 38 400 bits s XON XOFF protocol O disable enable XOFF The V24_SART driver software o a transmission speed up to 38 400 bits s However not all to receive data at all speeds without overrun errors ardware is able to respond fast enough 24 25 timea timeb timec Bit 10 RTS control O Bit 11 DTR control O Bit 12 CT
20. d or if the files are inadvertently deleted you will still be able to work with the files on the original disk The DISKCOPY command is used to copy the contents of one disk to another Using DISKCOPY is the quickest way to copy disks since this command copies the entire contents of a disk in one operation mportant The DISKCOPY command can be used only if the original disk drive and the target disk drive have the same capacity nsert the driver disk into drive A and then enter the following command f you have a PC with one disk drive DISKCOPY f you have a PC with two disk drives DISKCOPY A B Next press the ENTER key f your TARGET disk is unformatted it will be formatted during the copy procedure Follow the instructions on the screen to complete the copy procedure Keep your original driver disk in a safe place From now on use only the working copies Keep your original disk in a safe place and use it only for making additional working copies Complete the Registration Card and return it to us so that you will automatically receive regular updates The Digital O Port Driver I2CDRV BIN The information in this section is intended for programmers who want to write applications to control the digital ports on the YDI 150 All models of the YDI 150 series are BOUE WR 8 digital inputs 4 dip switch inputs 8 digital outputs and 4 single pole cios eot relay ports The port
21. definition area of the program struct int set chan func int muxport set chan code area of the program set chan set chan func z10 function no set chan muxport port allowed 1 3 ioctl handle IOCTL WRITE amp set chan sizeof set chan Control READ Command The READ command allows you to read the current status of the SERT50 driver You can read all of the information in io ctl C language convention as described in the sections MOUNT buffer on page 22 and SET PROTOCOL on page 23 You can read all or only part of the information Nearly all readable information has usually been set by your application program For this reason it is not really necessary to always read the information except for the first two bytes The first two bytes ede the actual status of the device driver in th dev status field 30 The first byte in the dev status field is reset to O after every READ and receives the error status The 2nd byte is updated during every READ command and contains general status information dev status 2 byte integer it Q overrun error error raming error buffer overflow error send timeout fimea receive timeout timeb wait timeout block check error SARTONET modes output buffer 2 in use output buffer 2 in use data available in current unterminated input block terminated data block available
22. function to send characters via the serial interface The character string will be sent as an unmodified string end oFblock characters are added Only the SARTONET protocol mode adds the necessary protocol headers and trailers to the string If you have activated the check function for the modem lines the SER150 driver will check the lines before every character transmission and will also check the timeouts If a timeout occurs the transmission is aborted For this reason are returned by the WRITE function you should check the number of transferred characters that The following is an example of a function that transmits a string and checks the results int writestring Cint v24 handle char output int Len strlenCoutput if C uriteCv24 handle output Len return OK else return NOT_OK With the SARTONET master protocol selected the first byte of the output data is not sent rather it defines the address of the SARTONET slave that should receive the data If the WRITE command returns characters sent the slave was not connected If the WRITE command returns 1 character sent the slave responded but was unable to receive data receive buffer full Example int writestring_masterCint v24_handle int adress char output char bufferL 3001 int Len strlenCoutput int status bufferL0J adress strcpy buffer 1 output status write v24
23. ion Parameters Basically it is possible to combine protocol modes 4 and 5 SARTONET with each of the supported transmission parameters However please keep in mind that the driver will not work with other SARTONET devices unless they have the following parameter settings io ctrl timea 50000L 50 millisecond io ctrl timeb 1000000L 1 second io ctrl uartset BAUD 9600 1 WORDLEN 7 PAR EVEN Function 3 FLUSH INPUT Buffer Function 3 is used to flush the input buffer This function deletes all blocks that are stored in the input buffer Function 4 FLUSH OUTPUTI Buffer unction 4 clears the output buffer 1 This function can only be used if the output uffer has been defined In the SARTONET protocol mode this command is not executed if transmission of the buffer contents has already started Function 5 FLUSH OUTPUT2 Buffer Function 5 clears the output buffer 2 This buffer is only available in the SARTONET mode The command is not executed if transmission of the buffer contents has already started Function 6 FLUSH ALL Buffers The FLUSH ALL function is a combination of functions 3 4 5 and You can erase all data with this single command O T 26 Function 7 SET UART LINES With function 7 you can set the UART lines manually If you have chosen DTR control or RTS control in the uartset variables with 2 SET PROTOCOL the value that you set with SET UA
24. le pole doublethrough relays The relays are set by writing a control string to the device file DIGI The control string consists of 5 characters the relay port identifier R and 4 characters representing th individual relays O 3 which are encoded as follows The desired position of the relay contacts must be coded in the following way ASCII character O 0x30 gt Relay in ON position ASCII character 1 0x3 1 Relay in OFF position ASCII character X 0x58 No change During execution of the WRITE function the device driver n modifies the control string so that an X is replaced with the current output value Examples Say you want to switch the relays 1 and 2 to the position Assume that all the relays are initially in their OFF positions The following control string RXOOX should be written to the device driver After the write operation the control string is modified to R 1001 Turbo C int handle char ctrl strL631 strcpy ctrl str RX00X 2 digi O WRONLY O BINARY write Chandle 5 ctrl str close handLle Turbo Pascal CONST Binary True VAR Ctrl Str ArrayL0 41 of Char Handle File BEGIN Ctrl Str RX00X Assign Handle DIGI 5 ReSet Handle 1 Does not open files in binary mode DeviceMode Handle O Binary See last page in this section for BlockWrite Handle Ctrl_Str 5 function listing CLoseCHandle E
25. n transmitted to the SARTONET master For this reason the data of output buffer 2 are first sent to the SARTONET master The example shows a function that writes a character string in buffer 2 struct s write 2nd buff unsigned int func char dataL201 buff2 int writestring_buffer2Cint v24 handle char output t int status int Len strlenCoutput buff2 func WRITE BUFFER 2 strcpy buff2 data output status ioctl fh IOCTL_WRITE amp buff2 2 return status The WRITE command returns O if buffer 2 is already in use 28 29 Function 9 Change UART This function is only applicable under the MS DOS operating system It allows a change in the UART address without changing the devicez line in th CONFIG SYS file typedef struct s change uart unsigned int func unsigned int port unsigned char int number t_change_uart t_change_uart change_uart void main void 1 fh open V24 O_RDWR BINARYO change uart func CHANGE UART change uart port 0x2f8 COM2 port adress change uart int number Oxb COM2 interrupt number ioctLCfh IOCTL WRITE amp change uart sizeof change uart2 Function 10 Set Channel This function only works with the MUX ports M1 to of the YDI150 address interrupt It is used to switch back and forth among three channels of the UART Example
26. ram to control the operating parameters of the SER150 driver You can set the baud rate character format end of block characters and timeout values The parameters used are dev status dev Len dev dev prm protmode protmode 2 endvalue obuff size 23 byte integer defines function 2 set protocol byte integer ot used with function 2 te integer used with function 2 9 byte integer used with function 2 ZN ZN ZN NN z 9 byte integer SD O character see endvalue slave device nA A Wh master device byte integer ines the protocol mode for the driver Free running blocks are not terminated End character blocks are terminated by an end Block length blocks are of a fixed length see endvalue Timeout blocks are terminated by timeb defined as the timeout variable after the last character SARTONET slave the driver acts as a SARTONET SARTONET master the driver acts as a SARTONET SARTONET address for the SARTONET slave 2 byte integer For protocol mode 1 ASCII value of end of block character For protocol mode 2 Fixed length of the incoming blocks For protocol mode 4 Length of outp 2 byte integer Length of output buffer in bytes If this WRITE command will not wait until c instead it will immediately return a p ut buffer 2 in bytes length is not O the hara
27. re or erred to a third party Giving the SOFTWARE away as well as renting or leasing it to third parties is with any provision of this LICENSE Upon termination you shall destroy the written materials and all copies of the SOFTWARE of Breach of Contract resulting from copyright violations which are incurred by Sartorius throug violation of the provisions of this Agreement by you Modifications and Updates Sartorius is entitled to create updated versions of the SOFTWARE at its own discretion 10 Warranty and liabi b c d lity of Sartorius Sartorius warrants to their original LICENSEE thot at the time the SOFTVVARE is which the SOFT urnished to WARE has the LICENSEE the data medium floppy disk on been recorded and the hardware supplied along with the SOFTVVARE are free from defects in materials and workmanship under norma If the data medi um floppy SOFTWARE is defective th replacement du she must return ring the wa supplied d and copy or t For the reasons any liability for Sartorius provid requirements or connection with other prog Use and service disk or the hardware supplied along with the e purchaser is entitled to demand a rranty period To obtain this replacement he or the floppy disk any hardware which may have been with the SOFTWARE the working copy the written material he bill to Sar
28. s are internally connected to an I2C bus and are accessed through the simple to use I2CDVR BIN device driver The I O Port Device Driver DOS devices are implemented through reserved file names that have a special meaning attached to them e g PRN is the default printer device and COMI or AUX are the first serial port device names From the programmer s point of view a device is treated as a file and is operated on through the standard file O functions e g READ WRITE OPEN and CLOSE using the received file name The digital input and output ports on the YDI 150 use the device driver I2CDRV BIN Once the driver is installed the reserved file name DIGI is used to access the O ports To install the driver include a DEVICE command with a path to the I2CDRV BIN file in your CONFIG SYS file e g DEVICE D I2CDRV BIN Note If you are chaining control from CONFIG SYS to HDCONF SYS make sure to include the DEVICE statement in the HDCONE SYS file instead Example The following line is added to CONFIG SYS device c util i2cdrv bin Accessing the I O Ports The I O ports are accessed by reading and writing ASClHormatted control strings to the port driver after opening the device file DIGI in binary mode Any programming language that can open read and write to DOS files may be used e g C Pascal Basic The first character of the control string indicates the port type whether an input output
29. ser s manual entitled Port Drivers YDI 150 Data Input Terminals may not be reproduced or copied xcept for the purposes of making a backup disk The said purchaser and or acquirer may use the program only for his or her own purposes he or she may not make it AE to third parties either for a fee or free of charge By using and operating the program the purchaser acquirer acknowledges the Sartorius License Agreement enclosed with the original program Sartorius 4 37070 Goettingen Germany t Weender Landstrasse 94 108 37075 Goettingen Germany 49 551 308 0 18 49 551 308 32 89 Internet http www sartorius com Copyright by Sartorius AG Goettingen Germany All rights reserved No part of this publication may be reprinted or translated in any form or by any means without the prior written permission of Sartorius AG The status of the information specifications and illustrations in this manual is indicated by the date given below Sartorius AG reserves the right to make changes to the technology features specifications and design of the equipment without notice Status April 1993 Sartorius AG Goettingen Germany Printed in Germany on paper that has been bleached without any use of chlorine W1A130 KT Publication No WYD6046 193041 sartorius
30. t open files in binary mode DeviceMode Handle O Binary See last page in this section for BlockRead Handle Ctrl Str 4 function listing CLoseCHandle END Quick Basic CTRL_STRS DXXXX REM to predefine the string length OPEN DIGI FOR BINARY AS 2 GET 2 1 CTRL STR REM to read from position 1 in file CLOSE 2 Turbo Pascal DeviceMode Function When a DOS character device is opened with the standard Turbo PASCAL open functions Reset ReWrite or App nd there is no option to omit filtering by setting the device to binary mode The remedy is to call DeviceMode after opening the device It makes a call to DOS function 44 IOCTL and sets the file passed in Handle to binary mode if the variable BinMode is true DeviceMode returns TRUE if the mode change was successful Function DeviceMode Var Handle File BinMode Boolean Boolean VAR Regs Registers Uses DOS unit BEGIN With Regs DO BEGIN 4400 BX FileRec HandLle IF lt gt 0 THEN BEGIN Continue if file handle is valid MsDos Regs Read current device settings DX AND 0080 lt gt 0 THEN BEGIN Only change mode if handle is a AX 4401 Character Device DH 0 IF BinMode THEN DL DL OR 20 Set Binary mode ELSE DL DL AND DF Setcharacter translation mode MsDos Regs DeviceMode True END ELSE DeviceMode False END ELSE DeviceMode False END with END
31. torius or to the dealer from whom he or she bought the product explained under provision 1 Sartorius shall not assume the SOFTWARE being free from defects In particular es no guarantee that the SOFTWARE will satisfy the objectives of the purchaser or that it will function in rams selected by the purchaser The purchaser shall bear the responsibility for the correct choice of software as well as for the consequenc responsible for to the written material Sartorius is not caused by deliberate es of using this SOFTWARE he or she shall also be the results intended or actually obtained The same applies accompanying the SOFTWARE iable for damages unless such damages have been or gross negligence on the part of Sartorius Any liability for characteristics expressly warranted by Sartorius remains unaffected Any liability for which are not covered by the express warranty is excluded consequential damages resulting from defects 36 37 Legal Notice Important Information for the Purchaser and User of the Software Program Hereunder The purchaser and or acquirer of the software program hereunder hereby recognizes the fact that this program is subject to ownership copyright patent and other protected rights and that he or she will not at any time acquire any of these aforementioned rights by purchasing or using the program hereunder The entire program as well as parts of the program or the u
32. trL0J I Assign HandLe DIGI ReSet Handle 1 Does not open files in binary mode DeviceMode Handle O Binary See last page in this section for BlockRead Handle Ctrl_Str 9 function listing CLoseCHandle END Quick Basic CTRL_STR IXXXXXXXX REM to predefine the string length OPEN DIGI FOR BINARY AS 2 GET 2 1 CTRL_STR REM to read from position 1 in file CLOSE 2 Dip Switch Port The YDI 150 has an input port controlled by 4 internal dip switches located in the base of the YDI 150 The dip switch settings are read from the device file DIGI into a 5 characterlong control string The ins character identifies the dip switch port and must be iniiclized D before calling the read function The remaining 4 characters representing the individual dip switches O 3 are returned as follows ASCII character 0 0x30 The DIP switch is closed to ground ASCII character 1 0x31 gt The DIP switch is left open Examples Assume switches and 1 are closed and switch 2 and 3 are open After the read operation the control string is modified to DOO11 Turbo C int handle char ctrl strL631 ctrl strLO0l1 D digi O RDONLY O BINARY read handle 5 ctrl str close handle Turbo Pascal CONST Binary True VAR Ctrl Str ArrayL0 41 of Char Handle File BEGIN Ctrl StrL0J 2 D Assign Handle DIGI 5 ReSet Handle 1 Does no
33. ual 2 Extent of Use For the term of the Agreement Sartorius grants you a nonexclusive right hereinafter the LICENSE to use and display this copy of a Sartorius software program on a single computer i e with a single CPU at a single location If you would like to use the SOFTWARE on a single computer which is a multiuser system please contact your Sartorius dealer or office about applying for a multiuser license As the LICENSEE you may physically transfer the SOFTWARE stored on a data medium from one computer to another provided that th SOFTWARE is used on only one computer at a time More extensive use is not permitted 3 Special Restrictions The LICENSEE is prohibited from giving the SOFTWARE or the accompanying written material a third party or making the SOFTWARE available in any way to a third party without the prior written consent of Sartorius transferring the SOFTWARE from one computer to another via a network or a data transmission channel 34 35 Copy Restrictions Transfer of the Right The lICENSEE right to use the SOFTWARE can be trans only with the prior written consent of Sartorius such transfer shall be bound by This LICE modifying reverse engineering or de assembling the SOFTWARE without the prior written consent of Sartorius d creating derivative works based on the SOFTWARE or copying the written materials 1 e
Download Pdf Manuals
Related Search
Related Contents
Samsung 2493HM Lietotāja rokasgrāmata WIRELESS REMOTE CONTROLLER INSTALLATION MANUAL Klipsch 8008 MKII User's Manual Copyright © All rights reserved.
Failed to retrieve file