05-20-2009 05:34 AM
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
05-21-2009 11:24 AM
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
Trym_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 ExceptionEnd 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