WC32 serial port communication with PC

Current version WC32 firmware has both RS232 ports accessible through remote TCP sockets, we called WEB-Bridge functions.
 
 
Code:
The WcBridge utility is a small piece of software designed to run on a PC to bridge a virtual serial port to a TCP socket to access a WebControl UART or the DOW bus directly via a virtual PC COM port (or tty for Linux). 

In order to use WcBridge it is necessary to install Com0Com or tty0tty on to your machine. See the documentation with Com0Com or tty0tty for installation and configuration instructions.

Com0Com can be obtained from here: http://com0com.sourceforge.net/
tty0tty can be obtained for Linux from here: http://tty0tty.sourceforge.net/

Once WcBridge has been installed and a virtual comport pair has be configured simply run WcBridge from the command line as follows:

wcbridge <comm.> <webcontrol host> <webcontrol host port>
where:
	comm. – part B of the com0com virtual comport part
	webcontrol host – the address or host name of the WebControl board
	webcontrol host port – the port number to access the desired pheripheral on 
				the WebControl board
e.g. wcbridge CNCB0 192.168.1.15 4500
would start wcbridge with part B of the virtual com0com pair 0, connect to WebControl port 4500.
Once wcbridge is running your custom application software can open part A of the com0com pair and read and write data directly to the WebControl peripheral
 
Current version WC32 firmware has both RS232 ports accessible through remote TCP sockets, we called WEB-Bridge functions.
 
 
Code:
The WcBridge utility is a small piece of software designed to run on a PC to bridge a virtual serial port to a TCP socket to access a WebControl UART or the DOW bus directly via a virtual PC COM port (or tty for Linux). 

In order to use WcBridge it is necessary to install Com0Com or tty0tty on to your machine. See the documentation with Com0Com or tty0tty for installation and configuration instructions.

Com0Com can be obtained from here: http://com0com.sourceforge.net/
tty0tty can be obtained for Linux from here: http://tty0tty.sourceforge.net/

Once WcBridge has been installed and a virtual comport pair has be configured simply run WcBridge from the command line as follows:

wcbridge <comm.> <webcontrol host> <webcontrol host port>
where:
	comm. – part B of the com0com virtual comport part
	webcontrol host – the address or host name of the WebControl board
	webcontrol host port – the port number to access the desired pheripheral on 
				the WebControl board
e.g. wcbridge CNCB0 192.168.1.15 4500
would start wcbridge with part B of the virtual com0com pair 0, connect to WebControl port 4500.
Once wcbridge is running your custom application software can open part A of the com0com pair and read and write data directly to the WebControl peripheral
 
CAI_Support said:
Once wcbridge is running your custom application software can open part A of the com0com pair and read and write data directly to the WebControl peripheral
ok, this is the part I was after.  but exactly what webcontrol peripheral(s) can I read and write data to?  something on the i2c bus?
 
or is this where some user serial device(s) could be connected to the wc8, and then communicated with from a pc, over the lan with the emulated port?
 
Once you have the PC or Linux driver existed, you can use terminal software or other RS232 software to read and write to the device driver as a local RS232 port, that is actually over the network talk to the serial device on WC32 serial port.
 
yes, I understand that, I had to install a software serial port for a medical client.  but what kind of serial devices, or webcontrol peripheral, do you expect wc32 users to want to connect to from their pc, and why do it thru this port?  can you give some examples?  a serial hardware modem?  a sensor with a serial interface? a wifi device was mentioned but the link is dead.

 
 
klaatu said:
yes, I understand that, I had to install a software serial port for a medical client.  but what kind of serial devices, or webcontrol peripheral, do you expect wc32 users to want to connect to from their pc, and why do it thru this port?  can you give some examples?  a serial hardware modem?  a sensor with a serial interface? a wifi device was mentioned but the link is dead.
 
 
I, for one, will be using it to facilitate talking to my battery monitors... they're away off in the battery room where RS232 is inconvenient to get to now, but where other things (including several webcontrol boards) are already ethernet connected.

The battery-monitors are some simple boards I've made... but in the interests of convenience, cost and simplicity, I only put RS232 on them.
Each board will monitor the cell voltage and temperature of three individual cells. They daisy-chain to make a virtually unlimited battery capacity modular system, all boards are identical - except the first, which has the RS232 interface on it:
 
