APCC -- conflict using THUM device


Barry Megdal
 

Even before beginning to use APCC I had a THUM device in my observatory to measure temperature and humidity.  I added code to the web interface of ACP to display this information, and more importantly, my ACP code uses the dew point calculation to decide when the dew heater should be automatically turned on.

 

The THUM is only read by ACP once per minute, but now there is an occasional conflict where apparently APCC and ACP try to read the THUM at the same time.  This causes ACP to temporarily get garbage data, which I can deal with.  But APCC eventually begins to show temperatures which are 10 degrees or more too low, and this only gets fixed if APCC is restarted.

 

I want APCC to have the correct data for its pointing model, but I am not sure how to fix this.  APCC wants to talk directly to the THUM rather than through the driver provided by the manufacturer, and it seems there is no way to have two THUM devices – one for APCC and one for other uses such as ACP.

 

I welcome suggestions, and wish everyone a Happy New Year.

 

-          Barry

 

 

Dr. Barry Megdal

 

60” and 100” Session Director

Tour Docent

Special Tour Docent

Mt. Wilson Observatory

 

Faculty

Dept. of Electrical Engineering

California Institute of Technology

Pasadena, CA

bmegdal@...

 


Ray Gralak
 

Hi Barry,

APCC absolutely uses the driver from the THUM manufacturer. I know because I
paid for the license years ago. That said, as far as I know only one device
can talk to the THUM at a time, which seems to cause a conflict in your
setup. When did ACP add support for the THUM?

As an alternative APCC can be queried for temperature, pressure, and
humidity directly or through the AP V2 driver, so maybe a script change to
ACP can be made for ACP to read the temp/pressure/humidity from APCC?

In the near future APCC will have several additional options for collecting
temperature.

-Ray Gralak
Author of APCC (Astro-Physics Command Center):
http://www.astro-physics.com/index.htm?products/accessories/software/apcc/ap
cc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma

-----Original Message-----
From: ap-gto@yahoogroups.com [mailto:ap-gto@yahoogroups.com]
Sent: Wednesday, December 30, 2015 9:34 AM
To: ap-gto@yahoogroups.com
Subject: [ap-gto] APCC -- conflict using THUM device



Even before beginning to use APCC I had a THUM device in my observatory to
measure temperature and humidity. I added code to the web interface of
ACP to
display this information, and more importantly, my ACP code uses the dew
point
calculation to decide when the dew heater should be automatically turned
on.



The THUM is only read by ACP once per minute, but now there is an
occasional
conflict where apparently APCC and ACP try to read the THUM at the same
time.
This causes ACP to temporarily get garbage data, which I can deal with.
But
APCC eventually begins to show temperatures which are 10 degrees or more
too
low, and this only gets fixed if APCC is restarted.



I want APCC to have the correct data for its pointing model, but I am not
sure how
to fix this. APCC wants to talk directly to the THUM rather than through
the driver
provided by the manufacturer, and it seems there is no way to have two
THUM
devices - one for APCC and one for other uses such as ACP.



I welcome suggestions, and wish everyone a Happy New Year.



- Barry





Dr. Barry Megdal



60" and 100" Session Director

Tour Docent

Special Tour Docent

Mt. Wilson Observatory



Faculty

Dept. of Electrical Engineering

California Institute of Techno logy

Pasadena, CA

bmegdal@caltech.edu <mailto:bmegdal@caltech.edu>




Barry Megdal
 

Ray:

Sorry. I meant to say that APCC says not to have the THUM Service running. I have not looked into it, but I assumed that the service would allow access by multiple processes.

ACP does not natively support the THUM but i have added code to extend the APC web interface and use the THUM data for various purposes such as controlling a dew heater and a dehumidifier.

I would be happy to get that data from APCC instead. I don't have access to the manuals now -- is that interface to APCC in the documentation?

Thanks

Barry


Ray Gralak
 

Hi Barry,

I don't think it is documented but the command is simple ("ZZ04"). Here is a short VBScript example:

Set t = CreateObject("AstroPhysicsV2.Telescope")
t.Connected = True
responseString = t.CommandString("ZZ04")
WScript.Echo responseString

The response is a comma separated string with 4 values. The command will work with whatever device (THUM or other) that APCC is using now or in the future. The 4 values returned are:

Temp (C), Pressure(Mb), Relative Humidity(%), Dew Point (C)

