start bit, information and stop bit(s), you can evaluate the begining and end of the data sent usind commands like 'mid'. If you are using a simple point to point protocol, i.e. This will help correcting this error, depending on your protocol. If Temp = "FAFA" then ' If the data is what you are expecting Temp = Temp + MSComm.Input 'Temporal store variable But when the two other bytes arrive, they will be stored in the same sData variable and the lable will show only the last two bytes received. the label shows just 'FA', it could be caused by the instruction 'MSComm1.InputLen = 2' this instruction produce the OnComm event everytime it reads two bytes, so when the first two bytes arrive, 'FA', they will be store in the variable sData and then will be shown in the label. If you have the right cable configuration, and you are getting just partial data in your 'sData' variable, e.g. the Tx from PC1 goes to Rx in PC2, and Rx from PC1 goes to Tx in PC2. In this case you should have a crossed serial cable, i.e. If you are not getting any info from any of the PC's I would ask what kind of media are you using. Are you receiving nothing? are you receiving partial data? First of all I would like to know if what kind of truble do you have. SData = MSComm1.Input ' Get data (2 bytes) ' If comEvReceive Event then get data and display ' 2400 Baud, No Parity, 8 Data Bits, 1 Stop Bitĭim sData As String ' Holds our incoming data ' When Inputting Data, Input 2 Bytes at a time Private Sub Form_Unload(Cancel As Integer) ' 2400 baud, no parity, 8 data bits, 1 stop bit See my full coding below and advise me on what I'm doing wrong It seems I'm having trouble passing my string say(fafa) to the "mscomm1.input" The lines in red are resisting me by not returning values.I have been cracking my brain for two weeks now to have two pc's communicate through SERIAL PORT. I have successfully converted some and I cannot convert others to work properly in VFP. It is designed to work with a DLL and here is an incomplete list of Declarations written in Visual Basic, to access the board. This is achieved thanks to our virtual serial port technology that emulates standard COM ports behavior and Windows OS treats the virtual ports as the real ones.ĭECLARE enigma with the Boolean type DECLARE enigma with the Boolean typeI purchased a little controller board from Velleman K8055. The data sent by serial port device is transmitted over a TCP/IP network. With this serial over network solution any device connected to a COM port can be accessed and used from any spot on the globe as if it were physically connected to the local machine. With Serial to Ethernet Connector you can share up to 255 serial devices over network turning your computer into a terminal server.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |