Skip to main content

Replies sorted oldest to newest

Hi,

We're you able to locate the Datronics Protocol Reference?

I'm trying to send RTD data to a Venus/7000 also.

Since I have limited access I've been using RtdTst.exe and my messages are accepted and ITF fields are updated properly.

When I tried it on V7 nothing happened. Since my last test I've figured that the checksum was wrong and the IP port number I configured on the V7 may have been too low.

Do you have access to a V7 for testing?

Together we may be able to figure it out.
Sorry no, I got positioned text working well enough and that had to do. The format I used is as follows:

Position Text message:

<SYN> + HEADER + <SOH> + CONTROL + <STX> + TEXT + <EOT> + SUM + <ETB>

Where:

<SYN> ::= 0x16
<SOH> ::= 0x01
<STX> ::= 0x02
<EOT> ::= 0x04
<ETB> ::= 0x17
HEADER ::= '20000000'
CONTROL ::= '004010NNNN'
(NNNN is the decimal offset to place text)
TEXT ::= message to be sent to screen
SUM ::= sum of character values from header to (and including) <EOT> mod 256 as hex string

Example to place the string 'hello' at offset 35:

'\x1620000000\x010040100035\x02hello\x048A\x17'

Venus will respond with an acknowledge - so if you are using a 422/485 link, just connect the 422 rcv instead of the 485, or else the ack may collide with your next message.

I have no idea what the other numbers do... Let me know how you go.
So I did some more testing and discovered that the wrong checksum was being sent most of the time.

When the checksum is good, the response is: <SYN>20000000<SOH>90000<EOT>80<ETB>

For incorrect checksum it is: <SYN>20000000<SOH>90003<EOT>83<ETB>

For garbage: <SYN>20000000<SOH>90099<EOT>90<ETB>

I need to do another test session to do a final verification that my code is correct now.

Due to the bad checksum bug RTD updates were intermittent. For some cases the checksum matched.

This line of code was culprit (compiler optimization?):

for (m_checksum = 0, i = 1; i < m_length; m_checksum += m_message[i], i++);

Changed to -

for (m_checksum = 0, i = 1; i < m_length; i++) m_checksum += m_message[i];
[Edit: whoops, comma thing was wrong]

Yeah keep your for loop clear, the comma might have been causing a problem - what compiler are you using?

Might be worth being explicit about the overflow:

m_checksum = (m_checksum + m_message[i])&0xff;

I'm not sure what data type you are using, but unsigned_char is what you are aiming for.

Hope that helps.
Last edited by ndf

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×