'Cast from string " ' error
'Cast from string " ' error
'Cast from string " ' error
'Cast from string " ' error
'Cast from string " ' error
'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error 'Cast from string " ' error
'Cast from string " ' error 'Cast from string " ' error
'Cast from string " ' error
Go Back  Xtreme Visual Basic Talk > > > 'Cast from string " ' error


Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2004, 05:03 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default 'Cast from string " ' error


Can anybody tell me why Yvalue = CDbl(byteValueString.Substring(3, 6)) is giving me 'Cast from string " ' error?
Reply With Quote
  #2  
Old 07-15-2004, 05:12 PM
Iceplug's Avatar
Iceplug'Cast from string " ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

What do you have Yvalue declared as and you should try Double.Parse or Double.TryParse instead of CDbl().
What's the value in your bytevaluestring and what's the substring?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 07-15-2004, 05:19 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
What do you have Yvalue declared as and you should try Double.Parse or Double.TryParse instead of CDbl().
What's the value in your bytevaluestring and what's the substring?
Yvalue is declared as Double. The string is, say, “OH 10.23koHM” and the substring is “ 10.23”.
Reply With Quote
  #4  
Old 07-15-2004, 05:25 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
What do you have Yvalue declared as and you should try Double.Parse or Double.TryParse instead of CDbl().
What's the value in your bytevaluestring and what's the substring?
Double.Parse (byteValueString.Substring(3, 6)) is giving me:

‘Input string was not in a correct format.’

EDIT: The only way I can make it work is by treating it as an exception. But that doesn't seem to be the right way to do it.
Reply With Quote
  #5  
Old 07-15-2004, 05:49 PM
Iceplug's Avatar
Iceplug'Cast from string " ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Try it with setting the second parameter to Float.
Dim D As Double = Double.Parse(" 10.23", Globalization.NumberStyles.Float)
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #6  
Old 07-16-2004, 03:44 AM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

The main problem it turned out is in the difficulty to form the compact string <byteValueString> consisting of the individual 14 characters received from the device. The 'Cast from string " ' error appears as a result of that.

So far the only way I can obtain sensible data from the device is by the following code:

Code:
 Imports System

Public Class Form1
    Inherits System.Windows.Forms.Form

<Windows Form Designer generated code> 

    ' @@@@@@@@@@@@@@@@@@@@              
    '  MAIN PART OF CODE '                   
    ' @@@@@@@@@@@@@@@@@@@@
    Private Sub rS232Comms1_DataRxEvent(ByVal sender As System.Object, ByVal e As RS232.RxEventArgs) Handles RS232Comms1.DataRxEvent

        Dim LengthOfString As Integer
        Dim oEncoder As New System.Text.ASCIIEncoding
        Dim oEnc As System.Text.Encoding = oEncoder.GetEncoding(1252)
        Dim millivolts0 As Double
        Dim TheNumber As Double
        Dim Units As String
        Dim byteValueString As String
        Dim Yvalue As Double ' This is the desired numerical value

        'TextBox1.Clear()

        ' This transforms the bytes sent from the device into ASCII characters.
        ' See the Dims above to understand what happens
        Dim ii As Integer
        For ii = 0 To 13 ' The Byte received from the device consists of 14 symbols
            RS232Comms1.SetDTR()
            byteValueString += oEnc.GetChars(e.data)
        Next ii

                ' This is where we parse the string byteValueString into two parts
        ' corresponding to the actual value (still as String) and the unit
        Try
            TheNumber = byteValueString.Substring(3, 6)
            Units = byteValueString.Substring(9, 4)
        Catch ex As Exception
        Finally
        End Try


        ' This is where we transform the above-parsed parts of the string byteValueString 
        ' into actual numerical value and a unit
        Try
            ' This gives the actual numerical VALUE
            Yvalue = CDbl(TheNumber)   ' 
