DT800 logger.
I want to communicate over the serial port with a Programmable Counter (ESTERS PMO2160), which reads pulses from a pair of proximity switches, sensing targets on a wheel (essentially a rotary encoder), and calculates a counter value for the number of revolutions, displays it and optionally transmits it on a RS-485 port.
All this works fine, and the values on the display/port are correct. To read the values into the DT800, I have to communicate with the counter.
It works according to a German industry standard (DIN66019), with a byte oriented protocol where a master sends data to slaves on a RS-485 bus.
A communication sequence would in brief look like like below. Since the logger is used for measurements, I don't want to disconnect it for too long to play around with it.
So being a little unfamiliar with the syntax of the DT800, I hope someone could look this over, an suggest changes, if needed (or encourage me to go and get the logger, and re-program it :-)
The details:
First a Master -> Slave telegram is sent, to poll the counter, which immediately responds with a similar telegram containing three BCD coded bytes, which constitute the display value.
The decoding of the BCD to a numeric value can be done later in the data flow, and is no issue here (suggestions welcome, though).
So, in byte-language:
Master->Slave: DLE-SOH-ADD-ADS-NOB-FCN-PAR-DLE-ETX-BCS
Slave->Master: DLE-STX-BCN-NOB-BY1-BY2-BY3-DLE-ETX-BCS Mnemonic binary decimal DLE(10h) 00010000 \016 SOH(01h) 00000001 \001 STX(02h) 00000010 \002 ETX(03h) 00000011 \003
BCS Binary Check Sum successive XOR of the bytes in the message, excluding start sequence DLE-SOH and end sequence DLE-ETX Mnemonic Explanation Actual value ADD Address of slave \001
ADS Address of master \000
NOB Number of bytes-1 2-1= \001
In Master->Slave telegram
FCN Function code F0h
PAR Parameter \000
BCN Block Count \001 (always 1)
NOB Number of bytes-1 3-1= \002
In Slave->Master telegram 1.
From what I can read in the manual, I think can create the above communication by entering in a regular scan schedule (on one line):
1SERIAL(RS485,"{\016\001\001\000\002\240\000\016\003\BCS} \016\002\001\003%b[14CV]%b[15CV]%b[16CV]\016\003\%b[17CV]")
That is, the bytes sent/received are DLE SOH \001 \000 \002 \240 \000 DLE ETX BCS DLE SOH 001 003 --read 3 data bytes - DLE ETX -readBCS.
After this, the received byte values (3xBCD + 1xchecksum) will appear in channels 14-17 (?).
(The checksum has yet to be calculated; I am not sure whether it is initiated with FFh or 00h, but that is not the issue here) I am aware of the double-backslash thing in DeLogger, just omitting it here for clarity. 2.
Is it possible to include the above (with possible changes) in any schedule, say one where analog values are read?
Best regards,
Peter
Engineering geology Lund university