Market Leader in SECS/GEM, Test Automation, AI Vision and Smart Factory

Smart FactorySupportFAQ

How to Send Custom S9F * Messages

Messages in the format defined in SECS-II (E5) are programmed in the following manner when XCom automatically sends them, but uses a custom S9 series message that is not in SEMI standard format.
Custom S9F * Message
1) Defines S9 series message in XCom Configuration tool.
2) Set the S9 series automatic reply to false in the XCom Configuration tool.
3) OnSecsEventXCom User can manually code and send S9F * message based on event information.

How to manually create S9F * messages using OnSecsEventXCom is shown below.
void CEqSampleDlg :: OnSecsEventXCom (short nEventId long lParam)
{
char szMsg [256];

short nDevId_Err, nS_Err, nF_Err, nWBit_Err;
long lSysByte_Err;
short nDevId;
long lMsgId, lSysByte;
short baBody [10];
int nResult;

if (nEventId == 203 ) {// T3 timeout ...
}
else if (nEventId == 102) {//? NOT_SELECTED ...
}
else if (nEventId == 101) {//? NOT_CONNECTED ...
}
else if (nEventId == 103) {//? SELECTED ...
}
else if (nEventId == 221) {// Unknown Device ID ...
nResult = m_XCom.GetInvalidMsgInfo (lParam & nDevId_Err & nS_Err & nF_Err
& lSysByte_Err & nWBBit_Err );
baBody [0] = HIBYTE (nDevId_Err);
baBody [1] = LOBYTE (nDevId_Err);
baBody [2] = (BYTE) ((nWBit_Err == 0)? (nS_Err): (nS_Err + 0x80));
baBody [3] = (BYTE) nF_Err;
baBody [4] = baBody [5] = 0;
baBody [6] = HIBYTE (HIWORD (lSysByte_Err));
baBody [7] = LOBYTE (HIWORD (lSysByte_Err));
baBody [8] = HIBYTE (LOWORD (lSysByte_Err));
baBody [9] = LOBYTE (LOWORD (lSysByte_Err));

nDevId = atoi (m_cmbDevice.GetBuffer (2));
lSysByte = lSysByte_Err;
m_XCom.MakeSecsMsg (& lMsgId nDevId 9 1 lSysByte);
m_XCom.SetBinaryItem ((lMsgId, (short) ) baBody 10);
nResult = m_XCom.Send (lMsgId);
if (nResult> = 0) {
}
else {}
}
else if (nEventId == 222) {// Unknown Stream ...

nResult = m_XCom.GetInvalidMsgInfo (lParam, & nDevId_Err & nS_Err & nF_Err
& lSysByte_Err & nWBit_Err);
ba 0] = HIBYTE (nDevId_Err);
ba Body [1] = LOBYTE (nDevId_Err);
baBody [2] = (BYTE) ((nWBit_Err == 0)? (nS_Err): (nS_Err + 0x80));
baBody [3] = (BYTE) nF_Err;
baBody [4] = baBody [5] = 0;
baBody [6] = HIBYTE (HIWORD (lSysByte_Err));
baBody [7] = LOBYTE (HIWORD (lSysByte_Err));
baBody [8] = HIBYTE (LOWORD (lSysByte_Err));
baBody [9] = LOBYTE (LOWORD (lSysByte_Err));

nDevId = atoi (m_cmbDevice.GetBuffer (2));
lSysByte = lSysByte_Err;
m_XCom.MakeSecsMsg (& lMsgId nDevId 9 3 lSysByte );
m_XCom.SetBinaryItem (lMsgId, (short *) baBody, 10) ;?
nResult = m_XCom.Send (lMsgId);
if (nResult> = 0) {
}
else {
}
else {
}
}

Caution
MHEAD: S9F1, S9F3, S9F5, S9F7 Msg is Msg because Msg sent from the other side has a problem
The header that caused the problem should be sent as it is.
S9F1: Unrecognized Device ID
S9F3: Unrecognized Stream
S9F5: Unrecognized Function
S9F7: illegal Data
S9F9: Transaction Timeout
S9F11: Data Too Long
S9F13: Conversation Timeout (XCom not supported)