944,074 Members | Top Members by Rank

Ad:
Sep 29th, 2006
0

serial comunication with a projector

Expand Post »
i have to comunicate from vb to control a nec vt480 and I have not much idea how to send the instructions correctly .
Acording to the information given by nec, this are the codes to control projector:
001. POWER ON 02H 00H 00H 00H 00H 02H
002. POWER OFF 02H 01H 00H 00H 00H 03H
003. INPUT SELECT RGB(*5) 02H 03H 00H 00H 02H 01H <DATA> CKS
004. INPUT SELECT VIDEO 02H 03H 00H 00H 02H 01H 06H 0EH
005. INPUT SELECT S-VIDEO 02H 03H 00H 00H 02H 01H 0BH 13H
006. PICTURE MUTE ON 02H 10H 00H 00H 00H 12H
007. PICTURE MUTE OFF 02H 11H 00H 00H 00H 13H
008. SOUND MUTE ON 02H 12H 00H 00H 00H 14H
009. SOUND MUTE OFF 02H 13H 00H 00H 00H 15H
010. ONSCREEN MUTE ON 02H 14H 00H 00H 00H 16H
011. LAMP INFORMATION REQUEST 03H 8CH 00H 00H 00H 8FH
012. MUTE CONTROL 02H 1AH 00H 00H 02H <DATA> CKS
013. VOLUME ADJUST 03H 10H 00H 00H 05H 05H <DATA> CKS
014. BASE MODEL TYPE REQUEST 00H BFH 00H 00H 01H 00H CKS
015. PROJECTOR INFORMATION REQUEST 00H BFH 00H 00H 01H 02H CKS
And also here you got the communication settings:
Baud rate: 19200 bps
Data length: 8 bits
Parity bit: No parity
Stop bits: 1 bit
Communications mode: Full duplex
For the moment I've wroten a few orders:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. mscomm1.commport = 1
  2. mscomm1.settings = "19200,n,8,1"
  3. mscomm1.portopen = true
  4. mscomm1.output = "h03 8C 00 00 00 8F"

I don't really know much from vb6, I just started with this project, also controling AOI (automatical optical inspection), few weeks ago with no idea about vb6, neither others.
Can someone help me?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sugarboy rider is offline Offline
8 posts
since Sep 2006
Oct 4th, 2006
0

Re: serial comunication with a projector

Does no one can helpe me? I hope someone with serial port communication knowledge could help me.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sugarboy rider is offline Offline
8 posts
since Sep 2006
Oct 4th, 2006
1

Re: serial comunication with a projector

Is this in XP (there has a been a few threads going around about problems with reading/writing serial ports in XP with VB). Also, I'm not sure if the output is supposed to be a string, or if it's supposed to be those values in hex.....
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Oct 5th, 2006
0

Re: serial comunication with a projector

Yes it is in windows XP professional
I've tried more things in the while I have no answer and I've sent the message in different ways
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. MSComm1.Output = "038C0000008F"
  2. MSComm1.Output = "000000111000110000000000000000000000000010001111"
  3. MSComm1.Output = &H038C0000008F"
  4.  
but none of them have worked.
Is there anyway to check my port is working properly?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sugarboy rider is offline Offline
8 posts
since Sep 2006
Oct 5th, 2006
2

Re: serial comunication with a projector

Hi,

Give this a try. Call the PowerOff function from a button_onlclick instead of onload.

mscomm1.RThreshold = 34
mscomm1.commport = 1
mscomm1.settings = "19200,n,8,1"
mscomm1.portopen = true


Public Sub PowerOff()
On Error Resume Next

Dim bytes(5) As Byte

bytes(0) = "&H" & 02
bytes(1) = "&H" & 01
bytes(2) = "&H" & 00
bytes(3) = "&H" & 00
bytes(4) = "&H" & 00
bytes(5) = "&H" & 03

MSComm1.Output = bytes


End Sub

Private Sub MSComm1_OnComm()

On Error Resume Next

If MSComm1.CommEvent = comEvReceive Then

msgbox MSComm1.Input

End If

End Sub

Try using this software to monitor the port "http://www.hhdsoftware.com/Family/serial-monitor.html"


Regards
Marikanna
Reputation Points: 16
Solved Threads: 1
Light Poster
Marikanna is offline Offline
32 posts
since Aug 2005
Oct 9th, 2006
0

Re: serial comunication with a projector

SUCCESS. It has worked out. Thanks a lot Marikanna. What is the code alone itself is working propperly, at least the output, with the input doesn't work as I want but I'll make some other tryes to improve it. I think the rest is just working on development and go on, so if I have no other relevant problems I think soon it will be perfectly solved. Thanks once again Marikanna.

Neil
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sugarboy rider is offline Offline
8 posts
since Sep 2006
Oct 10th, 2006
0

Re: serial comunication with a projector

I've tried some other things in my old code and I realise that the clue was just the byte sending.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. dim array(n) as byte
  2.  
  3. array (0) = &HXX
  4. array (1) = &HXX
  5. ....
  6. array (n-1) = &HXX
  7. array (n) = &HXX
  8.  
  9. MSComm1.Output = array

thanks to anyone that has read and think about my problem, I'm not the best to do it but if someone needs my help I'll be pleased to serve.

Neil
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sugarboy rider is offline Offline
8 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Urgenty Needed
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Comparing texts with missing or extra letters





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC