Someone was looking for help, so I cut and pasted part of it.
I recall that OR sets bits in the destination to that of the source.


Just to give you a little background on my project: I work in geochemistry and I have an Orion 950 titrator hooked up to an Orion 960 dispenser tower through a DB9 serial. Anyway the titrator is very limited in is abilities (for example time between dispensing is not long enough for the projects that the titrator is used for). So as a solution, I have decided to send the commands from a computer to the 960 tower using the very dumb terminal 2 in a program called Igor Pro 6, however I have run across some problems in identifying what programming language the dispenser uses, or if it is even a standard language. I am not very familiar with progamming language. I have added the document with the dispenser codes. Also I have not been able to figure out what the term Ored with 80Hex means and what it does, and therefore I have not been able to create functioning command strings. If someone could help me out in my ignorance and show me how to create a functioning command string for this, it would be greatly appreciated.


The following are the commands that the factory sent me:

****************** disp_aux.doc *****************************
****** COMMANDS FOR AUXILIARY DISPENSERS 16 Mar, 1987 ****
Updated 8 July, 1988 cis
Updated 21 Sept, 1988 cis

Replace \021 by "Ctrl Q" or "^Q" if requested by persons
who are not familiar with 960 codes. Sept. 19, 1991

x = 0 - 7: auxiliary pump ID

CAUTION: In order to distinguish a pump command from a SAMPLE CHANGER
command, each character in the following command strings is ORed
with 80Hex, i.e., the most significant bit of the ASCII character
is set before going out of the serial HOST port.

960 SENDS DISPENSER x RESPONSE FUNCTION
========== ======================== ===============================

To home the pump:
"\021xH\r" Request dispenser x to home
If home already, then do 1 more
revolution.

To dispense:
"\021xA\r" Set dispenser x to AUTO mode
-- local PAUSE button active

"\021xDyyyy\r" Request yyyy revolutions from
dispenser x.

"\021xS\r" "xc\r" Request for dispenser x status.

status character c has the following bit structure:

bit 0 = 1: homing disk NOT found home
bit 1 = 1: AUTO mode, zero for MANUAL mode
bit 2 = 1: stirrer on.
bit 3 = 1: pumping now
bit 4 = 1: auxiliary tower pause pressed
bit 5 = 1: primary tower pause pressed
bit 6 = 1: handshake error in initialization.
bit 7 = 1: always high for auxiliary pumps.

note: Bit 6 can only be tested by making a prom which contains a
false handshake word or by running the pump with two emulators.
The words used now are AA or 55.

If pause during dispensing:
"\021xP\r" Tell dispenser x to PAUSE.
"\021xG\r" Tell dispenser x to RESUME.
"\021xQ\r" Tell dispenser x to Quit.
"xyyyy\r" Tell 960 that dispenser x has yyyy
revolutions remaining.
Dispensing completed:
"\021xM\r" Set dispenser x to MANUAL mode
-- all buttons active

Stirrer:
"\021xR\r" Turn on stirrer x.
"\021xT\r" Turn off stirrer x.

STACKED light:99999
"\021xK\r" Turn on STACKED light.
"\021xC\r" Turn off STACKED light.
Posted on 2006-03-07 16:43:02 by skywalker

The important information is all there.
Basically we have to create a "formatted string" which represents the command we want to send.


Replace \021 by "Ctrl Q" or "^Q" if requested by persons
who are not familiar with 960 codes. Sept. 19, 1991

x = 0 - 7: auxiliary pump ID


This is telling us that each Command we send is going to begin with the ascii value for "control Q" , which is 17 in decimal (21 in Octal, and 11 in Hex).
I believe the /r indicates a carriage return, which is control-M , ie, 13 in decimal. The x is "device number 0 to 7".

Finally, the string needs each character in it to have its high bit set by OR'ing it with 80 Hex (128 decimal) as described.

Let's show an example.
"\021xR\r" Turn on stirrer x.

We replace the \021 with ascii value for control-Q (17)
We terminate the command string with control-M (13)
TurnOnStirrer5 db 17,5,13

If we were to define those in Hex,
TurnOnStirrer5 db 11h,05h,0Dh

and if we were to set all the high bits to avoid ORing anything,
TurnOnStirrer5 db 145,133,141 (Decimal)
TurnOnStirrer5 db 91h,85h,8Dh (Hex)

Note that I've added 80 hex (128 decimal) to each character value.
Note that these strings are not terminated with zero, as if "know the length of the string we're sending".

I'm not sure what your implementation requirements are.. but that's how the command strings are encoded before being sent.

Posted on 2006-03-08 00:44:46 by Homer
Thanks for helping Tom. Should I just refer him here for furthur questions ?

: Re: Geochemistry project ?
: Reply #1 on: March 08, 2006, 01:44:46 pm
: Reply with quoteQuote

Thanks Andy, this has been very helpful. However, there is one part that is still confusing. In the command strings (ie. \021xH\r) I understand converting \021 and \r to 80hex, but xH is a bit different. My pump id is 0 so x=0. The letters H, A, D, S, P, G, Q, M, R, T, K, and C all correspond to a certain function that the titrator must perform. For example to just dispense a certain amount of acid, I must do the following (not converted to 80hex):
*remember x=0 in reality, but leaving the x in here divides the sting up better.
\021xA\r this sets the dispenser to Auto mode
\021xDyyyy\r this tells the dispenser to run the pump for yyyy revolutions meaning dispense yyyy amount of acid.
\021xS\r requests the dispenser's status and it should respond with xc\r (x=0 still and c equals some bit that corresponds to a set of errors that could happen in the process)
\021xM\r this sets the dinspenser back to manual mode, terminating the dispensing period.

I hope this all makes sense. Would I leave the letters in the string or do they need to be converted somehow. Also when they request the character to be ORed, is that done by putting a comma between them like you did with 91h,85h,8Dh?

Once again thanks for your help.
Tom
Posted on 2006-03-09 10:13:28 by skywalker
The comma is just how I've shown each character separated and doesn't belong in the control string.. since these strings contain some "non-printable character codes", I've shown the ASCII VALUES for each character separated by commas.

As for the OR operation, it needs to be applied to EVERY character in the string you made.

Another way of saying OR with 80h is "turn on the high bit of each character".

If we A)build a control string, B)convert each character to 8 bit binary, C)set bit 7 (the leftmost or high bit) to 1, and D) convert each 8 bit binary value back to decimal or hexadecimal... then we've achieved what is required.

Clear as mud?
Posted on 2006-03-09 23:34:24 by Homer

The comma is just how I've shown each character separated and doesn't belong in the control string.. since these strings contain some "non-printable character codes", I've shown the ASCII VALUES for each character separated by commas.



In order to distinguish a pump command from a sampler
command, each character in the command strings is ORed
with 80Hex, i.e., the most significant bit of the ASCII character
is set before going out of the serial HOST port.


What exactly does it mean that the most significan bit of the ASCII character is set before going out of the serial Host port? Which is the most significan bit, and how do I know? Is it set by changing everything to hex?
Thanks for the help.

Also another note, I am using terminal functions or macros to run these commands in a statistical/Excellike program called Igor Pro. Should I send each hex number separately or together in s string?

Thanks a lot for your help.

Tom
Posted on 2006-03-24 14:45:56 by skywalker

You need to take a look at the ASCII TABLE to understand what I mean about setting the high bit in the ascii characters which comprise the command string.

You can form a string and then send it as a string, as long as the string contains characters OR'd as specified, and not simply plaintext characters.
Posted on 2006-03-25 09:13:32 by Homer