100_6114.JPG


100_6115.JPG

 
Here's some mid-way through assembly (without the RS232 interface)
100_6122.JPG

 
And here's a typical graph of the output data collected via RS232
CellVolts.gif

 
At the moment, I have a lantronix 8-port terminal server running just to get two RS232 ports in the battery room... I could replace one of my WC8 webcontrols with a WC32, and eliminate the extra power, noise and surplus hardware by using the RS232 bridge :)
 
The RS232 bridge function is transparent to application.  What you need to pay attention is the RS232 speed, at what speed the communication is more reliable has many factors, including both sides timeout value, a lot of them can not be adjusted.  So that pick the correct RS232 speed will help tweaking the timeout value over a long network.  During our development, we tested between USA and UK, on near perfect internet connection. 
 
WCbridge PC utility can be find here:
 

http://www.cainetworks.com/support/download/wcbridge.zip

it runs from within DOS window to install the com ports, then your windows application selected proper serial port can talk to the device attached to RS232 port on WC32.
 
rossw said:
I, for one, will be using it to facilitate talking to my battery monitors... they're away off in the battery room where RS232 is inconvenient to get to now, but where other things (including several webcontrol boards) are already ethernet connected.
 
Thanks for this example Ross, and the pictures.  My battery room also happens to be where the wc8 is. 24v tho, so only semi-serious  :unsure:     but I have three PCs living there, one of them dedicated to acquiring the data from the wc8, and also from an OS wmr100 weather station.  so plenty of serial ports are there if I needed them

I can see the potential benefit of a remote floating low power serial port, but not any immediate application for my current use

the wc32 will live near the fertigation valves and tanks, about 30' away from this workstation.  I had initially been hopeful that 'WC32 serial port communication with PC' might have suggested the possibility of direct comms with the wc32, and the ability to read/write data, as an alternative to the lan/browser


Thanks Wayne for the bridge file.  could be fun, if I can find some ancient serial device in the junque drawer to test it with.  maybe a mouse  <_<    with a little lcd monitor on a long cable from the workstation, that might almost be useful!
 
klaatu said:
Thanks for this example Ross, and the pictures.  My battery room also happens to be where the wc8 is. 24v tho, so only semi-serious  :unsure:
 
I'm sure your 24V is sufficient for your needs! I'm running a large home, two offices and a whole slew of computer equipment 24/7, and 24V was never going to cut it.
 
  maybe a mouse  <_<    with a little lcd monitor on a long cable from the workstation, that might almost be useful!
 

Got any old serial terminals? Remove the keyboard, you could spit real-time monitoring data to them as RS232. You can run RS232 a long way further than you can pump VGA/HDMI etc signals!
 
I would like to go there, completely off the grid.  this is just for a monster swamp cooler, and it only needs to run during the day when it is sunny.  the rest of the facility has A/C, which already sends the billing rate above the level that Edison deems appropriate for us.  the cooler has a 3/4 horse motor, and although it is energy efficient, and thermostatically controlled, running intermittently, it's enough additional consumption to send the bill up thru four rate tiers to where it becomes $0.50/kwh.  looked into installing a commercial circuit, with flat 22 cents/kwh, but the cost of installation was nearly as much as the solar.  then there would still be another bill
 
unfortunately, the last serial terminal I had was when we were using Xenix.  several ages ago.  I was thinking hdmi, the run isn't that far

I was dreaming that I might be able to use the serial interface to send triggers to & from my script, for loading the vars with data.  using simple timing now, but if I get enough data inputs it might take more time than I have between the rest of the active jobs, unless I make it more efficient.  thought I might also be able to do it with a url param, like

~/api/setttlinput.cgi?input=1&state=1

but that gives  "404: File not found   Use WebControl GUI Upload to program web pages"
 
well, you're up late  :)

the guide shows how to set the outputs that way, so I gave it a try.   if the outputs can be set by url, are the inputs somehow impossible, or is this another security measure?

I already set some of the inputs from a labjack, but that is way separate from this particular script
 
Back
Top