Zabaware Support Forums
Zabaware Forums => Ultra Hal 7.0 => Topic started by: FarmerChad 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
-
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]
-
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
-
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]
-
"Ferris Bueller, your my hero"
Thank you!!
-
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.
-
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
-
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.
-
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
-
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