Jump to content
Xtreme .Net Talk

tcomputerchip

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by tcomputerchip

  1. I am having some problems with one of my converters taking a very long time to convert small binary files (<200 K in total). It takes about 8 sec / file. I was wondering if there is a way to measure the time it takes to complete the process. If so, could you provide example code. Thanks.
  2. You have a type-o in your code. ei = Io.File.OpenText("E:\text.txt") I think it should be: eii = Io.File.OpenText("E:\text.txt")
  3. Update: I have had no problem with the Top structure. The <VBFixedArray(6)> I knew about and was using. To help in your troubleshooting, the section of the file that I am reading and having problems with is the LimitItemName; its stored as ASCII and is 6 char's long. My problem is on the second Stucture when calling it through the file reader: 'Module: Public Structure LabelArea Public DateYearTested As Byte Public DateMonthTested As Byte Public DateDayTested As Byte Public DateHourTested As Byte Public DateMinuteTested As Byte Public DateSecondTested As Byte <VBFixedString(8)> Public FileName As String ' Redundent but here (8) <VBFixedString(10)> Public DeviceName As String ' Name of part or part number (10) <VBFixedString(10)> Public Operator As String ' Person that ran/collected test data (10) Public TestingMode As Byte ' first bit 0 = TBB, 1 = TBS (1) Public StationName As Char ' Station A,B,C,D and F (1) <VBFixedString(10)> Public LotName As String ' Lot for device that were tested (10) <VBFixedString(50)> Public Comment As String ' Comments of test (50) Public TimePoint As Short ' Test number mostly for HiRel applications\ Public SetQuantity As Short ' Number of device that were tested Public LoggingRate As Short ' Results sorted after N test 1 in 5, 2 in 10 Public TestMax As Short ' Number of test used to collect data Public DataBlockNum As Short ' Not used currently Public LoggedQuantity As Short ' Actual Logged quantity Public IndexMax As Short ' Device Index <VBFixedArray(18)> Public Reserved As Byte ' Future use (18) End Structure Public Structure TestItemArea Public TestNumber As Byte 'Test Number Public ItemGroupCode As Byte 'Item Group Code <VBFixedArray(2)> Public ItemCode As Byte 'Item Code Public BEConditionFlag As Byte 'BE Condition & Flag Public ResultBiasFlag As Byte 'Result as BIAS Flag <VBFixedString(6)> Public LimitItemName As String 'Limit Item Name Public LimitUnit As Short 'Limit Unit, second byte not used Public LimitValue As Single 'Limit Value Public LimitMax As Single 'Limit Min Public LimitMin As Single 'Limit Max <VBFixedString(4)> Public bias1Name As String 'Bias 1 Name <VBFixedString(2)> Public bias1Unit As String 'Bias 1 Unit Public bias1Value As Single 'Bias 1 Value <VBFixedString(4)> Public bias2Name As String 'Bias 2 Name <VBFixedString(2)> Public bias2Unit As String 'Bias 2 Unit Public bias2Value As Single 'Bias 2 Value <VBFixedString(4)> Public TimeCondition As String 'Time Condition Name (4) <VBFixedString(2)> Public TimeUnit As Byte 'Time Unit (2) Public TimeValue As Single 'Time Value Public DLIFlags As Byte 'DL Inhibit Flags <VBFixedArray(7)> Public Reserved As Byte 'Reserved End Structure This is a stripped down version of what I am doing, the section of code that I am having problems with is noteded below. Function ConvertFile() As Boolean '...Inside class function FileIndex = 1 FileGet(FileNum, getLabelArea, FileIndex) ', FileIndex) FileIndex = FileIndex + 127 '...Removed Company code... '...Continue Public code... For i = 1 To getLabelArea.TestMax FileGet(FileNum, getTestItemArea, FileIndex) TestItemL1 = TestItemArea.LimitItemName.ToString 'Always returns 0, not wanted, should return String of Text (6 chr's long) FileIndex = (i * 64) + 128 Next i '...End Public code... End Function
  4. There is not too much documentation on the XML serialization. I only found 1 document that shows a sample. And it does not look like what I am trying to do. If you could explain, or give sample code of this XML method, please do so.
  5. Ok, this is starting to get very frustrating. VB.NET is not VB6 at all. If you someone tells you different kick them in the shins! This is the problem: I need to read binary data from a file. In VB6 this is what it looked like: Dim getLabelArea As LabelArea 'This is my Structure Code in VB6 'Open file code for binary omitted Get(FileInNum, getLabelArea, FileIndex) 'This would take the Type and store the values read in binary mode into the Type Structure This is VBNET Seek(FileInNum, FileIndex) Input(FileInNum, getLabelArea) 'I need for getLabelArea to extract the data in the dimentioned order and store the data in the Difined Structure. There maybe another way to read the data binary other than using the FileGet function. If there is where can I get some information or code on this?
  6. Thanks for the reply. I know about the Integer problem, I have delt with that with several of the classes I have worked on. The "LotsOfData(25) As Byte" does not work at all.
  7. Ok this one may be difficault for some of you. This is the problem. I have a converter program that converts binary data to text formated data. The class was written in VB6. I would like to convert the class to VBNET. The problem is I don't know anything about Structures except that it replaces Type declerations. Now, when I convert the Type over to structure I have many errors still in my dimentioned varialbles. Example: VB6 Type bLineData ByteOfData As String * 1 '1 Char only LotsOfData(25) As Byte '25 bytes only End Type Change to VBNET: Structure bLineData Dim ByteOfData As String * 1 'Not Working Dim LotsOfData(25) as Byte 'Not Working End Structure If someone could modify the code below, or parts of it and give me example of how I should convert the code to VBNET that would be great. Code Working On: Module modConvert Type LabelArea DateTimeValue(5) As Byte FileName As String * 8 ' Redundent but here DeviceName As String * 10 ' Name of part or part number Operator As String * 10 ' Person that ran/collected test data TestingMode As Byte ' first bit 0 = TBB, 1 = TBS StationName As String * 1 ' Station A,B,C,D and F LotName As String * 10 ' Lot for device that were tested Comment As String * 50 ' Comments of test TimePoint As Integer ' Test number mostly for HiRel applications\ SetQuantity As Integer ' Number of device that were tested LoggingRate As Integer ' Results sorted after N test 1 in 5, 2 in 10 TestMax As Integer ' Number of test used to collect data DataBlockNum As Integer ' Not used currently LoggedQuantity As Integer ' Actual Logged quantity IndexMax As Integer ' Device Index Reserved(17) As Byte ' Future use End Type Type TestItemArea TestNumber As Byte 'Test Number ItemGroupCode As Byte 'Item Group Code ItemCode As Integer 'Item Code BEConditionFlag As Byte 'BE Condition & Flag ResultBiasFlag As Byte 'Result as BIAS Flag LimitItemName As String * 6 'Limit Item Name LimitUnit As Integer 'Limit Unit, second byte not used LimitValue As Single 'Limit Value LimitMax As Single 'Limit Min LimitMin As Single 'Limit Max bias1Name As String * 4 'Bias 1 Name bias1Unit As String * 2 'Bias 1 Unit bias1Value As Single 'Bias 1 Value bias2Name As String * 4 'Bias 2 Name bias2Unit As String * 2 'Bias 2 Unit bias2Value As Single 'Bias 2 Value TimeCondition As String * 4 'Time Condition Name TimeUnit(1) As Byte 'Time Unit TimeValue As Single 'Time Value DLIFlags As Byte 'DL Inhibit Flags Reserved(6) As Byte 'Reserved End Type Type WafferData wafferID As Byte 'Always 'W' wafferNumber As Byte 'Waffer Number NumberOfDevices As Integer 'Number of devices Reserved As Integer 'Reserved End Type Type DeviceData deviceID As Byte 'Always 'D' ZeroZero As Byte 'Always '00' SerialNumber As Integer 'Number of devices BinNumber As Integer 'Reserved End Type Type TestData TestNumber As Byte 'TestNumber Flags As Byte 'Flags TestValue As Single 'Test Resualt Value End Type Type bLineData ByteOfData As String * 1 'Extract data for check End Type End Module
  8. Hey, you don't need to batter my code. This is my 4th program I am revising from over 50,000 lines of code. Im not worried about error trapping at this point. I know how to find the error. I have never used any of the new programming structure so I did not know about Try/Catch. If you are willing explain what you are so eger to bash I would be greatfull. Also, I do not know what you are talking about with the Redemension of the Array. I know how to do it in VB 6 but I though ReDim was removed from .NET. Please explain in more detail.
  9. Thanks Much for the responces to my troubles. I have been working in VB.NET for about 1 month now and 3 out of 10 programs that will be recreated in .NET have been completed. I am and number 4 and man it's hell. Good luck coding!
  10. I want to be able to store all the iterations of the frmStatus in an object array, similar to if you had mutible documents opened in MS Word. I want to be able to call the forms though the array collection so that I can open and close them as needed. The project is setup with MDI Parent (frmServer) and MDI Child (frmStatus) [set in code]. When I check the Status(AvailableID) that it should have created the Object is still set to Nothing. This is what I have so far. 'Global Vars Dim Status() As frmStatus Dim AvailableID As Integer 'Sub In question? Private Sub mnuShowMDI_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuShowMDI.Click On Error Resume Next Dim FoundAvailable As Boolean FoundAvailable = False Do Until FoundAvailable = True If Status(AvailableID) Is Nothing Then 'Force Error FoundAvailable = True End If AvailableID = AvailableID + 1 Loop Status(AvailableID) = New frmStatus() Status(AvailableID).MdiParent = Me If AvailableID = 1 Then Status(AvailableID).Text = ":New Status Window" Else Status(AvailableID).Text = ":New Status Window[" & AvailableID & "]" End If Status(AvailableID).Show() End Sub
  11. Here is what you do. Public Class frmMain Inherits System.Windows.Forms.Form Dim myForm As New frmMain() 'Instatiate my new form object, used to overide default form object Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load myForm.Hide() End Sub Protected Overrides Sub Finalize() MyBase.Finalize() myForm = Nothing 'Clear the mySettings Object End Sub End Class 'Please let me know if this works, it worked for me
  12. Thanks, that is what I need. If there are any other resource out there. Please let me know. I will be sure to purchase that book.
  13. I think I may have purchased the wrong version of VB.NET. I would like to migrate my applications to VB.NET from VB6. If there are any websites or books that describe this in detail could you please inform me. Thanks in advance.
×
×
  • Create New...