-Ray Gralak
Author of APCC (Astro-Physics Command Center): http://www.astro-physics.com/index.htm?products/accessories/software/apcc/apcc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma

-----Original Message-----
From: ap-gto@yahoogroups.com [mailto:ap-gto@yahoogroups.com]
Sent: Wednesday, December 30, 2015 10:40 AM
To: ap-gto@yahoogroups.com
Subject: RE: [ap-gto] APCC -- conflict using THUM device



Ray:

Sorry. I meant to say that APCC says not to have the THUM Service running. I
have not looked into it, but I assumed that the service would allow access by
multiple processes.

ACP does not natively support the THUM but i have added code to extend the
APC web interface and use the THUM data for various purposes such as
controlling a dew heater and a dehumidifier.

I would be happy to get that data from APCC instead. I don't have access to the
manuals now -- is that interface to APCC in the documentation?

Thanks

Barry


Barry Megdal
 

Works great.  Thanks.

But I do need to add a test to check whether APCC is running or not, as otherwise trying to get the temperature this way starts APCC, which then exits after a few seconds.  Better behavior is to just use the THUM directly when APCC isn't running.

- Barry


Ray Gralak
 

Hi Barry,

But I do need to add a test to check whether APCC is running or not, as otherwise
trying to get the temperature this way starts APCC, which then exits after a few
seconds. Better behavior is to just use the THUM directly when APCC isn't
running.
The easiest way is to check if the APCC process is running. Here is an example VBScript code snippet that would do that:

set service = GetObject ("winmgmts:")

for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "AstroPhysicsCommandCenter.exe" then
wscript.echo "APCC Running"
wscript.quit
End If
next
wscript.echo "APCC is not running"

-Ray Gralak
Author of APCC (Astro-Physics Command Center): http://www.astro-physics.com/index.htm?products/accessories/software/apcc/apcc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma

-----Original Message-----
From: ap-gto@yahoogroups.com [mailto:ap-gto@yahoogroups.com]
Sent: Wednesday, December 30, 2015 11:50 PM
To: ap-gto@yahoogroups.com
Subject: [ap-gto] Re: APCC -- conflict using THUM device



Works great. Thanks.

But I do need to add a test to check whether APCC is running or not, as otherwise
trying to get the temperature this way starts APCC, which then exits after a few
seconds. Better behavior is to just use the THUM directly when APCC isn't
running.

- Barry


Yves Laroche
 

Hi Ray and others,

 

As you wrote earlier and with many experimentations from my side, the THUM data is corrupted when more than one client is reading the THUM device at the same time.  The THUM service from Practical Design Group should not be running when reading THUM data with APCC else data will be corrupted.

 

Just take a look at the Practical Design Group web site (THUM DLL section) and found something that could be interesting to try to bypass this king of behaviour.

 

In the Functions listing within THUM.DLL, maybe the Reset function could help in some way just before reading data values from the sensor.  Having to reset the THUM sensor just before reading data from it could prevent corrupted data...who knows?

 

Best wishes to you all !!!

 

 

My two cents,

Yves

 


De : ap-gto@... [mailto:ap-gto@...]
Envoyé : jeudi 31 décembre 2015 08:05
À : ap-gto@...
Objet : RE: [ap-gto] Re: APCC -- conflict using THUM device

 

 

Hi Barry,

> But I do need to add a test to check whether APCC is running or not, as otherwise
> trying to get the temperature this way starts APCC, which then exits after a few
> seconds. Better behavior is to just use the THUM directly when APCC isn't
> running.

The easiest way is to check if the APCC process is running. Here is an example VBScript code snippet that would do that:

set service = GetObject ("winmgmts:")

for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "AstroPhysicsCommandCenter.exe" then
wscript.echo "APCC Running"
wscript.quit
End If
next
wscript.echo "APCC is not running"

-Ray Gralak
Author of APCC (Astro-Physics Command Center): http://www.astro-physics.com/index.htm?products/accessories/software/apcc/apcc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma

> -----Original Message-----
> From: ap-gto@... [mailto:ap-gto@...]
> Sent: Wednesday, December 30, 2015 11:50 PM
> To: ap-gto@...
> Subject: [ap-gto] Re: APCC -- conflict using THUM device
>
>
>
> Works great. Thanks.
>
> But I do need to add a test to check whether APCC is running or not, as otherwise
> trying to get the temperature this way starts APCC, which then exits after a few
> seconds. Better behavior is to just use the THUM directly when APCC isn't
> running.
>
> - Barry
>
>


