dome control

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

dome control

#1

Post by Tomatobro »

I use Sharpcap for my sequencing needs but the Pulsar dome control is handled by NINA. I connect the mount and dome in NINA and let Sharpcap handle the sequencing ( I find it easier that way)
The end of session is handled by a separate timer that closes a relay to make the Pulsar controller think its started to rain so it closes the shutter.

If full dome implementation is not on the to do list then how about a spare comm port text print (characters setup in the sequencer after the mount is parked) that could be used to trigger a relay to do the same job as my timer.

Last sequence command Something like....
Park mount
on comm port (15) print text "CS",011,013

I could then have an ardunio connected to comm port (15) waiting for the text "CS" and then close a relay which would be connected to the rain sense port on the Pulsar dome controller.
Keep up the good work
Trev
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#2

Post by Tomatobro »

Thinking about it the roll off roof folks could make use of it also
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: dome control

#3

Post by admin »

Hi,

have a look in the 'Misc' section of the sequencer blocks - there is one that lets the sequencer launch another application (you get to provide the filename of the program to run and the command line arguments to pass to it). That allows batch files and powershell scripts as well as executable programs, so it should be possible to build the feature you want that way.

cheers,

Robin
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#4

Post by Tomatobro »

That's interesting will take a look and post here if successful
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#5

Post by Tomatobro »

My first look at this suggests I do this

Using notepad create a text file like this.... (In the text filke the baud rate etc will be set)

echo hello > COM15

save and rename with a .exe extension

In Sharpcap Misc enter the path to where this file is located

For the argument its RUN (or Start?)

Place this Sharpcap sequence line after the mount is parked at the end of the session

Tell my ardunio to wait for the string "hello" and then close relay

It cannot be this simple can it?
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: dome control

#6

Post by admin »

Hi,

I think that changing the extension to .exe would probably not work - making it a .bat (batch) file instead and that should work. You then set that as the 'Program to run' (include the full path - ie c:\sendhello.bat rather than just sendhello.bat).

cheers,

Robin
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#7

Post by Tomatobro »

Need your systems expertise I think

The attached KMtronic file (when saved as a .bat) runs ok on its own but when called from Sharpcap returns the errors shown in the Jpg

Its the same error on both 32 and 64 bit 4.0 versions.

regards
trev
Attachments
fileissue.JPG
fileissue.JPG (118.58 KiB) Viewed 1297 times
KMtronic_USB_Relay_Command_Prompt_CS.txt
(1.21 KiB) Downloaded 47 times
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#8

Post by Tomatobro »

Just to add a bit more background.

I have some spare KMtronic single relay usb boards which would be useful if I could use in this application but its not the end of the world if I have to fall back on my Audunio setup. I have sucesfully transmitted text on a comms port so can go down this route if I cannot make the KMtronic one work
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: dome control

#9

Post by admin »

Hi,

my guess is that the batch file is being run with the current directory set to the SharpCap install directory, so when you try to create the files on.txt and off.txt, you are getting the permission denied error, since you are trying to create them in 'c:\program files\SharpCap'.

Put a 'cd' command at the start of the batchfile so that it changes to a known directory before creating the temporary files.

cheers,

Robin
Tomatobro
Posts: 83
Joined: Fri Jun 04, 2021 3:06 pm

Re: dome control

#10

Post by Tomatobro »

I was not able to get the KMtronic relay board to work so went back to my DIY serial relay solution which works well.
This facility to run external batch files is a very powerful tool and I can see other uses for it.

When I posted this request I did not think that within a week I would have a solution up and running so many thanks.
Trev
Post Reply