I have one question. The system which should communicate with my app has variable size, thus the number of registers that need to be read is variable. I tried to create the tags dynamically like that:
procedure TForm1.Button2Click(Sender: TObject);
var
Cell_V_tag: array of TPLCBlockElement;
begin
if SaveDialog1.Execute then
begin
DataLogFileName:=SaveDialog1.Filename;
logging_en:=true;
label25.caption:=DataLogFileName;
LogFile_Create_Header(SaveDialog1.Filename);
SetLength(Cell_V_tag,round(Form1.Config_Block_BRD_num_PortA.Value+Form1.Config_Block_BRD_num_PortB.Value)*23);
Cell_V_tag[0].Create(self);
// Cell_V_tag[1].Create(self);
end;
end;
unfortunately I always get SIGSEGV error. Can you help me please to solve this problem?
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can create Dynamic tags at runtime. you have to to
block.Size:=NewSize;
for i:=0 to Block.Size-1 do begin
BlockElement:=TPLCBlockElement.Create(block);
BlockElement.Index:=i;
BlockElement.PLCBlock:=Block;
end;
Please take care if you are using Modbus, because on this protocol, block has a restriction of 125 holding registers (words)
Please join to Telegram group to get more fast help.
Hello Fabio
I have one question. The system which should communicate with my app has variable size, thus the number of registers that need to be read is variable. I tried to create the tags dynamically like that:
procedure TForm1.Button2Click(Sender: TObject);
var
Cell_V_tag: array of TPLCBlockElement;
begin
if SaveDialog1.Execute then
begin
DataLogFileName:=SaveDialog1.Filename;
logging_en:=true;
label25.caption:=DataLogFileName;
LogFile_Create_Header(SaveDialog1.Filename);
SetLength(Cell_V_tag,round(Form1.Config_Block_BRD_num_PortA.Value+Form1.Config_Block_BRD_num_PortB.Value)*23);
Cell_V_tag[0].Create(self);
// Cell_V_tag[1].Create(self);
end;
end;
unfortunately I always get SIGSEGV error. Can you help me please to solve this problem?
Thank you.
You can create Dynamic tags at runtime. you have to to
block.Size:=NewSize;
for i:=0 to Block.Size-1 do begin
BlockElement:=TPLCBlockElement.Create(block);
BlockElement.Index:=i;
BlockElement.PLCBlock:=Block;
end;
Please take care if you are using Modbus, because on this protocol, block has a restriction of 125 holding registers (words)
Please join to Telegram group to get more fast help.
https://t.me/pascalscada