ATEasy unhandled exception and compiling error??

Paul T.
Maennedorf, Zurich

Mar 6, 2012
64 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

Hi! Please, I need help! I have two applications written in ATEasy that also uses a .ocx library. When running the first one, it gaved me the run-time error pasted in Pic1.bmp. The second application gave me the unhandled exception pasted in Pic2.bmp and the application crashed after this. :(. What seems to be the problem? When I compiled this application before, it was OK, no errors. Please help me!!


File Attachment:
Pic1.bmp

Paul T.
Maennedorf, Zurich

Mar 6, 2012
64 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

the second image (unhandled exception)


File Attachment:
Pic2.bmp

DrATEasy (Ron Y.)
Mission Viejo, CA

Mar 7, 2012
367 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

For the first one, you need to change the OnStartStage procedure and check the Compile flag on the procedure property page.

For the second error, I cant see your code and you did not scroll down to show the PCCode in line 81 where the error occurred and I can't see your source code. It seems you have an issue with a procedure Protocol.CRC16_CRCCalc. If the line #81 calls a DLL, check the parameters of the
DLL procedure if they are defined correctly (look at the C header file if exist), also check if the arguments are matching and buffer are allocated properly (usually string not allocated buffer before passed in to the DLL.

Paul T.
Maennedorf, Zurich

Mar 7, 2012
64 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

If I make an .exe file, it is mandatory to have all procedures within the project's drivers with the Compile flag checked? Or it is enough to compile the project and build the .exe after that?


For the second error, the procedure CRC16_CRCCalc doesn't call any DLL. It receives an array of bytes and applies the CRC-16 algorithm to retrieve a CRC on 2 bytes (please see code below) and, misteriously, line #81 is empty! Line #81 is between  lines    "constant_index = constant_index + 1" and     "CRC_Low = buf[data_index] xor CRC_table[constant_index]"!

CRC16_CRCCalc(Var byte[] buf, Val DWord dataLen, Val Byte headerSize, Val Word crcInitVal): Word Public

{CRC_table_1 = {0x00, 0x00, 0x10, 0x21, 0x20, 0x42, 0x30, 0x63, 0x40, 0x84, 0x50, 0xA5, 0x60, 0xC6, 0x70, 0xE7,                0x81, 0x08, 0x91, 0x29, 0xA1, 0x4A, 0xB1, 0x6B, 0xC1, 0x8C, 0xD1, 0xAD, 0xE1, 0xCE, 0xF1, 0xEF,                0x12, 0x31, 0x02, 0x10, 0x32, 0x73, 0x22, 0x52, 0x52, 0xB5, 0x42, 0x94, 0x72, 0xF7, 0x62, 0xD6,                0x93, 0x39, 0x83, 0x18, 0xB3, 0x7B, 0xA3, 0x5A, 0xD3, 0xBD, 0xC3, 0x9C, 0xF3, 0xFF, 0xE3, 0xDE,                0x24, 0x62, 0x34, 0x43, 0x04, 0x20, 0x14, 0x01, 0x64, 0xE6, 0x74, 0xC7, 0x44, 0xA4, 0x54, 0x85,                0xA5, 0x6A, 0xB5, 0x4B, 0x85, 0x28, 0x95, 0x09, 0xE5, 0xEE, 0xF5, 0xCF, 0xC5, 0xAC, 0xD5, 0x8D,                0x36, 0x53, 0x26, 0x72, 0x16, 0x11, 0x06, 0x30, 0x76, 0xD7, 0x66, 0xF6, 0x56, 0x95, 0x46, 0xB4,                0xB7, 0x5B, 0xA7, 0x7A, 0x97, 0x19, 0x87, 0x38, 0xF7, 0xDF, 0xE7, 0xFE, 0xD7, 0x9D, 0xC7, 0xBC,                0x48, 0xC4, 0x58, 0xE5, 0x68, 0x86, 0x78, 0xA7, 0x08, 0x40, 0x18, 0x61, 0x28, 0x02, 0x38, 0x23,                0xC9, 0xCC, 0xD9, 0xED, 0xE9, 0x8E, 0xF9, 0xAF, 0x89, 0x48, 0x99, 0x69, 0xA9, 0x0A, 0xB9, 0x2B,                0x5A, 0xF5, 0x4A, 0xD4, 0x7A, 0xB7, 0x6A, 0x96, 0x1A, 0x71, 0x0A, 0x50, 0x3A, 0x33, 0x2A, 0x12,                0xDB, 0xFD, 0xCB, 0xDC, 0xFB, 0xBF, 0xEB, 0x9E, 0x9B, 0x79, 0x8B, 0x58, 0xBB, 0x3B, 0xAB, 0x1A,                0x6C, 0xA6, 0x7C, 0x87, 0x4C, 0xE4, 0x5C, 0xC5, 0x2C, 0x22, 0x3C, 0x03, 0x0C, 0x60, 0x1C, 0x41,                0xED, 0xAE, 0xFD, 0x8F, 0xCD, 0xEC, 0xDD, 0xCD, 0xAD, 0x2A, 0xBD, 0x0B, 0x8D, 0x68, 0x9D, 0x49,                0x7E, 0x97, 0x6E, 0xB6, 0x5E, 0xD5, 0x4E, 0xF4, 0x3E, 0x13, 0x2E, 0x32, 0x1E, 0x51, 0x0E, 0x70,                0xFF, 0x9F, 0xEF, 0xBE, 0xDF, 0xDD, 0xCF, 0xFC, 0xBF, 0x1B, 0xAF, 0x3A, 0x9F, 0x59, 0x8F, 0x78}

CRC_table_2 = {0x91, 0x88, 0x81, 0xA9, 0xB1, 0xCA, 0xA1, 0xEB, 0xD1, 0x0C, 0xC1, 0x2D, 0xF1, 0x4E, 0xE1, 0x6F,                0x10, 0x80, 0x00, 0xA1, 0x30, 0xC2, 0x20, 0xE3, 0x50, 0x04, 0x40, 0x25, 0x70, 0x46, 0x60, 0x67,                0x83, 0xB9, 0x93, 0x98, 0xA3, 0xFB, 0xB3, 0xDA, 0xC3, 0x3D, 0xD3, 0x1C, 0xE3, 0x7F, 0xF3, 0x5E,                0x02, 0xB1, 0x12, 0x90, 0x22, 0xF3, 0x32, 0xD2, 0x42, 0x35, 0x52, 0x14, 0x62, 0x77, 0x72, 0x56,                0xB5, 0xEA, 0xA5, 0xCB, 0x95, 0xA8, 0x85, 0x89, 0xF5, 0x6E, 0xE5, 0x4F, 0xD5, 0x2C, 0xC5, 0x0D,                0x34, 0xE2, 0x24, 0xC3, 0x14, 0xA0, 0x04, 0x81, 0x74, 0x66, 0x64, 0x47, 0x54, 0x24, 0x44, 0x05,                0xA7, 0xDB, 0xB7, 0xFA, 0x87, 0x99, 0x97, 0xB8, 0xE7, 0x5F, 0xF7, 0x7E, 0xC7, 0x1D, 0xD7, 0x3C,                0x26, 0xD3, 0x36, 0xF2, 0x06, 0x91, 0x16, 0xB0, 0x66, 0x57, 0x76, 0x76, 0x46, 0x15, 0x56, 0x34,                0xD9, 0x4C, 0xC9, 0x6D, 0xF9, 0x0E, 0xE9, 0x2F, 0x99, 0xC8, 0x89, 0xE9, 0xB9, 0x8A, 0xA9, 0xAB,                0x58, 0x44, 0x48, 0x65, 0x78, 0x06, 0x68, 0x27, 0x18, 0xC0, 0x08, 0xE1, 0x38, 0x82, 0x28, 0xA3,                0xCB, 0x7D, 0xDB, 0x5C, 0xEB, 0x3F, 0xFB, 0x1E, 0x8B, 0xF9, 0x9B, 0xD8, 0xAB, 0xBB, 0xBB, 0x9A,                0x4A, 0x75, 0x5A, 0x54, 0x6A, 0x37, 0x7A, 0x16, 0x0A, 0xF1, 0x1A, 0xD0, 0x2A, 0xB3, 0x3A, 0x92,                0xFD, 0x2E, 0xED, 0x0F, 0xDD, 0x6C, 0xCD, 0x4D, 0xBD, 0xAA, 0xAD, 0x8B, 0x9D, 0xE8, 0x8D, 0xC9,                0x7C, 0x26, 0x6C, 0x07, 0x5C, 0x64, 0x4C, 0x45, 0x3C, 0xA2, 0x2C, 0x83, 0x1C, 0xE0, 0x0C, 0xC1,                0xEF, 0x1F, 0xFF, 0x3E, 0xCF, 0x5D, 0xDF, 0x7C, 0xAF, 0x9B, 0xBF, 0xBA, 0x8F, 0xD9, 0x9F, 0xF8,                0x6E, 0x17, 0x7E, 0x36, 0x4E, 0x55, 0x5E, 0x74, 0x2E, 0x93, 0x3E, 0xB2, 0x0E, 0xD1, 0x1E, 0xF0}


CRC_Low = crcInitVal shr 8
CRC_High = crcInitVal and 0x00FF

for data_index=headerSize to dataLen-1

    if ((CRC_High and 0x80) = 0x00) then
        CRC_table = CRC_table_1
    else
        CRC_table = CRC_table_2
    endif

    constant_index = CRC_High shl 1

    CRC_High = CRC_Low xor CRC_table[constant_index]

    constant_index = constant_index + 1
! here is line #81 !!!!
    CRC_Low = buf[data_index] xor CRC_table[constant_index]

next



wResult=CRC_High + (CRC_Low shl 8)


return wResult
}

I just don't understand why is this happening...

Paul T.
Maennedorf, Zurich

Mar 8, 2012
64 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

I must mention that this CRC16_CRCCalc (...) procedure is used a lot in other applications and it never caused problems! Is there a possibility that the cause to be the fact that within this faulty application, I have an old (made in 2005) .ocx library that contains the GUI etc. ? Anyway, the .ocx doesn't contain any code that refers to this CRC16_CRCCalc procedure! This unhandled exception doesn't appear always! Sometimes the code runs OK. Any idea? Please help!

DrATEasy (Ron Y.)
Mission Viejo, CA

Mar 8, 2012
367 Posts

0  |  0  

Re: ATEasy unhandled exception and compiling error??

1. You don't need to mark procedure with compile flag unless you use implicit call using procedure variable for example:

proc="OnStartStage"
proc()

In this case, the compiler does not know that you have a reference to the procedure and that is why you need to use the compile flag. Another option is to uncheck the checkbox in the project properties Misc page "Exclude Unrefrenced Procedure From Build".

2. It looks to me like your memory is corrupted earlier. Try to upgrade to the latest ATEasy 7 142g or if using version 8 to build 148. If it does not work, I suggest to create a support/magic incident and upload your files to the issue.Also specify the ATEasy version and build you are using and the operating system. We would also require the Windows event log (see http://www.marvintest.com/KnowledgeBase/KBSearchArticles.aspx?ID=213&task=gosearch=windows+event&type=AND).



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]