Author Topic: any hope for .bat biles?  (Read 4265 times)

FarmerChad

  • Newbie
  • *
  • Posts: 11
    • View Profile
any hope for .bat biles?
« on: March 22, 2009, 02:27:30 am »
New here, must say that I love Hal.. just one problem. I would like to be able to access .bat files so that Hal can talk to a relay board. I have looked around and it looks like maybe the older versions supported this but not now? Any ideas would be helpful.

Thanks
Farmer
 

onthecuttingedge2005

  • Guest
any hope for .bat biles?
« Reply #1 on: March 22, 2009, 06:32:59 am »
can you post the internals of the relay board batch file?

Note: if you post code with back slashes in it then use two back slashes
so the code will post correctly. like C:\
Jerry[8D]

FarmerChad

  • Newbie
  • *
  • Posts: 11
    • View Profile
any hope for .bat biles?
« Reply #2 on: March 22, 2009, 08:38:44 am »
Yes I can! Keep in mind, I have used this board to control Xmas lights, you know they blink to the music, but used dedicated windows based software which would just about never work with Hal. I will copy and paste from the DOS instructions:

Documentation for PC-RELAY Kit 74, DOS based utilities   October 1995.


There are three DOS-based utilities that accompany the PC-RELAY kit:

1.   RELAY   used to output a hex byte to the designated parallel port
2.   DELAY   used to wait for a user defined number of seconds
3.   WAITFOR   used to wait until a specified time (HH:MM)

Batch files using these programs can be written to control the operation
of any of the eight relays on the PC-RELAY board.

The programs were written using Borland Turbo CC++\3.0. The original C
source code is also provided.



RELAY.EXE

Syntax:    RELAY <hex byte>   or
   RELAY\1 <hex byte>   or
   RELAY\2 <hex byte>

Output the <hex byte> to the specified parallel port. The value of <hex
byte> can be in the range 00h to FFh.

The parallel port can be specified following the command name (see command
syntax). If none is given then LPT1 is used by default.

Example:   RELAY 5A

Outputs the hex value 5A (binary 0101 1010) to LPT1, causing relays RL7,
RL5, RL4 and RL2 to operate.


They have a couple more examples listed for delay and waitfor which I don't have much use. If anyone has ideas that great. I really appreciate it.

Thnaks,
Farmer
« Last Edit: March 22, 2009, 08:41:04 am by FarmerChad »
 

onthecuttingedge2005

  • Guest
any hope for .bat biles?
« Reply #3 on: March 22, 2009, 03:14:43 pm »
Hi Farmer.

you can download the batch file controller plug-in I wrote for you here:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=6355

just copy and paste it into a text file and save as BatchControl.uhp
in the "C:\Program Files\Zabaware\Ultra Hal Assistant 6" folder then choose the plug-in from HAL'S option window.
Jerry[8D]

FarmerChad

  • Newbie
  • *
  • Posts: 11
    • View Profile
any hope for .bat biles?
« Reply #4 on: March 22, 2009, 03:17:23 pm »
"Ferris Bueller, your my hero"

Thank you!!
 

jackfarrel

  • Newbie
  • *
  • Posts: 29
    • View Profile
any hope for .bat biles?
« Reply #5 on: April 24, 2009, 02:02:09 pm »
I have problems with that script, it seems to be working, it adds the tables to the brain, but does not actually run my batch scripts!
I see my dos box open and then disappear and nothing happens.
Any ideals? Is this just my computer? Please advise.
 

onthecuttingedge2005

  • Guest
any hope for .bat biles?
« Reply #6 on: April 25, 2009, 01:49:36 pm »
quote:
Originally posted by jackfarrel

I have problems with that script, it seems to be working, it adds the tables to the brain, but does not actually run my batch scripts!
I see my dos box open and then disappear and nothing happens.
Any ideals? Is this just my computer? Please advise.



Hi Jack.

re-install the plug-in here, I changed it a bit so read the instructions, you will have to delete the table it made before and start over as instructed.

http://www.zabaware.com/forum/topic.asp?TOPIC_ID=6371
« Last Edit: April 25, 2009, 01:56:10 pm by onthecuttingedge2005 »

jackfarrel

  • Newbie
  • *
  • Posts: 29
    • View Profile
any hope for .bat biles?
« Reply #7 on: April 25, 2009, 10:58:42 pm »
Thank you kindly sir, but unfortunately it did not work either, I think it's a problem with my computer, because every-time I run it I see a cmd prompt pop up and quickly disappear, and nothing written in the batch file takes place.
 

onthecuttingedge2005

  • Guest
any hope for .bat biles?
« Reply #8 on: April 27, 2009, 01:24:24 am »
Hi Jack.

try putting the Batch files to be ran in the UltraHal Assistant 6 folder and then have HAL run it for you. the Vbscript is setup to use the folder that the plug-in resides in.

Jerry

onthecuttingedge2005

  • Guest
any hope for .bat biles?
« Reply #9 on: April 27, 2009, 01:28:55 am »
if you type in help at the cmd then you can use those parameters with the following code as well. /C is a switch that just means to close the cmd after running the parameter.

MyBatchApp.Run "cmd /C Start " & RunABatch

Jerry