Page 1 of 1

Noobie with a MX2 using VB6

Posted: Sat Jan 21, 2006 7:39 pm
by unlocktechnology
Hi All,

Can you please help me get up and running. I am writing an application in vb6 to talk to my 2x16 MX2 display.

My code is:
MSComm1.CommPort = 3
MSComm1.Settings = "9600,N,8,1"
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If
MSComm1.Output = "Test"

I was previously getting a "Port already open" error, but end tasking a few apps got rid of this error.

My code runs and opens the port correctly, but the display does not change at all, it just stays on the "MATRIX ORBITAL MX2" welcome screen.

Many thanks in advance!

Posted: Sun Jan 22, 2006 2:01 am
by Henry
Welcome to the forums,

the first thing i spoted is that the display runs at 19200 not 9600, as well make sure it is on comport 3.

Posted: Sun Jan 22, 2006 5:54 am
by unlocktechnology
Thanks for your reply Henry. I have adjusted the rate, and still no success. I am using com port 3 (I have tried 1 and 2 but get an error). My code now reads...

MSComm1.CommPort = 3
MSComm1.Settings = "19200,N,8,1"

If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If

MSComm1.Output = "Test"

Posted: Sun Jan 22, 2006 6:01 am
by unlocktechnology
In addition, I have tried to write to the device using the executable files in the power_on and boot_screen folders and nothing seems to happen at all. I have also tried the display_tuner to adjust the brightness and this also fails. I think I am doing something terribly wrong.

Posted: Mon Jan 23, 2006 9:54 am
by Raquel
Hi,
I just want to ask you if you have simply tested the module with hyperterminal or any other terminal emulators. Just to make sure that the module is working properly.

Posted: Mon Jan 23, 2006 1:57 pm
by unlocktechnology
I have not as yet tested the device using hyperterminal. What settings should I use in hyperterminal to connect?

Posted: Mon Jan 23, 2006 2:18 pm
by Raquel
Use the same settings: 19200,N,8,1. This is elementary testing. If this does not work, it could be the installation of the drivers.

Posted: Mon Jan 23, 2006 5:49 pm
by unlocktechnology
I cannot get anything working with hyperterminal, however I am not farmiliar with its use. I can connect ok (as I can with the included test apps) but cannot write anything to the display.

What sort of flow control setting should I use in hyperterminal?

Posted: Mon Jan 23, 2006 5:51 pm
by Henry
None

Posted: Mon Jan 23, 2006 6:09 pm
by unlocktechnology
Which driver does one use...

FTDIBUS.INF or FTDIPORT.INF...

Re: Noobie with a MX2 using VB6

Posted: Tue Jan 24, 2006 2:46 pm
by Jeroen Vonk
unlocktechnology wrote: My code is:
MSComm1.CommPort = 3
MSComm1.Settings = "9600,N,8,1"
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If
MSComm1.Output = "Test"

I was previously getting a "Port already open" error, but end tasking a few apps got rid of this error.
Because you did not provide the full source but only a snippet I'm not sure what's the exact error. Did you create an instance of MSComm (that's not clear in your message) Anyway, this code works:

Code: Select all

Private Sub Command1_Click()
    Dim MSComm1 As MSComm

    Set MSComm1 = New MSComm
    MSComm1.CommPort = 3
    MSComm1.Settings = "19200,N,8,1"
    If MSComm1.PortOpen = False Then
          MSComm1.PortOpen = True
    End If

    MSComm1.Output = "Test"
End Sub
If you would like to use the display in you program, but don't really care about comm port programming you could consider using the SDK I wrote. The link is at the bottom of my message..... The above code would be this:

Code: Select all

Private Sub Command2_Click()
    Dim display As MatrixOrbital_Display.TextDisplay
    Set display = New MatrixOrbital_Display.TextDisplay
    
    display.Open 3
    display.Write "Test"
End Sub
Should save you a lot of work :)