Yves Laroche
 

A note from Practical Design Group: Readings can not be taken from the THUM faster than one reading every 3 seconds. Taking readings faster than this could raise the internal temperature of the sensor. This could skew the temperature and RH readings returned from the THUM.

 

 


De : ap-gto@... [mailto:ap-gto@...]
Envoyé : jeudi 31 décembre 2015 11:17
À : ap-gto@...
Objet : RE: [ap-gto] Re: APCC -- conflict using THUM device

 

 

Hi Ray and others,

 

As you wrote earlier and with many experimentations from my side, the THUM data is corrupted when more than one client is reading the THUM device at the same time.  The THUM service from Practical Design Group should not be running when reading THUM data with APCC else data will be corrupted.

 

Just take a look at the Practical Design Group web site (THUM DLL section) and found something that could be interesting to try to bypass this king of behaviour.

 

In the Functions listing within THUM.DLL, maybe the Reset function could help in some way just before reading data values from the sensor.  Having to reset the THUM sensor just before reading data from it could prevent corrupted data...who knows?

 

Best wishes to you all !!!

 

 

My two cents,

Yves

 


De : ap-gto@... [mailto:ap-gto@...]
Envoyé : jeudi 31 décembre 2015 08:05
À : ap-gto@...
Objet : RE: [ap-gto] Re: APCC -- conflict using THUM device

 

 

Hi Barry,

> But I do need to add a test to check whether APCC is running or not, as otherwise
> trying to get the temperature this way starts APCC, which then exits after a few
> seconds. Better behavior is to just use the THUM directly when APCC isn't
> running.

The easiest way is to check if the APCC process is running. Here is an example VBScript code snippet that would do that:

set service = GetObject ("winmgmts:")

for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "AstroPhysicsCommandCenter.exe" then
wscript.echo "APCC Running"
wscript.quit
End If
next
wscript.echo "APCC is not running"

-Ray Gralak
Author of APCC (Astro-Physics Command Center): http://www.astro-physics.com/index.htm?products/accessories/software/apcc/apcc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma

> -----Original Message-----
> From: ap-gto@... [mailto:ap-gto@...]
> Sent: Wednesday, December 30, 2015 11:50 PM
> To: ap-gto@...
> Subject: [ap-gto] Re: APCC -- conflict using THUM device
>
>
>
> Works great. Thanks.
>
> But I do need to add a test to check whether APCC is running or not, as otherwise
> trying to get the temperature this way starts APCC, which then exits after a few
> seconds. Better behavior is to just use the THUM directly when APCC isn't
> running.
>
> - Barry
>
>


Barry Megdal
 

Thanks Yves.  I was only reading the THUM once a minute when I was doing it directly, but now that I am getting the data through APCC the timing is up to Ray.  Based on watching the values change in APCC  I think he is reading it quite a bit less than every three seconds.

- Barry


Ray Gralak
 

Thanks Yves. I was only reading the THUM once a minute when I was doing it
directly, but now that I am getting the data through APCC the timing is up to Ray.
Based on watching the values change in APCC I think he is reading it quite a bit
less than every three seconds.
APCC reads the THUM once every 10 seconds.

-Ray Gralak
Author of APCC (Astro-Physics Command Center): http://www.astro-physics.com/index.htm?products/accessories/software/apcc/apcc
Author of PEMPro: http://www.ccdware.com
Author of Astro-Physics V2 ASCOM Driver: http://www.gralak.com/apdriver
Author of PulseGuide: http://www.pulseguide.com
Author of Sigma: http://www.gralak.com/sigma


-----Original Message-----
From: ap-gto@yahoogroups.com [mailto:ap-gto@yahoogroups.com]
Sent: Thursday, December 31, 2015 10:50 AM
To: ap-gto@yahoogroups.com
Subject: RE: [ap-gto] Re: APCC -- conflict using THUM device



Thanks Yves. I was only reading the THUM once a minute when I was doing it
directly, but now that I am getting the data through APCC the timing is up to Ray.
Based on watching the values change in APCC I think he is reading it quite a bit
less than every three seconds.

- Barry