' This places in the TextBox1 the actual numerical VALUE + the UNIT
            TextBox1.AppendText(CStr(Yvalue) & Units & Chr(13) & Chr(10))
        Catch ex As Exception
        Finally
        End Try

    End Sub


    ' @@@@@@@@@@@@@@@@@@@@@@@@@@@                           
    '  INITIALIZE AND OPEN PORT ' 
    ' @@@@@@@@@@@@@@@@@@@@@@@@@@@
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        InitializeComponent()
        RS232Comms1.CloseComms()
        RS232Comms1.OpenComms()
        RS232Comms1.WriteBlock(&H12)
    End Sub


    ' @@@@@@@              
    '  QUIT '                   
    ' @@@@@@@
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RS232Comms1.CloseComms()
        TextBox1.Clear()
        TextBox1.AppendText("Cya ...")
        Me.Dispose()
    End Sub

End Class
The code above, however, is almost useless because it can only provide through so much effort the value of the numerical data displayed on the screen. At that the program has to go through quite a twisted path. First of all it does once the For-Next loop, doesn’t come up with a correct values, causing an exception, and then does the loop procedure a second time. And that is every time the program is invoked.

As a result, the following is displayed on the screen for, say, the original string “ OH 10.37kOhm”:

0
10.37kOhm

As you can see there is always one initial 0 which appears in the result and which I can’t get rid of.

Further, the reading from the device has to be done repetitiously and at random times. Not to say that the data obtained have to be reliable every time the device is read. Above code seems to be useless – the initial zero obtained each time data is read makes data obtained problematic. Further, neither timer causes it to repeat the reading nor it can be used as a separate subroutine which can be called from within another subroutine. I tried placing it in a separate Form2, trying to call it from Form1 but the initial 0 and unknown problems in closing the form (referring to the form has to be done repetitiously) made this attempt unsuccessful.

Above is also another illustration of one more general problem I am having – how is the branching accomplished in Visual Basic .NET? Some subroutines can be called from within other subroutines, other subroutines, such as the one in the above code are somehow inherent and cannot be called independently from within other subroutines. Also, within a subroutine some procedures seem to work consequentially, others not – how come, for instance, the above For-Next loop doesn’t work as expected, but instead of producing, as a result of one run, a compact <byteValueString> string it ends up with the sum (appearing 14 times) of only the last character of the string “ OH 10.37kOhm”?
Reply With Quote
  #7  
Old 07-16-2004, 06:59 AM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

So, you are saying that:
TextBox1.AppendText(CStr(Yvalue) & Units & Chr(13) & Chr(10))
Produces two lines of text?
Perhaps you should try using Yvalue.ToString() instead of CStr(),
Environment.NewLine instead of Chr(13) & Chr(10)

So, the Double.Parse doesn't work?

To call a subroutine, it has to be in the same class that you are calling it from.
You can call a Public or Friend routine in a class that you have declared, and you can call Shared methods without making a class instance... just use the class name and type the period.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #8  
Old 07-16-2004, 12:05 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
So, you are saying that:
TextBox1.AppendText(CStr(Yvalue) & Units & Chr(13) & Chr(10))
Produces two lines of text?
Perhaps you should try using Yvalue.ToString() instead of CStr(),
Environment.NewLine instead of Chr(13) & Chr(10)
This produces even stranger result – it again gives the initial 0 but now also skips the decimal point. The result is:

0
1037kOhm

See, the goal is not just to display the data on the screen. One line of text on the screen can be obtained by including TextBox1.Clear(). The goal is to produce the value of Yvalue in a clean way the first time the loop executes, without having to invoke exceptions which lead to the initial zero. I can't understand why the For-Next loop wouldn't work as expected – why on every turn of the loop the previous value of byteValueString is lost?
Quote:
So, the Double.Parse doesn't work?

To call a subroutine, it has to be in the same class that you are calling it from.
You can call a Public or Friend routine in a class that you have declared, and you can call Shared methods without making a class instance... just use the class name and type the period.
How can this be done in this concrete case? How, for instance, can the reading of the multimeter be invoked repeatedly (at random) from within, say, <Private Sub Form1_Load ... End Sub>?
Reply With Quote
  #9  
Old 07-16-2004, 12:25 PM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

