From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-11-2012 02:03 PM
I am running DASYLab 11 and am trying to write a setpoint to a Eurotherm temperature controller via the EI-BISYNCH protocol over RS-232. This requires that I send some control characters and the address of the unit I am commanding, then the some control characters and the new setpoint value, and then an XOR checksum of the second part of the string (control characters + new setpoint). I can't seem to figure out a way to do this, as the /cx format command gives the checksum of the entire string. I tried placing the first part of the string in channel one, the second part and the checksum formatter in channel two, and then selecting sequential output, but that didn't work. Does anyone have any other ideas?
Thanks for your time!!!
Solved! Go to Solution.
04-12-2012 03:30 PM
maffos,
Have you checked the documentation for your device for other possible commands that it would accept? Something that would more clearly split the two messages?
04-16-2012 12:33 PM
I have checked the documentation and all commands require the same checksum format.
04-16-2012 12:38 PM
You will need two different strings... what are your strings?
I do have a very happy customer using Eurotherm controllers... but he uses OPC, not RS232.
the help says this:
Checksum | Control Characters | Description |
---|---|---|
Cross sum | \cq | Adds all bytes before the checksum character including the contained measurement values and sends the cross sum with the string. If the format definition contains a \c control character, DASYLab makes the cross sum from the beginning of the string to the position of the control character. If the format definition contains several \c characters, DASYLab makes the subsequent cross sums from one checksum character to the next. |
CRC test | \cc | Calculates all bytes of the string to be sent with the CRC16 method. DASYLab sends the binary sequence of the CRC test and the binary sequence of the CRC test including the CRC value as the result. The sent binary sequence are not numbers but polynomials. |
XOR sum | \cx | Connects all bytes before the checksum character including the contained measurement values with the exclusive-or operator and sends the binary sequence with the character string. |
XOR sum with control character suppression | \cy | Executes the same operation as the XOR sum and adds 32 to the result byte if the result byte is smaller than 32. |
04-16-2012 12:43 PM
CJ...
The controller accepts a command of the format:
[EOT]0011[STX]SL22.0[ETX]{BCC}
where 0011 is the address of the controller, SL22.0 is the command I am sending, and {BCC} is the block checksum of "SL22.0"[ETX]". What I am confused on is how to perform the block checksum on only that portion of the string.
04-16-2012 12:44 PM
clarification: when I said block checksum, I meant to specify that it was the XOR checksum!
04-16-2012 12:59 PM
So...
\x040011\x02SL22.0\x03<checksum>
is what you want, where <checksum> is the XOR checksum of SL22.0\x03?
do you have a fixed list of setpoints, or is it variable?
\x040011\x02SL[a4.1]\x03<checksum>
04-16-2012 01:14 PM
What happens if you do it this way?
Setup RS232 Output with 2 channels.
Channel 0 is this... the input is from a Read Global variable module that has the unit number (11).
Channel 1 is this - it would come from a slider or other input.
When I look at my serial port monitor, I get this.... hex on the left, ascii on the right....
04-16-2012 02:36 PM
Thanks, CJ - I am trying to send the output of a sequence generator to the controller, so your solution with two channels is the way to go. i tried something similar but I don't think I had the strings configured properly. (Now that I've seen your example I know that!) I will try it and see how it works!
04-16-2012 02:50 PM
I did have to scratch my head to ensure that the Ch0 string went before the Ch1 string... by making the unit number a variable, it seemed to work better.