Getting st7ctl to Work
Justin Pryzby's st7ctl program is the only program I currently have to controlling the ST7. "Getting it to work" involves installing a large number or pieces for it's various bits of functionality. I'm going to focus only on basic communication with the ST7 since once that's done, you'll have everything you need to acquire images. Autoguiding is a different beast and once I have that mastered, I'll add some comments.
st7ctl has the same "problem" as the SBIG test application: the initial connection to the camera can fail. And it has the same cure: try again.
In ctl/args-info.c change the function getinfo() to read:
extern void get_info(void)
{
GetDriverInfoParams gdip;
gdip.request=DRIVER_STD;
SBIG(CC_GET_DRIVER_INFO, &gdip, &gdir0);
if (parms.info) driver_info("Highlevel driver:", &gdir0);
gdip.request=DRIVER_EXTENDED;
SBIG(CC_GET_DRIVER_INFO, &gdip, &gdir0_2);
if (parms.info) driver_info("Lowlevel driver:", &gdir0_2);
EstablishLinkParams elp;
elp.sbigUseOnly=0;
{
int i;
for (i = 0; i < 10; i++) {
SBIG(CC_ESTABLISH_LINK, &elp, &elr);
if (elr.cameraType==NO_CAMERA) {
fprintf(stdout, "No camera found!\n");
exit(1);
}
}
}
GetCCDInfoParams gcip;
gcip.request=CCD_INFO_IMAGING;
SBIG(CC_GET_CCD_INFO, &gcip, &gcir0);
if (!gcir0.readoutModes) {
fprintf(stderr, "No readout modes!! WTF!!\n");
exit(1);
}
if (parms.info) ccd_info0("Imaging camera:", &gcir0);
gcip.request=CCD_INFO_TRACKING;
SBIG(CC_GET_CCD_INFO, &gcip, &gcir0_2);
if (parms.info) ccd_info0("Guiding camera:", &gcir0_2);
gcip.request=CCD_INFO_EXTENDED;
SBIG(CC_GET_CCD_INFO, &gcip, &gcir2);
if (parms.info) {
printf("Camera system:\n");
printf("Bad columns: %d\n", gcir2.badColumns);
printf("Imaging ABG: %d\n", gcir2.imagingABG);
printf("Serial number: %s\n\n", gcir2.serialNumber);
}
gcip.request=CCD_INFO_EXTENDED2_IMAGING;
SBIG(CC_GET_CCD_INFO, &gcip, &gcir4);
if (parms.info) ccd_info4("Imaging camera", &gcir4);
gcip.request=CCD_INFO_EXTENDED2_TRACKING;
SBIG(CC_GET_CCD_INFO, &gcip, &gcir4_2);
if (parms.info) ccd_info4("Guiding camera", &gcir4_2);
ReadOffsetParams rop;
rop.ccd=CCD_IMAGING;
SBIG(CC_READ_OFFSET, &rop, &ror);
if (parms.info) offset_info("Imaging offset:", &ror);
rop.ccd=CCD_TRACKING;
SBIG(CC_READ_OFFSET, &rop, &ror_2);
if (parms.info) offset_info("Guiding offset:", &ror_2);
SBIG(CC_GET_LINK_STATUS, &rop, &glsr);
if (parms.info) {
printf("Linked: %d\n", glsr.linkEstablished);
printf("Address: 0x%x\n", glsr.baseAddress);
printf("Camera: %d\n", glsr.cameraType);
printf("Communications count: %ld\n", glsr.comTotal);
printf("Failed communications count: %ld\n\n", glsr.comFailed);
}
set_temp();
get_temp();
}
This does the same try, try again as we did in the SBIG test application. Similarly, in ctl/st7ctl.c, change the function SBIG to read:
extern void SBIG(short cmd, void *parms, void *results)
{
GetErrorStringParams gesp;
GetErrorStringResults gesr;
/* For reasons unknown, the camera may not establish a link on the
first try. It seems to always work within 5 attempt, but we are
generous and give it 10. Other commands should work just fine
without retry once a connection has been established. */
int i;
for (i = 0; i < 10; i++) {
gesp.errorNo=SBIGUnivDrvCommand(cmd, parms, results);
if (cmd != CC_ESTABLISH_LINK) {
break;
} else if (gesp.errorNo == CE_NO_ERROR) {
break;
}
}
if (gesp.errorNo) {
int i;
i=SBIGUnivDrvCommand(CC_GET_ERROR_STRING, &gesp, &gesr);
if (i) {
fprintf(stdout,"Command 'CC_GET_ERROR_STRING'"
" failed!\nThe error string will"
" be printed anyways;"
" don't trust it.\n");
}
fprintf(stdout, "\a\aError: %s\a\a\n", gesr.errorString);
}
}
Then build everything. Once it is built, change to the ctl directory and run "./st7ctl --info" and you should be rewarded with something like this:
281 roland> ./st7ctl --info
Highlevel driver:
Version: 04.43
Name: libsbigudrv Ver 4.43-LINUX,
Request Limit: 1
Lowlevel driver:
Version: 00.10
Name: libusb system driver,
Request Limit: 1
Imaging camera:
Firmware Version: 02.41
Camera: 0x4
Camera: SBIG ST-7 Dual CCD Camera
Mode count: 10
Mode ID, Width, Height, Gain (e-/ADU), Pixel width (microns), Pixel height (microns)
0 765 510 02.41 000009.00 000009.00
1 382 255 02.41 000018.00 000018.00
2 255 170 02.41 000027.00 000027.00
3 765 0 02.41 000009.00 000009.00
4 382 0 02.41 000018.00 000009.00
5 255 0 02.41 000027.00 000009.00
6 765 510 02.41 000009.00 000009.00
7 382 255 02.41 000018.00 000018.00
8 255 170 02.41 000027.00 000027.00
9 85 56 02.41 000081.00 000081.00
Guiding camera:
Firmware Version: 02.41
Camera: 0x4
Camera: SBIG ST-7 Dual CCD Camera
Mode count: 2
Mode ID, Width, Height, Gain (e-/ADU), Pixel width (microns), Pixel height (microns)
0 190 162 01.38 000013.75 000016.00
1 95 81 01.38 000027.50 000032.00
Camera system:
Bad columns: 0
Imaging ABG: 0
Serial number: 02073118
Imaging camera:
Frame transfer: 0
Electronic shutter: 0
dumpExtra: 5
Guiding camera:
Frame transfer: 0
Electronic shutter: 0
dumpExtra: 0
Imaging offset: 804
Guiding offset: 962
Linked: 1
Address: 0x0
Camera: 4
Communications count: 18
Failed communications count: 0
Temperature regulation on?: 0
Regulation frozen?: 0
Setpoint (Celsius): 26.827324
Percent power: 0.000000
CCD temperature (Celsius): 27.436655
Ambient temperature (Celsius): 25.000000
If you really want to try your luck, you can issue other commands to take exposures, turn on cooling, or change filters. Of course, if you're testing while sitting at the table with the camera lying there capped (as I am while I write this), your images may be a tad boring but you will have the satisfaction of knowing it is working.
- Printer-friendly version
- Login to post comments


