COUNTERS CONTROLLERS ENCODERS Operating instructions Interface Description NE230 Progr. 01 Content Page 1. General information...2 2. Transmission protocol...2 3. Memory location readout...3 3.1. Examples for reading memory locations...3 4. Programming memory locations...3 4.1. Programming examples...4 5. Special Commands...4 5.1. Clear actual counter value...4 5.2. Switching to PGM or RUN Mode...4 5.3. Counter identification readout...5 5.4. Error alarm readout...5 5.5. Clear error alarm...5 6. Error alarms in data transmission...6 7. Chart of control signs applied...6 8. Operating plan...7 9. Programming plan...8 171.02.278/1 03.04 P.O. Box 3360 D-78022 Villingen-Schwenningen Subject to modification in Phone +49 (0)7720 942-0 Fax +49 (0)7720 942-900 technic and design. www.ivo.de e-mail: info@ivo.de
Interface description NE230 1. General information The serial interface has the same function as counter display and keypad. The interface enables polling data or altering programmed parameters. Normally the counter is PC-operated when using the interface, reason why in the following the external device is simply called PC. However, any other device featuring similar characteristics may be applied. 2. Transmission protocol Data transmission is sign by sign in ASCII code. Each sign consists of 8 bits. Bit no. 8 is the so-called parity bit, in case of no parity bit no. 8 will always be transmitted zero. Upon polling data by PC, the counter will give a corresponding reply by serial interface, provided the data transfer was effected correctly. The sign transmission starts with the header <STX> and ends with the footer <ETX>. In addition, after <ETX> the counter is sending <CR> (carriage return) allowing read-in of a complete data block by one command (in standard computer languages as BASIC). <STX> is followed by a the designated counter identification. Thus, the counter can be individually addressed in serial network. After the identification the line (position) to be read or programmed is being defined. Any programming command is followed by P (programming) with the corresponding data (parameters). The protocol is split into 3 groups as below: a) Read memory locations (READ instruction): <STX> identification line <ETX> [<CR>] b) Programming memory locations (WRITE instruction): <STX> identification line P data <ETX> [<CR>] c) Special commands: Example: <STX> identification parameter <ETX> [<CR>] <STX> start of text (02Hex) address 00..99 (device address) line 01..XX (see operating instructions) P programming command data programming data parameter special commands <ETX> end of text (03Hex) <CR> 0DHex (control sign "carriage return") "CR" not imperative (optional) but always sent back by counter. General <STX> identification line <ETX> (identification=35; line=02) Ascii <STX>3502<ETX> Hex 02H,33H,35H,30H,32H,03H Important! The space between the individual signs of each command are for optical reasons only. Entering by PC has to be without space. Control signs (inferior 20Hex) are shown in parentheses. Upon receiving a void PC protocol NE230 will reply by an error alarm, provided the counter is still capable of responding (see chapter error alarms on page 6). 2
NE230 Interface description 3. Memory location readout All memory locations provided with a line number in the programming plan allow readout (except for the separating lines which are marked by dashes). The protocol: <STX> identification line <ETX> [<CR>] may be applied to each line. However, the counter s reply may differ in length of the protocol from line to line depending on the data capacity of the respective memory location. NE230 enables readout in both RUN and PGM mode. The only difference is in the replied mode parameter R or P, as described below: Reply to a read command (standard): <STX> identification line mode [VZ] data <ETX> <CR> Mode VZ data P=NE230 is in programming mode R=NE230 is in RUN mode Pre-sign. Only transmitted if negative max. digit number, with leading zeroes w/o decimal point (exception: line 23 with decimal point) 3.1. Examples for reading memory locations For the example below the following settings do apply: Device ID (identification) = 35 counter mode = R (RUN-mode) Read main counter value XP (line=01, counter value=1500) Query: <STX>3501<ETX> Reply: <STX>3501R001500<ETX><CR> Read counter mode (line=25, setting = Pos. 3) Query: <STX>3525<ETX> Reply: <STX>3525R3<ETX><CR> (3 corresponds to track A90ºB single evaluation) Read scaling factor SF (line=07, setting=01,0000) Query: <STX>3507<ETX> Reply: <STX>3507R01.0000<ETX><CR> Read device identification (line=54, device ID=35) Query: <STX>3554<ETX> Reply: <STX>3554R35<ETX><CR> 4. Programming memory locations All memory locations (programming lines) provided with a number in the programming plan allow programming, except for the separating lines (marked by dashes) and lines 1, 5 and 6. The protocol: <STX> identification line P [VZ] data <ETX> [<CR>] may be applied to each line. The counter reply upon each individual programming step is the same as for readout of the respective line. All memory locations allow programming both in RUN and PGM mode. Programming in RUN mode: Parameters of the lines 22,23,25-29,31,41/1,44,51-54 and 56 will only be memorized after having switched from PGM mode to RUN mode. Switching to PGM mode please refer to 5.2. Parameters of the remaining lines will become active immediately after programming. All data programmed in RUN mode are only entered into the non-volatile memory after having switched from PGM to RUN mode. If there is no switchover PGM/RUN, prior data will become active anew in case of power loss. Write command (standard): <STX> identification line P [VZ] data <ETX> [<CR>] 3
Interface description NE230 4.1. Examples for programming memory locations For the example below the following settings do apply: device ID = 35; counter mode = R (RUN mode) programming the start count SC (line=04, start count=360) Command: <STX>3504P000360<ETX> Reply: <STX>3504R000360<ETX><CR> Programming the scaling factor SF (line=07, scaling factor=01,0000) Command: <STX>3507P01.0000<ETX> Reply: <STX>3507R01.0000<ETX><CR> Programming the counting mode (line=25, counting mode=1) Command: <STX>3525P1<ETX> Reply: <STX>3525R1<ETX><CR> Programming the device ID (line=54, device ID =27) Command: <STX>3554P27<ETX> Reply: <STX>3554R27<ETX><CR> Clear start count SC (line=07) Command: <STX>3507P000000<ETX> Reply: <STX>3507R000000<ETX><CR> 5. Special commands Except for the command clear counter value, special commands do not refer to a specific memory location (line number in the operating plan). 5.1. Clear counter value The counter value XP (line 1) may be cleared by the following special command. This line does not allow any programming. All remaining lines of the programming plan (except for separating lines) are cleared by programming ZERO (as under 4.). The clear command corresponds to a reset by the counter s C-key. The counter reply upon the clear command is the same as for a read command of the respective line. General: <STX> identification line <DEL> <ETX> Example: clear counter value XP Identification =35, line=01, status=run mode Command : <STX>3501<DEL><ETX> <DEL> = 7FHex Reply : <STX>3501R000000<ETX><CR> 5.2. Switching the counter to PGM or RUN mode By this command the counter is switched to and fro between PGM and RUN mode. Replied is the actual line, same as for a read command relating to the respective line. General: <STX> identification <DC1> <ETX> Example: identification=35, status=run mode, actual line = 1, running value =15 Command:<STX>35<DC1><ETX> <DC1> = 11Hex Reply: <STX>35P<ETX><CR> When repeating the command the device will switch back to RUN mode Command:<STX>35<DC1><ETX> Reply: <STX>35R<ETX><CR> 4
NE230 Interface description 5.3. Readout counter identification Identification data are read only. The counter identification is followed by two parameters. The command parameter I (identification) as well as the selective parameters T (type and program number) or D (date and hardware version) for the several identification data. Read device type and program number: Read version number: Identification =35, type=ne230, program number=01 Command:<STX>35IT<ETX> Reply :<STX>35NE230 01<ETX><CR> Identification =35, date=05.05.97, version number=1.00 Command:<STX>35IV<ETX> Reply: <STX>35 1.00<ETX><CR> Read date and hardware version number: Identification =35, date=04.04.01, hardware version no.=1 Command:<STX>35ID<ETX> Reply: <STX>35040401 1<ETX><CR> 5.4. Read error alarm In case of an error alarm during NE230 operation (display is showing error together with a number), the mode byte (normally R or P ) is heading the ASCII- sign E in data transmission, thus informing the PC about an error having curred at the counter. Operating function will only remain in case of Err07. All other error alarms mean a fatal error with interface failure. The special command E is for reading the error number as follows: General: <STX> identification E <ETX> Example: identification=35, status = error mode, Error=7 command:<stx>35e<etx> reply: <STX>35E7<ETX><CR> 5.5. Clear error alarm This command is for clearing the error alarm in the NE230 display. Clearing is only possible with error alarms that also might be cleared by the counter s C-key (example: neither error 1 nor 2). Replied is the content of the actual line. identification=35,status=error mode, error=7, line=01, counter value=2500 command:<stx>35<ack><etx> <ACK> = 06H reply: <STX>3501R002500<ETX><CR> Note: If it is an empty line without any data (i.e. line 10) the error alarm "<CAN><NUL>" will be replied. 5
Interface description NE230 6. Error alarms in data transmission Upon receiving a wrong data protocol by PC (for example: not existing line or letters instead of numbers) the counter will reply by a corresponding error alarm, provided the counter is still capable of responding. To enable an error alarm in case of error, at least control sign <STX> and counter identification have to be correct. If not, NE230 is no longer capable of responding and will not reply. If there is no reply upon a PC query neither an error message, the error is a fatal one. As mentioned, this might happen if control sign <STX> or counter identification are missing and as soon as the interface parameters of PC and NE230 are not congruent. Otherwise the error is resulting from hardware or data line. General structure of error messages: <STX> identification line status <CAN> error number <ETX> <CR> Example : identification=35, line=09 (void line), error number=2 <STX>3509R<CAN>2<ETX><CR> The error alarm will omit both line and status. Error description in detail: Error 1 : Format error (incorrect location of(<etx>).this error will occur in case the data format was not kept during programming (example: upon programming the start count only 5 data digits instead of 6 are being transmitted Error 2 : line (position) not existing or separating line Error 3: Parameter error (void values in the protocol). Example: the scaling factor is not composed by numbers but of void signs, or a value is beyond the permitted range. 7. Chart of control signs applied Control sign Hex Decimal <STX> 02 02 <ETX> 03 03 <ACK> 06 06 <LF> 0A 10 <CR> 0D 13 <DC1> 11 17 <CAN> 18 24 <DEL> 7F 127 6
NE230 Interface description 8. Operating Plan line default customer settings significance 01 0 XP running value main counter 02 1 0 0 P1 - preset 1 03 1 0 0 0 P2 - preset 2 04 0 SC start count 05 0 Σ - totalizer 06 0 Á - hour counter 07 1.0 0 0 0 SF scaling factor 10 - - - - - - separating line 11 S t a t 0 S t a t XP running value main counter 12 S t a t 0 S t a t P1 - preset 1 13 S t a t 0 S t a t P2 - preset 2 14 S t a t 0 S t a t SC start count 15 S t a t 0 S t a t Σ - running value main counter 16 S t a t 0 S t a t Á - running value main counter 17 S t a t 0 S t a t SF scaling factor 20 - - - - - - separating line 22 2 2 0 2 2 operation modes 24 2 4 0 2 4 decimal point 25 2 5 0 2 5 counting mode 26 2 6 0 2 6 frequency main counter track A 27 2 7 0 2 7 frequency main counter track B 28 2 8 0 2 8 switching threshold and input logic 29 2 9 0 2 9 main counter reset (control input 1) 31 3 1 0 3 1 function control input 2 33 3 3 0 3 3 output logic for digital output 35 3 5 t 1 3 5 output time P1 0.2 5 36 3 6 t 2 3 6 output time P2 0.2 5 37 3 7 0 3 7 enter presets P1,P2 38 3 8 0 3 8 setting range P1,P2 and SC 39 3 9 0 3 9 function key assignment 40 4 0 C o d 4 0 code settings 0 41 4 1 0 4 1 batch counter function 42 4 2 1 4 2 batch counter multiplier 43 4 3 C o r 4 3 offset 0 42 4 4 0 4 4 display mains failure 51 5 1 0 5 1 Baud rate 52 5 2 0 5 2 parity 53 5 3 0 5 3 stop bits 54 5 4 0 5 4 counter identification 55 5 5 0 5 5 output value assignment by interface 56 5 6 0 5 6 RS422: control connections TxD+ resp. TxD- 57 - - - - - - separating line 7
Schnittstellenbeschreibung NE230 9. Programming Plan Lines status of lines 1-7 11-17 0 parameter to be altered 1 clear resp. input lock 2 skip parameter Line 22 operation mode 0 step preset 1 main preset 2 parallel comparison 3 P1 trailing preset Line 24 decimal point 0 no decimal point 1 00000.0 2 0000.00 3 000.000 4 00.0000 Line 25 counting mode 0 track A UP/DOWN signal on track B 1 difference (A-B) 2 total (A+B) 3 track A 90 B single evaluation 4 track A 90 B double evaluation 5 track A 90 B four-times evaluation Line 26 frequency main counter track A 0 10 khz 1 25 Hz 2 3 Hz Line 27 frequency main counter track B 0 10 khz 1 25 Hz 2 3 Hz Line 28 switching threshold and input logic 0 switching threshold 6V PNP 1 switching threshold 6V NPN 2 switching threshold 3V PNP 3 switching threshold 3V NPN Line 29 main counter reset (control input 1) 0 automatic reset and externally static 1 automatic reset and externally differential 2 externally static 3 externally differential 4 externally with "start-function" Line 31 function control input 2 0 stop 1 hold 2 keylock 3 hour counter on/off 4 offset 5 print (only with interface) Line 33 output logic digital outputs 0 both outputs normally closed 1 P1 normally open, P2 normally closed 2 P1 normally closed, P2 normally open 3 both outputs normally open Line 35 momentary signal time P1 0.25 default 0.01 Min. 99.99 Max. Line 36 momentary signal time P2 0.25 default 0.01 Min. 99.99 Max. 8 Line 37 activation of presets P1, P2
NE230 Interface description 0 immediately active 1 after reset Line 38 counting range P1,P2 and SC 0 positive only 1 positive and negative Line 39 function key assignment 0 w/o function 1 XP 2 P1 3 P2 4 SC 5 Σ 6 Á 7 SF Line 40 code 0000 code not active : 9999 Line 41 batch counter function 0 totalizer 1 counting upon achieving P2 Line 42 batch counter multiplier (Line 41=1) 1 default 0 min. 999 max. Line 43 offset 0 no offset : 999999 max. offset value Line 44 mains failure display 0 no mains failure display 1 mains failure display (blinking) Line 51 Baud rate 0 4800 Baud 1 2400 Baud 2 1200 Baud 3 600 Baud Line 52 parity 0 even parity 1 odd parity 2 no parity Line 53 stop bits 0 1 stop bit 1 2 stop bits Line 54 counter identification 00 default 00 min. 99 max. Line 55 output value assignment by interface Line 31=5 0 display value 1 XP 2 P1 3 P2 4 SC 5 Σ 6 Á 7 SF Line 56 RS422: control connections TxD+, TxD- 0 In sending direction during sending, in receiving direction during reception 1 always in sending direction 9