So:
For ii = 0 To 13 ' The Byte received from the device consists of 14 symbols
RS232Comms1.SetDTR()
byteValueString += oEnc.GetChars(e.data)
Next ii
That is your For Loop?

And that returns a 0 in some cases, and the correct value in other cases? So, in other words, you are actually receiving a 0 from the RS232?
One way would probably be to just check the value in Yvalue... or you can just check the value of byteValueString by writing it to the Debug window with Debug.WriteLine .
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #10  
Old 07-16-2004, 01:12 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
So:
For ii = 0 To 13 ' The Byte received from the device consists of 14 symbols
RS232Comms1.SetDTR()
byteValueString += oEnc.GetChars(e.data)
Next ii
That is your For Loop?

And that returns a 0 in some cases, and the correct value in other cases? So, in other words, you are actually receiving a 0 from the RS232?
One way would probably be to just check the value in Yvalue... or you can just check the value of byteValueString by writing it to the Debug window with Debug.WriteLine .
Not only that it returns 0 in some cases but the correct values which the For-Next loop returns are one character at a time while the previous character is lost. So one cannot get all 14 characters of the incoming string together. The For-Next loop works in a strange way, not expected from such a loop. Also, the logic escapes me – why should the program run the said loop twice? What makes it do so?

EDIT: Something is definitely not working right. Try to obtain Log(Yvalue) ... what you get are all infinities. Taking of logarithm interferes with the communication with the device (?!).

Last edited by Omnibus; 07-16-2004 at 01:42 PM.
Reply With Quote
  #11  
Old 07-16-2004, 01:45 PM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Sounds like the RS232Comms1 is raising the event twice. You can check by adding a Debug.WriteLine("blah") at the start of the subroutine, and then, check the Output window to see if blah appears twice. If so, then the event is being raised twice.
I cannot see how anything in bytevaluestring can be overwritten, but I would use &= instead of += for string concatenation.

