Note that there are some explanatory texts on larger screens.

plurals
  1. POIs the MsComm ActiveX compatible with Delphi 2010?
    primarykey
    data
    text
    <p>I have ported our project from Delphi 7 to Delphi 2010. After adding some type casts now my project is running well and all the features work correctly except main functionality of the program which is bound to COM ports and the MSCOMM ActiveX component.</p> <p>It can read and write from a COM port but it seems something is wrong with that because the device that connected to he port returns error code although it works correctly with same code in Delphi7. In the code you can see below after sending some bytes to the device a byte is sent as checksum. On the other side the device gets the bytes and calculates check sum with same formula if received check sum was equal with calculated check sum device returns "O" as OK else it returns "E" as Error. <code>OutCom</code> is defined as Olevariant.</p> <pre><code>OutCom := chr(ord(Fbyte)); Mscomm1.Output := OutCom; OutCom := chr(ord(Sbyte)); Mscomm1.Output := OutCom; OutCom := chr(ord(DigitOne)); Mscomm1.Output := OutCom; OutCom := chr(ord(DigitTwo)); Mscomm1.Output := OutCom; OutCom := chr(ord(DigitThree)); Mscomm1.Output := OutCom; SumOfBits := (System_No - 1) + Fbyte + Sbyte + DigitOne + DigitTwo + DigitThree; CheckSum := ( (SumOfBits mod 256) xor 255 ) + 1; OutCom := chr(ord(CheckSum)); Mscomm1.Output := OutCom; OutCom := 'E'; Mscomm1.Output := OutCom; OutCom := 'N'; Mscomm1.Output := OutCom; </code></pre> <p>Same code in Delphi 2010 returns different result. I guess that the chr() function returns a different result as Delphi7. If this is true then how can I get the Ascii char of a byte or is there a way to pass a byte to Mscomm without converting to char?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload