Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

create an ActiveXEXE to get input from a device through serial comm?

Hi, i wanna create an activeXEXE to get input from a device through serial comm port?
I mean,I'll be always to fact serial comm programmin. get data from same device. So, i don't need to write again the coding for that. you may be ask "why do you have to crate an activeXEXE? why not an activeXDLL?"
that answer is because my application (main application) has a routine task on every second. that it'll not disturb the routine.
actually, i have created what i excatly wanted, but i couldn't fire my event in the mssomm1_event (recieve event). it could open/close port, just couldn't get input from device.

oh ya, I have PCI communication Port installed to my computer (Port 5 and 6). but when i scanned using mscomm i just got 2 default comm port (1 and 2). My pci comm port is RS485.
does mscomm has limited to 4 ports (1,2,3,4) ?

Please help me to solve this problem..

thanks..

Liung012
0
liung012
Asked:
liung012
1 Solution
 
eamonkCommented:
Hi,
The mscomm control supports comm ports 1 up to 16.

You could try calling:
Setting the MS Comm Control CommPort Property to 4 (and next 5).
Call the PortOpen method of the MS Comm Control.
If the PortOpen is True then MSComm can access the Port, if false there is a problem.

I have included some sample code:

For i = 0 To 6
        MSComm1.CommPort = i
        MSComm1.PortOpen = True
       
        If Not MSComm1.PortOpen Then
            str = "Comm Port " & i & " is unavailable."
            lstUnavailable.AddItem str
            lstUnavailable.AddItem Err.Description
        Else
            str = "Comm Port " & i & " is available."
            lstAvailable.AddItem str
        End If
        Me.Refresh
        Err.Clear
        MSComm1.PortOpen = False
 Next i

EamonK.
   
0
 
CleanupPingCommented:
liung012:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
DanRollinsCommented:
liung012, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Save as PAQ -- No Refund.

DanRollins -- EE database cleanup volunteer
0
 
Computer101Commented:
PAQed - no points refunded (of 50)

Computer101
E-E Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now