Click here to Skip to main content
15,884,388 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
CHill6020-Nov-20 1:59
mveCHill6020-Nov-20 1:59 
QuestionSend a file via a bot telegram vb.net Pin
Member 1496222414-Nov-20 11:33
Member 1496222414-Nov-20 11:33 
AnswerRe: Send a file via a bot telegram vb.net Pin
Dave Kreskowiak14-Nov-20 12:14
mveDave Kreskowiak14-Nov-20 12:14 
QuestionChanging the color of specific text and selecting visual basics word Pin
DaniOM9-Nov-20 1:25
DaniOM9-Nov-20 1:25 
AnswerRe: Changing the color of specific text and selecting visual basics word Pin
CHill6017-Nov-20 23:59
mveCHill6017-Nov-20 23:59 
QuestionProblem in sending sms Pin
Member 137109127-Nov-20 4:44
Member 137109127-Nov-20 4:44 
AnswerRe: Problem in sending sms Pin
Richard Andrew x647-Nov-20 8:46
professionalRichard Andrew x647-Nov-20 8:46 
QuestionProblem receiving hex value on serialport Pin
Member 102013576-Nov-20 3:23
Member 102013576-Nov-20 3:23 
Dear Friends,
I'm writing you to try to solve a problem,I'm sending some hex value using a serial port to an external device.
It answer to my status request , but instead to show the value of 0x01 in the middle of the data packet it show 0x00.
I'm using a simple vb.net winform on VS2012.
Here the code i'm using:

Imports System
Imports System.IO
Imports System.IO.Ports
Imports System.Text
Imports System.Threading


Public Class Form1

    
    Dim value As Byte
    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    SerialPort1.Encoding = System.Text.Encoding.GetEncoding(1252)
    SerialPort1.Open()

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        SerialPort1.Close()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim array(6) As Byte
        array(0) = &H3
        array(1) = &H1
        array(2) = &H1
        array(3) = &HA4
        array(4) = &HA5
        array(5) = &HB2
        SerialPort1.Write(array, 0, array.Length)
        Label1.Text = ""
      
        For i = 0 To 10
            value = SerialPort1.ReadByte()
            Label1.Text += value.ToString("x2") + " "
        Next
    End Sub



I'm receiving that :
03 01 01 A4 A5 B2 00 00 03 00 FC

But as from the device datasheets I must receive:
03 01 01 A4 A5 B2 01 00 03 00 FC


Using a port sniffer I see that the device answer correctly with the value of 0x01.
Somebodys has an idea why from my application I read the byte 6 as 0x00 and not 0x01?
The problem seems to be only with the value 0x00 and 0x01 ....others value are readed correctly(I suppose).

Thanks in advance

Maurizio

modified 6-Nov-20 11:26am.

QuestionDim objNewItem As ComboItem Pin
empalamado4-Nov-20 7:00
empalamado4-Nov-20 7:00 
AnswerRe: Dim objNewItem As ComboItem Pin
Victor Nijegorodov4-Nov-20 7:51
Victor Nijegorodov4-Nov-20 7:51 
AnswerRe: Dim objNewItem As ComboItem Pin
Dave Kreskowiak4-Nov-20 8:39
mveDave Kreskowiak4-Nov-20 8:39 
QuestionNaming added Controls Pin
Member 1495490329-Oct-20 12:00
Member 1495490329-Oct-20 12:00 
AnswerRe: Naming added Controls Pin
Gerry Schmitz29-Oct-20 13:44
mveGerry Schmitz29-Oct-20 13:44 
GeneralRe: Naming added Controls Pin
Member 1495490329-Oct-20 13:49
Member 1495490329-Oct-20 13:49 
GeneralRe: Naming added Controls Pin
Gerry Schmitz30-Oct-20 7:25
mveGerry Schmitz30-Oct-20 7:25 
QuestionFail to call Sub from Async method Pin
Mc_Topaz27-Oct-20 23:38
Mc_Topaz27-Oct-20 23:38 
AnswerRe: Fail to call Sub from Async method Pin
Richard Deeming28-Oct-20 1:12
mveRichard Deeming28-Oct-20 1:12 
GeneralRe: Fail to call Sub from Async method Pin
Mc_Topaz28-Oct-20 1:59
Mc_Topaz28-Oct-20 1:59 
QuestionCannot insert into Oracle 11g R2 Pin
kerek224-Oct-20 18:14
kerek224-Oct-20 18:14 
AnswerRe: Cannot insert into Oracle 11g R2 Pin
Victor Nijegorodov24-Oct-20 20:40
Victor Nijegorodov24-Oct-20 20:40 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
kerek225-Oct-20 12:47
kerek225-Oct-20 12:47 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Dave Kreskowiak25-Oct-20 14:09
mveDave Kreskowiak25-Oct-20 14:09 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Victor Nijegorodov25-Oct-20 21:04
Victor Nijegorodov25-Oct-20 21:04 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
kerek226-Oct-20 15:38
kerek226-Oct-20 15:38 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Dave Kreskowiak26-Oct-20 16:58
mveDave Kreskowiak26-Oct-20 16:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.