Also, does RS232Comms1.SetDTR() somehow change the value in e.Data? (That doesn't seem logical if you ask me.)
Perhaps you can Debug.WriteLine to see what you are getting from each call to oEnc.GetChars(e.Data)
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #12  
Old 07-16-2004, 02:09 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
Sounds like the RS232Comms1 is raising the event twice. You can check by adding a Debug.WriteLine("blah") at the start of the subroutine, and then, check the Output window to see if blah appears twice. If so, then the event is being raised twice.
I cannot see how anything in bytevaluestring can be overwritten, but I would use &= instead of += for string concatenation.

Also, does RS232Comms1.SetDTR() somehow change the value in e.Data? (That doesn't seem logical if you ask me.)
Perhaps you can Debug.WriteLine to see what you are getting from each call to oEnc.GetChars(e.Data)
Yes, the Debug.WriteLine("blah") appears usually twice. At times it appears more than twice but then you get only zeroes. In other words the work of the program is unstable for some reason. What might be causing the raising of event more than once and how can the taking of a logarithm interfere with the obtainment of data from the device? Isn't the obtainment of the data occurring first?

P.S. The &= doesn’t work ... gives me all zeroes.
Reply With Quote
  #13  
Old 07-17-2004, 02:14 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

The only way so far I could get a compact string out of the device is by writing the input from the device in a temporary text file.

Code:
Dim GlobalString as String
Dim s(0) As String
Dim ofn As Short
        GlobalString &= newString
        
        s.SetValue(GlobalString, 0)
        ofn = FreeFile()
        FileOpen(ofn, "Temp.txt", OpenMode.Binary)
        FilePut(ofn, s)
        FileClose(ofn)
However, another problem appears now. I can’t read the string from the saved file because it starts with Chr(15) which causes interrupt. I thought I could read it through binary read:

Code:
Dim ss(0) As String
Dim ifn As Short

        ifn = FreeFile()
        FileOpen(ifn, "Temp.txt", OpenMode.Binary)
        FileGet(ifn, ss)
        FileClose(ifn)
but it didn’t work. Tried to read it also in this way:

Code:
textFileIn = "Temp.txt"
 Dim sr As IO.StreamReader = IO.File.OpenText(textFileIn)
                ThatIsTheString = sr.ReadLine
sr.Close()
Didn’t work either. So, at this stage this problem remains to be solved.

EDIT: The string that needs to be read is

" OH 10.97kOhm
"

Notice the carriage return.

If the leading character (TextBox1.Text = Asc("") gives me that it's Chr(15)) in the above string is removed manually the rest of the string reads well. By the way, I'm having problems when even trying to paste this leading character by itself here.

Last edited by Omnibus; 07-17-2004 at 02:27 PM.
Reply With Quote
  #14  
Old 07-18-2004, 08:52 AM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

You keep saying 'it doesn't work' and that is making the problem difficult to diagnose... be specific as to what happens.
I would suggest you use SR.ReadToEnd to read the whole file and you could just use the StreamWriter to write to the file (instead of those old VB functions).
It looks like the character 15 is some kind of error or some character that's just being sent... or perhaps it's a signal byte sent by the rs232 that indicates the length of the rest of the data that it is sending to you? I don't know exactly how the rs232comms1 behaves, but you can possibly ignore this signal.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #15  
Old 07-18-2004, 07:00 PM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

The only way so far to solve the problem is to ignore this first problematic incoming character. For this purpose I set up a counter and when the counter variable x equals 1 I assign “” to the string <newString>. Thus, I can grab and concatenate all the remaining proper 13 incoming characters and place them into a text-file concatenated.

Now, I have what I need – a string consisting of 13 proper characters, unfortunately, placed in a text file but that’s the best I could do) ready to be properly read, even in the old-fashioned way, when needed.

That part is done.

Now, the problem is that the above procedure of obtaining of a 13-character data-string from the device has to occur repetitively at random times. For this reason I place the part which talks to the device and places the 13-character string in a text-file in Form 2 while the part that reads the 13-character string and later uses it for other purposes in Form1. Form2 is called by Form1 when needed and upon finishing its task (talking to the device and saving the data to a text-file) Form2 is supposed to close and return to Form1.

All sounds well and good. The only thing is that Form2 only closes properly the first time Form1 calls it. The second time Form1 calls Form2 something happens and Form2 does things differently, debugger shows, than the first time and doesn’t close.

Here’s the code:

This is Form1 which calls Form2:
Code:
Imports System.Math

Public Class Form1
    Inherits System.Windows.Forms.Form
    
<Windows Form Designer generated code>

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       
        Dim F2 As New Form2
        F2.ShowDialog()

        'Debug.WriteLine("hnhn <------")
        Dim YvalueString As String
        Dim ThatIsTheString As String
        Dim textFileIn As String
        
        ' ======================= READ DATA FROM TEXT FILE ==========================
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        textFileIn = "Temp.txt"
        Dim sr As IO.StreamReader = IO.File.OpenText(textFileIn)
        ThatIsTheString = sr.ReadLine
        sr.Close()
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

        If Mid(ThatIsTheString, 7, 1) = "." Then Mid(ThatIsTheString, 7, 1) = ","

        YvalueString = ThatIsTheString.Substring(4, 5)
        Yvalue = (CDbl(ThatIsTheString.Substring(4, 5)))
        TextBox1.Text = CStr(Yvalue)

        GlobalString = ""
        x = 0
        F2 = Nothing

    End Sub

End Class


This is Form2 which is called by Form1:
Code:
 Imports System
Imports System.Threading

Public Class Form2
    Inherits System.Windows.Forms.Form
    
<Windows Form Designer generated code>

Private Sub rS232Comms1_DataRxEvent(ByVal sender As System.Object, ByVal e As RS232.RxEventArgs) Handles RS232Comms1.DataRxEvent

        Debug.WriteLine("hnhn <------")
        Dim buffer() As Byte = e.data ' <-------------
        Dim newString As String = System.Text.Encoding.ASCII.GetString(buffer) ' <------------
        Dim textFileOut As String


        ' The bytes sent from the device will be transformed into ASCII characters.
        ' See the Dims above to understand what happens.
        ' What follows sets the conditions for sending those characters.
        RS232Comms1.SetDTR()

        ' ==================================================================================

        ' ====================
        ' This is a COUNTER  ' 
        Dim obj As MyCounter '  
        obj = New MyCounter  '
        x = obj.Count        '     
        ' ====================

        If x = 1 Then newString = "" ' Gets rid of the first character preventing the reading of data from the text-file
        If newString = "." Then newString = "," ' Changes "." (which multimeter sends, causing error) to ","
        GlobalString &= newString
        ' ======================= WRITE DATA TO TEXT FILE ==================================
        ' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        textFileOut = "Temp.txt"
        Dim ssr As IO.StreamWriter = IO.File.CreateText(textFileOut)
        ssr.WriteLine(GlobalString)
        ssr.Close()
        ' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

        If GlobalString.Length = 13 Then Close()

    End Sub



    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        RS232Comms1.CloseComms()
        RS232Comms1.OpenComms()
        RS232Comms1.WriteBlock(&H12)
    End Sub

End Class




Public Class MyCounter
    Private Shared mintCount As Integer

    Public Sub New()
        mintCount += 1
    End Sub

    Public ReadOnly Property Count() As Integer
        Get
            Return mintCount
        End Get
    End Property
End Class

Last edited by Omnibus; 07-18-2004 at 11:19 PM.
Reply With Quote
  #16  
Old 07-19-2004, 06:47 AM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Try:
Dim F2 As Form2 = New Form2
F2.ShowDialog()

And also, I don't think you need to set F2 to Nothing at the end of the subroutine.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #17  
Old 07-19-2004, 09:10 AM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
Try:
Dim F2 As Form2 = New Form2
F2.ShowDialog()

And also, I don't think you need to set F2 to Nothing at the end of the subroutine.
I tried that. Unfortunately, the program still hangs upon second time calling Form2.

From the debugger it is seen that the second time Form2 is called the module rs232.dll doesn't get initialized (it is initialized only during the first call). Is it possible that Me.Close() (closing Form2) doesn't de-initialize the module rs232.dll? Is there a way to de-initialize a module (supposing that Me.Close() doesn't in fact do that)?
Reply With Quote
  #18  
Old 07-19-2004, 10:42 AM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

De-initialize? You should probably check the methods on the rs232comms1 object that you have and, when you close them, call the method(s) of the rs232comms1 object that releases the connection / closes the object down / does whatever. (Before you close the form)
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #19  
Old 07-19-2004, 10:54 AM
Omnibus Omnibus is offline
Regular
 
Join Date: Jun 2004
Posts: 85
Default

Quote:
Originally Posted by Iceplug
De-initialize? You should probably check the methods on the rs232comms1 object that you have and, when you close them, call the method(s) of the rs232comms1 object that releases the connection / closes the object down / does whatever. (Before you close the form)
I have no idea how to check the methods on the rs232comm1 object and how to release the connection. It would help if you could give me a hint.
Reply With Quote
  #20  
Old 07-19-2004, 11:08 AM
Iceplug's Avatar
Iceplug'Cast from string &quot; ' error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

What kind of object is rs232comm1 declared as? When I say to check the methods, I mean to look at the rs232comm1 members that you get when you press the period after rs232comm1... like rs232comm1. ... then the listbox shows up. There may be something in the list that will close down the connection.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
'Cast from string &quot; ' error
'Cast from string &quot; ' error
'Cast from string &quot; ' error 'Cast from string &quot; ' error
'Cast from string &quot; ' error
'Cast from string &quot; ' error
'Cast from string &quot; ' error 'Cast from string &quot; ' error 'Cast from string &quot; ' error 'Cast from string &quot; ' error 'Cast from string &quot; ' error 'Cast from string &quot; ' error 'Cast from string &quot; ' error
'Cast from string &quot; ' error
'Cast from string &quot; ' error
 
'Cast from string &quot; ' error
'Cast from string &quot; ' error
 
-->