Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPC Server for rs-232 serial communication (HMI app)

Status
Not open for further replies.

Spike42

Mechanical
Feb 9, 2004
9
0
0
US
Hello, I have a project that I am working on to hook up an HMI to a testing machine. The problem that I am running into is that the machine I am trying to interface with runs off of single board computers (no PLCs) and its only interface is RS-232 serial. I am looking at the Iconics Genesis-32 product for putting together the HMI but so far I have not found an approprate OPC server that will communicate with the single board computer via rs-232. Does somthing like this even exist? as a last resort, I can install a serial to ethernet converter in the machine and talk to an OPC server via ethernet tcp-ip but don't want to do this unless I absolutly have to. Does anyone have any sugestions on how to accomplish this? Is there another software package that would work better for me with this application? Thanks!

Spike42
 
Replies continue below

Recommended for you

Some places to check for OPC drivers:
Kepware
Dimension Software
Automated Solutions

If it is just one control computer, you should be able to do a peer-to-peer communication via the RS-232 between the HMI and the control computer. This will depend on the OPC driver also.

What is the HMI hardware type?

 
The HMI will either bee an Advantech panel PC or a desktop computer. Fairly standard, running Win2000.

I am looking at Iconics and CTC's InteractX for the HMI and New Age Automation's Multidrive and Kepware's Ucon for the server

Does anyone have any experience with the Multidrive OPC server software?
 
The programming in the machine we are trying to communicate with is written in a combination of forth and hexadecimal machine code. As far as the formatting goes, we can write the software for the single board computers to format it anyway we need to, so we have a lot of flexibility there. The only limitation we have is that the only communication protocol we have available to us is 3 wire rs232.
 
Any of the OPC software you have listed may be able to receive an unsolicited message from the control computer. The control computer can broadcast data strings at regular intervals in the format of your choosing via the serial port. The OPC software should be able to listen for the broadcast on the serial port, handle the serial comms, and serve it up to the client application.

If the OPC software can not receive unsolicited messages, you should be able to configure the software to do a read at some address in the control computer. The control computer can place the desired data at that address(s). Using Kepware's universal driver would probably be the easiest from what I've seen of it.
 
Years ago I used Software Wedge by TalTech to help develop a communicatioins driver. It has tools to capture and interpret serial RS-232 data. Once the driver was written, I did not need the Software Wedge product any more.

That software communicates via DDE, not OPC. I am really surprised that they have not made that upgrade yet.

It is worth considering if you do not need to move much data and if you can live with DDE, or if you write your own driver.

...John
 
Sorry for the delayed response (new member!).

If your basic question is how to interface RS232 with Iconics Genesis, read on. I am very new to Iconics, having just started with a beta copy of Version 8 just five days ago, but applied the following to a shop-floor barcode scanning app quickly and without any problems.

1. Do you have Microsoft's MSComm ActiveX control, free with Visual Basic (or possibly via MS download?). Search for C:\Windows\System32\MSComm32.ocx and/or place it in that directory. (If downloading, run regsvr32 c:\windows\system32\MSComm32.ocx to register the control within Windows. If you have VB, it should already be registered).

2.In Genesis, "Insert ActiveX control", via menu or (in version 8) the ActiveX menu icon.

3. Right-click on MSComm object icon and set communication properties. (9600,n,8,1...buffer sizes, etc). On buffers tab, set RThreshold = 1, SThreshold = 3, for intial test purposes.

4.Again in Genesis, right click MSComm object, "View VBA code", and paste in the following for test purposes...

'=============================================
Public txtValue$
Public txtBox As GwxText


'=============================================
' Open COM port when switching Genesis from
' "Configuration" to Run Mode. Also create
' handle to Genesis text display object (or
' OPC tag, etc). In this example, the Genesis
' text box object is named "SerialText"
'=============================================
Private Sub GwxDisplay_PreRuntimeStart()

' Close port, if "port already open"
' errors when debugging
' MSComm1.PortOpen = False

' Get handle to Genesis text display object
Set txtBox = ThisDisplay.GetVisibleObjectFromName("SerialText")

txtValue$ = ""
txtBox.text = ""

MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 3
MSComm1.CommPort = 1
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.PortOpen = True

End Sub
'=============================================
' Close COM port when switching Genesis from
' "Run" to "Configuration" mode
'=============================================
MSComm1.PortOpen = False 'Close port at exit...
End Sub

'=============================================
'Process serial input...
'In this example, Genesis text object updates
'when incoming string contains return char(ASCII #13)
'=============================================
Private Sub MSComm1_OnComm()
response$ = MSComm1.Input
txtValue$ = txtValue$ + response$
If InStr(1, txtValue$, Chr$(13)) > 0 Then
txtBox.text = Trim$(txtValue$)
txtValue$ = ""
End If
End Sub
'=============================================

-Connect to the Genesis PC via Hyperterminal or some other source of RS232 data. You should see the data on the Genesis screen.

-For more info on using MSComm, including error handling, RS232 output, etc. search Microsofts site....
Examples:

-Note that the serial data, once received, can be sent to a GWXPoint object rather than the GWXText object used in this example.

Public MyOPCPoint As GwxPoint
Set MyOPCPoint = ThisDisplay.GetPointObjectFromName("Name_Of_Your_Genesis_OPC_Point")
...

Private Sub MSComm1_OnComm()
response$ = MSComm1.Input
MyOPCPoint.Value = response$
...
End Sub


Hope this helps. Respond with question...

Eric
 
Status
Not open for further replies.
Back
Top