When creating a record structure and the total size of the record structure is not even, the PIC crashes when you try to access a variable in the record.
For example the following code works.
Code: Select all
type
TELinkInfo = record
IPAddr : String[17];
SubMask : String[17];
Gateway : String[17];
HostIP1 : String[17];
HostIP2 : String[17];
ConInterval : word;
CommTimeout : word;
Version : String[7];
end;
type
TComPortInfo = record
MeterMake : word;
BaudRate : word;
Parity : word;
TCPPort : word;
Connected : word;
SNumber : String[17];
end;
var
ELinkInfo : TELinkInfo;
ComPortInfo : array[0..3] of TComPortInfo;
begin
ComPortInfo[1].TCPPort := 1234;
end;
Code: Select all
type
TComPortInfo = record
MeterMake : word;
BaudRate : word;
Parity : word;
TCPPort : word;
Connected : word;
SNumber : String[16];
end;
Thank you
Anton