Author Topic: WS-1216H config for PLC and Touch Panel  (Read 7580 times)

K5WA

  • Jr. Member
  • **
  • Posts: 40
    • View Profile
    • Email
WS-1216H config for PLC and Touch Panel
« on: 2019-01-31, 23:59:40 »
Establishing a WS-1216H serial connection for a PLC (remote end) and Touch Panel (control end).

Basic setup of the WS-1216H is mostly in the manual but I felt the manual lacked a good step by step overview to guide me as a newby.  This note tries to fill in the holes but is not meant to cover things that are in the manual already.  This is a first draft so I can remember what I’ve done (now that I see it working) but if things are not clear, ask me questions and I’ll be glad to answer.  I can use those answers to further refine this note for future revisions.
I’m assuming this process works for any other serial device which does NOT use software on the control end to operate the remote PLC (or other serial device) but I have only tried my PLC and panel.  The WS-1216H normally expects software to be used on the control end but I wanted to use my touch panel instead of software since I’ve invested a lot of time programming it and didn’t want to “re-invent the wheel”.  That control end software can simply use the virtual serial port established by connecting the WS-1216H and using the Microbit Setup Manager to make the virtual port.  In my case, I wanted to use my existing Touch panel AutomationDirect C-More micro 6” panel) to communicate with my remote PLC (AutomationDirect.com Click family).  I was not able to find enough information in the Microbit manuals to make this work so I have been experimenting until I figured it out by trial and error (I’m REALLY determined to get my remote station running!).  It makes sense now that I figured it out but I sure never saw it explained like I’m trying to do with this note.
Here is my layman’s description of what I found works.  This is probably obvious to all network/software engineers but it has taken lots of experimentation for a serial port newby like me to make this work by trial and error.

1)   The WS-1216H needs to have Microbit Setup Manager running on both the remote and control ends.  The serial port tab of Setup Manager establishes a virtual COM port.  They don’t have to be the same (e.g. remote could be COM 4 and control could be COM 2).  On the serial port tab of Setup Manager, pressing the SAVE button should result in the “Installed” message in the status window.  Hitting REFRESH breaks that so I assume REFRESH is meant to be used when you want to change the COM port for any reason.
2)   The webpage for the WS-1216H needs to have a unique port to access the page and a second port for the serial communication.  You cannot use the standard web browser port 80 for either one.  To access the WS-1216H on the same LAN as it is located, you must use its IP address appended with the HTTP port number.  In my case, that was 192.168.1.181:1181.  When viewing the remote WS-1216H from the control site, you use the DDNS host name appended with the port number.  You must also open the port you choose on both the remote and control end routers.  For example, if you chose port 1181 for the HTTP browser access and port 1182 for the serial connection, both of those ports need to be opened in your routers.
3)   You will need a NULL MODEM cable on the remote end or you can swap the RXD/TXD wires in the optional DB9 dongle sold by Microbit.
4)   The remote end connects to the PLC directly via the remote LAN once you fill in the LAN address (using Setup Manager), fill in the port you choose and set up the serial parameters (speed, stop bits, parity).  At this point, you should be able to access the WS-1216H with a browser on this LAN.  You now need to go to the DDNS setup of the WS-1216H page and make sure the DDNS is turned on. The remote end is done.
5)   On the control end, use the Microbit Setup manager to establish a virtual serial port by going to the remote PC’s Microbit Setup Manager’s Serial port tab and chose a serial port (for example you might chose COM2).  Then enter the DDNS URL and port number (1182 in this example) so that the control knows where to look for the remote end.  No need to set serial parameters (speed, stop bits, parity).  At this point, you should see that the WS-1216H’s webpage “System Info” tab shows that you are connected to the remote.  There should be TXD and RXD numbers shown and zero (or very few) RXD errors.  As a test, move to the Set Relays menu to try turning relays off and on.  You’re almost there if the relays work.
6)   Now you connect your Touch Panel (or whatever serial connected device you have) to the control computer with a serial connection.  Use Device Manager to see which COM port opens.  Let’s say it is COM27 for this example.  You now have COM2 and COM27 established but they have no way of communicating at the moment since they are not connected/bridged.
7)   Install a virtual serial port emulator to build a communication bridge between COM2 and COM27 (or whichever COM ports you show in Device Manager).  I use the free VSPE (Virtual Serial Port Emulator) software which has a bridge option.  Step through the bridge setup to establish COM2 with speed, stops bits, parity to match your panel.  Mine was 38400, 1, N.  Press the TEST button and it will say connected if properly done.  Now do the same for COM27 (your panel’s COM port).   
8)   You should now be able to control your remote PLC with the CONTROL Panel.  If not, double check your serial port settings throughout the chain to make sure they all match.  I made a mistake on mine and had 2 stop bits instead of 1 in a couple of places and it didn’t work.  If they all match, it works well. 


Assumptions:
1   You purchased the optional serial pigtail (or made one) for the WS-1216H
2   You have set up the WS-1216H on your LAN and have seen it function.
3   Your serial device simply uses RXD/TXD signals and ground connection; no handshaking.

Contact me if I can answer any questions:
Bob K5WA
K5WA@ARRL.net