Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

CWGPIB in VB.NET

We have developed our application in Visual Basic 6.0 using CWSerial ActiveX Control. Now we want to upgrade the same application and develop the application in VB.NET 2005. What is the equivalent of CWSerial of VB 6 in VB.NET 2005.

Also we have purchased 2 channel NI Scope but after loading the driver for NI Scope we are able to locate the sample program to develop application in VB.NET 2005.

 

Can u please help us to get the information.

 

Thank you .

 

R B Chavan

0 Kudos
Message 1 of 2
(3,785 Views)

Hi,

 

For the serial comm, you should use NI Visa .NET library.  I tried using Microsoft's native serial object ands felt it was a little clumsy to use.

Visa is alot easier

 

ex:

 

 Public m_port1 As VisaNS.SerialSession

Public Function Configure_SerialPort() As Boolean

 Try

 

m_port1 = New VisaNS.SerialSession("ASRL1::INSTR")

m_port1.BaudRate = 19200

m_port1.StopBits = StopBitType.One

m_port1.Parity = Parity.None

m_port1.FlowControl = FlowControlTypes.None

m_port1.Timeout = 10000

m_port1.TerminationCharacter = 13

m_port1.TerminationCharacterEnabled = True

 Catch Exc As Exception

End Try

End Function

 

 

strSend = "010900E00214" + Chr(13)

m_port2.Write(strSend)

Sleep(m_waittime)

strReceive = m_port2.ReadString()

 

 

For the NI Scope, try this link

 

http://zone.ni.com/devzone/cda/tut/p/id/5652

 

hope this helps

 

Curt

 

0 Kudos
Message 2 of 2
(3,760 Views)