Celestron NexStar 4SE Computerized Telescope NexStar Communication Protocol v - Page 8

Developer Notes, Timeouts, Pass-through Commands with No Response

Page 8 highlights

Get Device Version Devices include: 16 = AZM/RA Motor 17 = ALT/DEC Motor 176 = GPS Unit 178 = RTC (CGE only) "P" & chr(1) & chr(dev) & chr(254) & chr(0) & chr(0) & chr(0) & chr(2) chr(major) & 1.6+ chr(minor) & "#" Get Model 1 = GPS Series 3 = i-Series 4 = i-Series SE 5 = CGE 6 = Advanced GT 7 = SLT 9 = CPC 10 = GT 11 = 4/5 SE 12 = 6/8 SE "m" chr(model) & 2.2+ "#" Echo - useful to check communication Is Alignment Complete? - align=1 if aligned and 0 if not Is GOTO in Progress? - Response is ASCII "0" or "1" Cancel GOTO "K" & chr(x) "J" "L" "M" chr(x) & "#" 1.2+ chr(align) & 1.2+ # prog & "#" 1.2+ "#" 1.2+ Developer Notes Timeouts If the hand control is sent a command that requires it to communicate with another device, then the hand control will make multiple attempts to get the message through in the event of communications problems. Examples include "Get Position" commands, "GOTO in Progress" commands, etc. Software drivers should be prepared to wait up to 3.5s (worst case scenario) for a hand control response. If serial commands are "blindly" sent without waiting for a response, then some commands may be dropped or the software driver could see responses that are for earlier commands. Pass-through Commands with No Response Commands that start with 'P' are special pass-through commands that communicate with a specific telescope device. For instance, the Slew commands talk directly to the motor control. If a 'P' command is sent but no response is returned (because the device is not there or the command is unknown or there was a communication problem) then one extra data byte is returned before the '#' terminating character and any returned data is garbage. This is done to give software drivers a flag that something went wrong so appropriate action can be taken. It is particularly useful if you want to check for the existence of a device: for instance, check the time from the GPS unit, and look for an error response. Software drivers should check for the '#' termination character and if it is a different character then the next character (hopefully '#') should be consumed and any command-specific handling should be done.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

Get Device Version
Devices include:
16 = AZM/RA Motor
17 = ALT/DEC Motor
176 = GPS Unit
178 = RTC (CGE only)
“P” &
chr(1) &
chr(dev) &
chr(254) &
chr(0) &
chr(0) &
chr(0) &
chr(2)
chr(major) &
chr(minor) &
“#”
1.6+
Get Model
1 = GPS Series
3 = i-Series
4 = i-Series SE
5 = CGE
6 = Advanced GT
7 = SLT
9 = CPC
10 = GT
11 = 4/5 SE
12 = 6/8 SE
“m”
chr(model) &
“#”
2.2+
Echo
- useful to check
communication
“K” &
chr(x)
chr(x) & “#” 1.2+
Is Alignment Complete?
- align=1 if aligned and
0 if not
“J”
chr(align) &
#
1.2+
Is GOTO in Progress?
- Response is
ASCII
“0”
or “1”
“L”
prog & “#”
1.2+
Cancel GOTO
“M”
“#”
1.2+
Developer Notes
Timeouts
If the hand control is sent a command that requires it to communicate with another device, then the hand control will
make multiple attempts to get the message through in the event of communications problems.
Examples include “Get
Position” commands, “GOTO in Progress” commands, etc.
Software drivers should be prepared to wait up to 3.5s (worst case scenario) for a hand control response.
If serial
commands are “blindly” sent without waiting for a response, then some commands may be dropped or the software
driver could see responses that are for earlier commands.
Pass-through Commands with No Response
Commands that start with ‘P’ are special pass-through commands that communicate with a specific telescope device.
For instance, the Slew commands talk directly to the motor control.
If a ‘P’ command is sent but no response is
returned (because the device is not there or the command is unknown or there was a communication problem) then one
extra data byte is returned before the ‘#’ terminating character and any returned data is garbage.
This is done to give
software drivers a flag that something went wrong so appropriate action can be taken.
It is particularly useful if you
want to check for the existence of a device: for instance, check the time from the GPS unit, and look for an error
response.
Software drivers should check for the ‘#’ termination character and if it is a different character then the next
character (hopefully ‘#’) should be consumed and any command-specific handling should be done.