感谢西门子公司提供的Eigen Engineering Agent的试用机会。
Agent的注册账号与西门子账号不一样,需要另外注册,其账号的安全性更高,需要以手机号的验证码登录。

每个账户的Token是1000个,每提一个问题会消耗一个Token。
文件上传功能没有使用过。
其基本操作页面跟其他的AI工具类似:
出现基本的对话框,以及聊天的历史记录
Agent设计之初是可以直接将功能块导入到项目中,不用另外添加。

可能使用的是公司电脑,公司可能对电脑做了某些限制。根据网上查询的解决办法逐一检查设置,检查了所有的权限,。也可能是电脑中安装了多个版本的TIA导致的。最后Agent还是不能直接将功能块添加到项目中。

最后根据提示,手动复制到项目中,复制的程序不能完整使用,会报错。需要手动调整,但是尽管如此,还是节约了很多工作量。期待Agent的持续优化。
以下是Agent生成的程序,感兴趣的可以复制到PLC中测试,就能发现其中的问题。
FUNCTION_BLOCK "FB_ScaleComm_OhausLD224"
{ S7_Optimized_Access := 'TRUE' }
AUTHOR : 'Eigen'
VERSION : 0.1
// 电子称通讯功能块 - 奥豪斯LD224 + 艾莫迅RS232转TCP模块
// 通讯协议: TCP客户端 -> 艾莫迅模块 -> RS232 -> 电子称
VAR_INPUT
xConnect : Bool; // 1: 建立连接, 0: 断开连接
sIPAddress : String[15] := '192.168.1.100'; // 艾莫迅模块IP地址
iPort : Int := 5000; // 艾莫迅模块端口
xReadWeight : Bool; // 读取重量
xTare : Bool; // 去皮
xZero : Bool; // 校零
xTimerReset : Bool; // 复位定时器
END_VAR
VAR_OUTPUT
xConnected : Bool; // 已连接
xConnecting : Bool; // 连接中
xError : Bool; // 错误
wErrorID : Word := 0;
rWeight : Real := 0.0; // 当前重量
xStable : Bool := FALSE;
xOverLoad : Bool := FALSE;
xUnderLoad : Bool := FALSE;
xReceiving : Bool;
iRecLen : Int := 0;
END_VAR
VAR
instTCON : TCON;
instTDISCON : TDISCON;
instTSEND_C : TSEND_C;
instTRCV_C : TRCV_C;
instTimer : TON;
tconParams : TCON_PARAMS;
arrSendData : Array[0..19] of Byte;
arrRecvData : Array[0..99] of Byte;
iState : Int := 0;
bSendReq : Bool := FALSE;
bRecvEnable : Bool := FALSE;
sSendCommand : String[10];
sRecvString : String[100];
sWeightStr : String[20];
iPos : Int;
iPos2 : Int;
bDataValid : Bool;
rTempWeight : Real;
END_VAR
VAR_CONSTANT
cState_Idle : Int := 0;
cState_Connect : Int := 1;
cState_Connected : Int := 2;
cState_SendCmd : Int := 3;
cState_Receive : Int := 4;
cState_Disconnect: Int := 5;
cState_Error : Int := 99;
cTimeoutMs : Time := T#5S;
cConnID : Word := 16#0001;
END_VAR
BEGIN
#xConnecting := FALSE;
#xReceiving := FALSE;
#instTimer(IN := NOT #xTimerReset AND (#iState <> cState_Connected),
PT := #cTimeoutMs,
Q => #,
ET => #);
CASE #iState OF
cState_Idle:
#xConnected := FALSE;
#xError := FALSE;
IF #xConnect THEN
#tconParams.interfaceId := 16#FFFF;
#tconParams.id := #cConnID;
#tconParams.connectionType := 16#11;
#tconParams.activeEstablished := TRUE;
#tconParams.remotePort := UINT_TO_WORD(#iPort);
#tconParams.localPort := 0;
#tconParams.remoteAddr[0] := 16#C0;
#tconParams.remoteAddr[1] := 16#A8;
#tconParams.remoteAddr[2] := 16#01;
#tconParams.remoteAddr[3] := 16#64;
#iState := cState_Connect;
#xConnecting := TRUE;
END_IF;
cState_Connect:
#instTCON(REQ := #xConnect, ID := #cConnID, DONE => #,
BUSY => #xConnecting, ERROR => #xError,
STATUS => #wErrorID, CONNECT := #tconParams);
IF NOT #xConnecting AND NOT #xError THEN
#xConnected := TRUE;
#iState := cState_Connected;
END_IF;
IF #instTimer.Q THEN
#xError := TRUE;
#wErrorID := 16#0001;
#iState := cState_Error;
END_IF;
cState_Connected:
#xConnected := TRUE;
#xConnecting := FALSE;
IF NOT #xConnect THEN
#iState := cState_Disconnect;
ELSE
IF #xReadWeight THEN
#sSendCommand := 'W';
#bSendReq := TRUE;
#iState := cState_SendCmd;
ELSIF #xTare THEN
#sSendCommand := 'T';
#bSendReq := TRUE;
#iState := cState_SendCmd;
ELSIF #xZero THEN
#sSendCommand := 'Z';
#bSendReq := TRUE;
#iState := cState_SendCmd;
END_IF;
END_IF;
cState_SendCmd:
#arrSendData[0] := CHAR_TO_BYTE(CHAR_TO_STRING(MID(IN := #sSendCommand, L := 1, P := 1)));
#arrSendData[1] := 16#0D;
#arrSendData[2] := 16#0A;
#instTSEND_C(REQ := #bSendReq, CONT := TRUE, ID := #cConnID, LEN := 3,
DATA := #arrSendData, DONE => #, BUSY => #,
ERROR => #xError, STATUS => #wErrorID);
#bSendReq := FALSE;
IF NOT #xError THEN
#iState := cState_Receive;
#bRecvEnable := TRUE;
ELSE
#iState := cState_Error;
END_IF;
cState_Receive:
#xReceiving := TRUE;
#instTRCV_C(EN_R := #bRecvEnable, CONT := TRUE, ID := #cConnID,
DATA := #arrRecvData, DONE => #, BUSY => #xReceiving,
ERROR => #xError, STATUS => #wErrorID,
RCVD_LEN => UINT_TO_INT(#iRecLen));
IF #instTRCV_C.DONE THEN
#sRecvString := Chars_TO_Strg(Chars := #arrRecvData, Cnt := #iRecLen, CHR := 32);
bDataValid := FALSE;
FOR iPos := 1 TO LEN(#sRecvString) DO
sWeightStr := MID(IN := #sRecvString, L := 1, P := iPos);
IF (sWeightStr = '+') OR (sWeightStr = '-') OR (sWeightStr >= '0' AND sWeightStr <= '9') THEN
iPos2 := FIND(IN1 := #sRecvString, IN2 := ' ');
IF iPos2 = 0 THEN iPos2 := #iRecLen + 1; END_IF;
sWeightStr := MID(IN := #sRecvString, L := iPos2 - iPos, P := iPos);
STRG_VAL(IN := #sWeightStr, FORMAT := W#16#0000, P := 1, OUT => #rTempWeight);
#rWeight := #rTempWeight;
bDataValid := TRUE;
EXIT;
END_IF;
END_FOR;
IF FIND(IN1 := #sRecvString, IN2 := 'S ') > 0 THEN #xStable := TRUE; ELSE #xStable := FALSE; END_IF;
IF FIND(IN1 := #sRecvString, IN2 := 'OL') > 0 THEN #xOverLoad := TRUE; ELSE #xOverLoad := FALSE; END_IF;
IF FIND(IN1 := #sRecvString, IN2 := 'UL') > 0 THEN #xUnderLoad := TRUE; ELSE #xUnderLoad := FALSE; END_IF;
#iState := cState_Connected;
END_IF;
IF #instTimer.Q THEN
#xError := TRUE;
#wErrorID := 16#0002;
#iState := cState_Error;
END_IF;
cState_Disconnect:
#instTDISCON(REQ := TRUE, ID := #cConnID, DONE => #, BUSY => #,
ERROR => #xError, STATUS => #wErrorID);
IF NOT #instTDISCON.BUSY THEN
#xConnected := FALSE;
#iState := cState_Idle;
END_IF;
cState_Error:
#xConnected := FALSE;
#instTDISCON(REQ := TRUE, ID := #cConnID, DONE => #, BUSY => #,
ERROR => #, STATUS => #);
IF NOT #instTDISCON.BUSY THEN #iState := cState_Idle; END_IF;
END_CASE;
END_FUNCTION_BLOCK