Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

The VB.NET program often gets stuck during readings.

Solved!
Go to solution

hi:

I use E5052B and use a network cable link.(TCPIP0::192.168.1.231::inst0::INSTR)

This program is often stuck. And no error.

 

Private Sub E5_btnJTE_Click(sender As Object, e As EventArgs) Handles E5_btnJTE.Click
status = viVPrintf(vi, ":CALCulate:PN1:TRACe1:FUNCtion:INTegral:DATA?" + vbCrLf, 0)
status = viVScanf(vi, "%t", strRes) 
Dim outtext() As String = Split(strRes, ",")

Dim show_str As String = “”
show_str += outtext(4) + vbCrLf

VI_txtfinal.Text = VI_txtfinal.Text & show_str

End Sub

0 Kudos
Message 1 of 6
(2,492 Views)

The program has stopped working

0 Kudos
Message 2 of 6
(2,473 Views)

Hi xiao,

 

In order to better troubleshoot this question, I'd like to know what version of Visual Studio and Measurement studio you are using, as well as a screenshot of the error you are getting. Also, when during execution does the program stop? I'd like you to debug the code and step through it to see where the failure occurs. Also it will be much easier to troubleshoot if you could attach a copy of your code to your next response, since it will give us better insight than a small code snippet

Applications Engineering
National Instruments
0 Kudos
Message 3 of 6
(2,466 Views)
Solution
Accepted by topic author xiaochouyu

thanks

I have found a solution.Add an if statement

 

 

 

If status = VI_SUCCESS Then

 

Dim outtext() As String = Split(strRes, ",")

Dim show_str As String = “”
show_str += outtext(4) + vbCrLf

VI_txtfinal.Text = VI_txtfinal.Text & show_str


End If

0 Kudos
Message 4 of 6
(2,461 Views)

in debug mode show:

error occurred in document statechange handler

0 Kudos
Message 5 of 6
(2,453 Views)

The value returned is -1073740940 (0xc0000374).

0 Kudos
Message 6 of 6
(2,451 Views)