02-27-2013 05:30 AM
Hello
I am going to test my serial device with programmed in visual basic software.
I am learnig it, so please help me to do programing.
02-27-2013 08:13 AM
@Bhadresh wrote:
Hello
I am going to test my serial device with programmed in visual basic software.
I am learnig it, so please help me to do programing.
Visual Basic 6 or Visual Basic.NET
makes a difference
either way, Google is your friend
02-27-2013 03:34 PM
Hi,
I think your best bet is to use use a serial session in NI-Visa and .NET. I've used Microsoft's Serial class before with instrumentation and have had some problems.
Imports NationalInstruments.VisaNS 'set a reference to visa first
Public Class Form1
Dim meter As VisaNS.SerialSession
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
meter = New SerialSession("ASRL1::INSTR") 'comport 1
meter.BaudRate = 9600
meter.DataBits = 8
meter.StopBits = StopBitType.Two
meter.Parity = Parity.None
meter.FlowControl = FlowControlTypes.DtrDsr
meter.Timeout = 5000
meter.Write("CONF:VOLT:DC")
meter.Write("VOLT:DC:RANG:AUTO ON")
meter.Write(":READ?")
TextBox1.Text = meter.ReadString()
Catch ex As Exception
End Try
End Sub
End Class
Curt
02-27-2013 04:30 PM - edited 02-27-2013 04:30 PM
Keep in mind that there are fees for NI-VISA if you are not using any NI hardware or software.