X10 Community Forum

💬General Category => Mac/Linux & Open Source and the X10 Home => Topic started by: SantLou on February 20, 2009, 02:32:24 PM

Title: TW523 VB sample code
Post by: SantLou on February 20, 2009, 02:32:24 PM
Hi,

Can someone post some VB5/6 sample code showing how to do the following using a serial TW523 device?

1.  Send a Simple "ON" command to an X10 device.
2.  Send a Status Request and Capture Status of an X10 device.

I've seen many snippets, but they all invoke ocx files that "hide" the actual communication to the serial port.

I'm playing with my TW523 and would love to build my own X10 app for fun.

Thanks
Title: Re: TW523 VB sample code
Post by: Brian H on February 20, 2009, 04:21:42 PM
TW523 is not a serial device and can't be tied directly to a serial port. In your setup, do you have some added components to get the needed serial to the current driven opto inputs and outputs?
Title: Re: TW523 VB sample code
Post by: Dan Lawrence on February 20, 2009, 10:51:44 PM
According to the X10 site, the TW523 IS a serial devise.
Title: Re: TW523 VB sample code
Post by: JeffVolp on February 20, 2009, 11:03:37 PM
According to the X10 site, the TW523 IS a serial devise.

Yes, but most people consider "serial" and "RS232" to be synonymous.  The TW523 is NOT compatible with a computer RS232 interface.  The voltage levels and protocol are entirely different.

Jeff
Title: Re: TW523 VB sample code
Post by: Brian H on February 21, 2009, 06:32:52 AM
Near the bottom of the page is all the data on both the TW523 and the PL513.
As you can see the protocol requires you to do all the work and signal translations.

http://www.x10.com/support/support_manuals.htm
Title: Re: TW523 VB sample code
Post by: SantLou on February 24, 2009, 06:04:24 PM
OK.  Let's backup a bit.

First.  The TW523 device that I have in my hand (I have several here at home)  has an RJ11 connector and the other end is 9 pin connector that plugs into my computer's Serial Port.  The very first TW523 device that I purchased from X10 also plugged into the serial port.  This is why I thought it was a Serial device.  It also came with some sample VB (v3) code to control the device using primitive DDE code.  This code was primitive, but it worked.

I also have a new TW523/PSC05 Powerline two-way interface from X10 that plugs into a serial port.  I believe that this device is also a TW523.   

I am interested in developing my own code that can communicate with my x10 devices via my TW523 / PSC05 interface.  According to the X10 website, you use RS232 protocol to communicate with the device.

All that I'd like to see is a sample piece of VB6 code that will send a "A1 ON" command and also listen and capture the results of a "Status Command" that some two-way x10 devices are capable of responding to.

Thanks for any help you can provide.

Title: Re: TW523 VB sample code
Post by: JeffVolp on February 24, 2009, 10:26:14 PM

First.  The TW523 device that I have in my hand (I have several here at home)  has an RJ11 connector and the other end is 9 pin connector that plugs into my computer's Serial Port.  The very first TW523 device that I purchased from X10 also plugged into the serial port.  This is why I thought it was a Serial device.  It also came with some sample VB (v3) code to control the device using primitive DDE code.  This code was primitive, but it worked.

I also have a new TW523/PSC05 Powerline two-way interface from X10 that plugs into a serial port.  I believe that this device is also a TW523.  

I am interested in developing my own code that can communicate with my x10 devices via my TW523 / PSC05 interface.  According to the X10 website, you use RS232 protocol to communicate with the device.


WRONG!  The TW523/PSC05 is not designed to plug into a computer serial port.  It does accept a RJ11 connector, but it is not supplied with a cable that has a 9-pin connector on the other end.

Perhaps you mean the CM11A, which was the serial port predecessor of the CM15A?  That also accepts a RJ11 connector, and it was supplied with a serial port cable.

The CM11A is used as the powerline interface for several third party programs that run on either a PC or a Mac.  The TW523/PSC05 is the powerline interface for a number of hardware controllers, such as the JDS Stargate, HomeVision, the Ocelot, and even some security systems.

Jeff
Title: Re: TW523 VB sample code
Post by: Jsnlong on February 24, 2009, 10:45:13 PM
I do see where people would get confused on how this works. Even the smarthome page sounds like you can use it with the computer?
https://www.smarthome.com/1135/X10-TW523-Two-Way-Interface-Module-TW523-PSC05-/p.aspx

but if you read the reviews there are a couple of people who thought the same.

