Jump to content

Converting a VB project into .au3


Nova
 Share

Recommended Posts

Hi again guys,

Just wondering if there are any wizards out there that would quickly convert this project into autoit for me, the project is an interface for a piece of hardware I recently purchase that allows you to turn on/off house hold appliances using your computer.

I know absolutly no VB and would love to have an example of how to do this in autoit...

If anyone is intrested or is just bored at work id really appriachate even an example.

http://www.rentron.com/FireCracker.htm

Thanx a million for your time

Link to comment
Share on other sites

Looks like the biggest hassle will be figuring out how to send bytes to your serial port.

I found a couple threads on the topic, one involving a FileOpen("COM1", ...) call but it didn't seem possible to send data to the port that way. A couple people mentioned third-party DLLs to tap into as well.

Maybe someone knows the answer to this hurdle and will post away? Good luck in getting it to work!

Edited by LxP
Link to comment
Share on other sites

I too have a Firecracker and it has long been on my ToDo list to create an AutoIt interface for it... still haven't taken the time however.

The example you cite uses the MSComm Com interface for interacting with the device on the Com port. This makes it wasy to manipulate the signal of the different pins of the serial com port and to send and receive data. I recently posted an example of using this interface in the form of a modem phone dialer: Phone Dialer using MSComm

This example should be enough to get you started (unless you firmly believe that COM is overkill for something that can be done with FileOpen - right LxP? :whistle: )

You can find full documentation on MSComm at MSDN.

Dale

Hi again guys,

Just wondering if there are any wizards out there that would quickly convert this project into autoit for me, the project is an interface for a piece of hardware I recently purchase that allows you to turn on/off house hold appliances using your computer.

I know absolutly no VB and would love to have an example of how to do this in autoit...

If anyone is intrested or is just bored at work id really appriachate even an example.

http://www.rentron.com/FireCracker.htm

Thanx a million for your time

<{POST_SNAPBACK}>

Edit: fixed a couple of typos Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

This example should be enough to get you started (unless you firmly believe that COM is overkill for something that can be done with FileOpen - right LxP?  :whistle: )

Nah, COM looks like the way to go here -- FileOpen() wasn't able to get the job done.

And yes, I know I had that coming! :dance:

Link to comment
Share on other sites

OK, give me a few days and I'll create a little stronger push with some skeleton code for this project. I have an older CM17a -- is taht what you have, ot is it a CM18?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Ooops. You have a Firecracker with a USB interface. Notice that the picture at the top of the page you linked to in your first post looks very different from you pointed me to on the X10 site. That picture shows a serial interface that plugs into a comm port (this is what I have).

You'll need to find some examples or an interface library for communicating to this USB device before I can help.

I did a live chat with X10 to try to find out what was available -- I'll include it below. The gist is that the free download only appears to provide a stock interface to the device (you may be able to control it with AutoIt though its GUI however, so it may help you). To find out what X10 knows about a general interface to it, you'll need to call their Tech Support.

Dale

LiveChat transcript:

( Dale 6:23:15 ) A friend recently purchased a USB X10 Command Messenger.  He has asked me for help with creating a program to interface to it. I have an older Firecracker CM17a and I'm able to communicate to it with it on the serial port.Is there a general software interface library available this module like there was for the CM17a?

Referring Page: /accessories/usb_transceiver/index.html

( GrEg 6:30:17 ) Give me a minute to find your answer ( GrEg 6:41:17 ) Some X10 software and drivers  are  available for free download and can be  found through the following link.  If  you need technical assistance, please  contact Support at 1-800-442-5138 to  speak with a Support Representative. ( http://www.x10.com/support/support_soft1.htm )

I have the English/Irish USB version. CM19U

Heres a link

http://www.x10.co.uk/accessories/usb_transceiver/index.html

A skeleton structure would be an brilliant push...

I look forward to it.

Thanx man

<{POST_SNAPBACK}>

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Its a pity that our firecrackers are so different. Alto im confussed as to why mine being USB would cause a problem...

The software im using was downloaded from www.x10.com which seems to support both comm and usb devices, it auto detects the device.

How does the USB version affect writing an interface ? Cant the commands be sent to the usb as easy as be sent to comm1.

Link to comment
Share on other sites

I'll be dating myself here, but here's some background...

The interface used in the sourcecode you pointed to uses MSCOMM -- COMM stands for COMMunications port as in 9 or 25 "pin" serial communications port. The MSCOMM interface plays with 5 Volt signals in those copper pins on your serial port. Looking at the code, you'll see things like DTR and DTS (Data Terminal Ready and Data Set Ready) -- This actually creates a 0 or 5 volt signal on pins 4 and 6... This is NOTHING like how USB works.

You need to find something sprecifically for USB communications with this device -- I suggest you call their Tech Support -- you will certainly not be the first person to ask this question as others upgradding from the serial version will be looking for it.

Dale

Its a pity that our firecrackers are so different. Alto im confussed as to why mine being USB would cause a problem...

The software im using was downloaded from www.x10.com which seems to support both      comm and usb devices, it auto detects the device.

How does the USB version affect writing an interface ? Cant the commands be sent to the usb as easy as be sent to comm1.

<{POST_SNAPBACK}>

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I don't know, but could I guess that the USB interface just emulates a serial port anyway?

There was a small IOPORT.DLL floating around a while ago that was used by VB programmers to write direct to serial and parallel ports. You may still be able to find something that works well with XP if you hunt around, and then just call that using the DLLCall statement, passing it the port number and value to send or retrieve. Don't forget to initialise the port to the right baud rate, etc, and allow for timing delays for the X10 device to respond.

Good luck!

Link to comment
Share on other sites

I don't know, but could I guess that the USB interface just emulates a serial port anyway?

There was a small IOPORT.DLL floating around a while ago that was used by VB programmers to write direct to serial and parallel ports. You may still be able to find something that works well with XP if you hunt around, and then just call that using the DLLCall statement, passing it the port number and value to send or retrieve. Don't forget to initialise the port to the right baud rate, etc, and allow for timing delays for the X10 device to respond.

Good luck!

You lost me! Ive no idea about how to do what your suggesting

Link to comment
Share on other sites

  • 4 months later...

Not sure if your still looking for away to talk to your cm19a (firecracker)

but if you are this may help.

I've read in other forums where users have had success using the AHP SDK to talk to the firecracker.

I don't have one to confirm that but if it is true you could then control your firecracker via command line

with a line like "ahcmd sendrf a1 on" to turn on module A1.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...