Manual
https://www.smarthome.com/manuals/MAN-1136.pdf
Title: Re: TW523 VB sample code
Post by: JeffVolp on February 24, 2009, 11:48:14 PM
I do see where people would get confused on how this works. Even the smarthome page sounds like you can use it with the computer?
https://www.smarthome.com/1135/X10-TW523-Two-Way-Interface-Module-TW523-PSC05-/p.aspx

That description is certainly confusing, and even misleading.  There is no way RS232 communication should be mentioned in any description of the TW523.  Its timing has nothing to do with RS232 protocol.

Having written programs for many PC-based factory automation and control systems, I don't believe it would be possible to write a low-level WinDoze driver that would work with the TW523.  Of course, that may become a challenge for someone out there who will eventually prove me wrong.

Jeff
Title: Re: TW523 VB sample code
Post by: SantLou on February 24, 2009, 11:55:06 PM
Jeff,

In that case, I have an additional question.  When I purchased the TW523/PCS05 from x10, I also purchased the RJ11 connector from x10 at the same time.  What I recieved was the TW523/PCS05 device and the cable that has the RJ11 and the 9 pin connector.  Are you saying that they sent me the wrong cable?  I purchased this about two years ago.  It may be possible that they sent me the wrong cable, but I never really tried working with it until now. 

I'm not talking about the CM11A or the CM15A.  I have both of those devices also.  I also have a CM17a (Firecracker).  I'm specifically talking about the TW523/PCS05.

According to the x10 website on this device:

"If you know how to send and read RS232-type serial communication with your computer or from any other electronic device, you can develop and market your own software and/or hardware for use with X10-compatible systems without having to develop your own X10 communications hardware or having to go through costly UL approval."

I'm not looking to market my own software.  However, I would like to build my own code to control my x10 devices.  The quote above that I pasted from the x10 website kind of leads me to believe that I can communicate with this device using RS232 communication using my computer without any additional hardware.

So, just for my own understanding, if I understand your responses correctly:

- The TW523 device that I have IS NOT Designed to plug into my serial port.
- The cable that I purchased from x10 is NOT for the TW523.
- The quote from the x10 website is Misleading in that I cannot control this device using RS232 communication and my computer.

So if this is correct, can someone explain what devices do I need to purchase that will enable me to build my own software to control my x10 devices without using any third-party DLL or OCX files.  The CM11a, CM15a, and CM17a are not sufficient for my design since I need a device that can send x10 commands and also read x10 device responses to status requests.

Thanks for your time and patience in assisting me with my questions.  Although I am a long-time software developer, I am relatively new to x10 communications.  The manual that I downloaded from the x10 website for this device is informative, but most of the hardware talk is greek to me. 


Title: Re: TW523 VB sample code
Post by: JeffVolp on February 25, 2009, 12:20:09 AM
So, just for my own understanding, if I understand your responses correctly:

- The TW523 device that I have IS NOT Designed to plug into my serial port.
- The cable that I purchased from x10 is NOT for the TW523.
- The quote from the x10 website is Misleading in that I cannot control this device using RS232 communication and my computer.

Correct

Quote
So if this is correct, can someone explain what devices do I need to purchase that will enable me to build my own software to control my x10 devices without using any third-party DLL or OCX files.  The CM11a, CM15a, and CM17a are not sufficient for my design since I need a device that can send x10 commands and also read x10 device responses to status requests.

The CM11A can function as a bi-directional RS232 powerline interface.  It should do what you want.  There is also a RS232 controlled powerline interface made by ACT  (TI103 if I remember right).  However, I have never used that unit, and I am not familiar with its protocol.

Quote
Thanks for your time and patience in assisting me with my questions.  Although I am a long-time software developer, I am relatively new to x10 communications.  The manual that I downloaded from the x10 website for this device is informative, but most of the hardware talk is greek to me. 

Unfortunately, you have to talk hardware to understand how the TW523 actually works.

Jeff
Title: Re: TW523 VB sample code
Post by: Brian H on February 25, 2009, 06:41:29 AM
The TW523/PSC05 is not shipped with any cables.
Sounds like you purchased a replacement serial cable for a CM11A Active Home Interface.
Title: Re: TW523 VB sample code
Post by: Brandt on September 26, 2010, 01:14:22 AM
Here you go:

http://www.smarthome.com/1132B/PowerLinc-Serial-TW523-X10-Interface-with-12VDC-Output/p.aspx




    * "Talks" both ASCII RS-232 & the old TW523 protocol
    * Transmits & receives extended X10 codes
    * Direct plug-in replacement for TW523 interface and PSC05
    * Provides 12VDC 300mA power for your device
    * Cleans up clutter by providing both power and X10 in one cable
    * Sample visual basic program & source code, including Internet control capability!