Corrections suite aux essais d'interface avec le SACL.
This commit is contained in:
parent
a55770c693
commit
bd27aa9c3d
@ -49,7 +49,7 @@ SONDE_LASER_EXT_1=ttyS0
|
|||||||
#avec la CC
|
#avec la CC
|
||||||
UTILISER_MODBUS_CC=OUI
|
UTILISER_MODBUS_CC=OUI
|
||||||
#Adresse modbus de la ZT
|
#Adresse modbus de la ZT
|
||||||
MODBUS_CC_DEVID=9
|
MODBUS_CC_DEVID=1
|
||||||
#Port Modbus/TCP
|
#Port Modbus/TCP
|
||||||
MODBUS_CC_PORT=2182
|
MODBUS_CC_PORT=2182
|
||||||
|
|
||||||
|
|||||||
@ -233,8 +233,8 @@ int CModbusBackend::AnalyzeModbusRequest(CModbusTransaction Transaction)
|
|||||||
//Write register data
|
//Write register data
|
||||||
mModbusRepo->WriteHRData(StartAdress,NbRegisters,data);
|
mModbusRepo->WriteHRData(StartAdress,NbRegisters,data);
|
||||||
|
|
||||||
qDebug("Slave Rx Write Multiple Registers. Address: %d, Nb Reg: %d",StartAdress, NbRegisters);
|
qDebug("\nSlave Rx Write Multiple Registers. Address: %d, Nb Reg: %d",StartAdress, NbRegisters);
|
||||||
qDebug("Data: %s",data.toHex().data());
|
qDebug("Data: %s\n",data.toHex().data());
|
||||||
|
|
||||||
data = Transaction.mPDU.mData.left(4); //The response corresponds to the Start Adress and Nb of Regs. Which is the first 4 bytes of the initial request.
|
data = Transaction.mPDU.mData.left(4); //The response corresponds to the Start Adress and Nb of Regs. Which is the first 4 bytes of the initial request.
|
||||||
SendModbusResponse(Transaction, data);
|
SendModbusResponse(Transaction, data);
|
||||||
|
|||||||
@ -42,6 +42,9 @@
|
|||||||
#define ZT2_V02_ALARM_FLAG_MASK 0x0004
|
#define ZT2_V02_ALARM_FLAG_MASK 0x0004
|
||||||
#define ZT2_PEQ2_ALARM_FLAG_MASK 0x0008
|
#define ZT2_PEQ2_ALARM_FLAG_MASK 0x0008
|
||||||
|
|
||||||
|
//Flags definitions for HR2027
|
||||||
|
#define ZT_WATCHDOG_ON_VALUE 0x8000
|
||||||
|
#define ZT_WATCHDOG_OFF_VALUE 0x0000
|
||||||
|
|
||||||
|
|
||||||
//Register addressing
|
//Register addressing
|
||||||
|
|||||||
@ -184,15 +184,17 @@ void CModbusCCMgr::ModbusCCWatchdogTimeout()
|
|||||||
|
|
||||||
void CModbusCCMgr::ModbusZTWatchdogTimeout()
|
void CModbusCCMgr::ModbusZTWatchdogTimeout()
|
||||||
{
|
{
|
||||||
qint16 WD = mZTWatchdog;
|
|
||||||
|
quint16 WD = mZTWatchdog;
|
||||||
|
// qDebug("WD = 0x%x",WD);
|
||||||
mModbusRepo->WriteSingleReg(MODBUS_ZT_WATCHDOG_REG_ADD,WD);
|
mModbusRepo->WriteSingleReg(MODBUS_ZT_WATCHDOG_REG_ADD,WD);
|
||||||
if(mZTWatchdog == 1)
|
if(mZTWatchdog == ZT_WATCHDOG_ON_VALUE)
|
||||||
{
|
{
|
||||||
mZTWatchdog = 0;
|
mZTWatchdog = ZT_WATCHDOG_OFF_VALUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mZTWatchdog = 1;
|
mZTWatchdog = ZT_WATCHDOG_ON_VALUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ private:
|
|||||||
QTcpServer *mModbusServer;
|
QTcpServer *mModbusServer;
|
||||||
int mModbusPort;
|
int mModbusPort;
|
||||||
QTimer *mZTWatchdogTimer, *mCCWatchdogTimer;
|
QTimer *mZTWatchdogTimer, *mCCWatchdogTimer;
|
||||||
qint16 mZTWatchdog;
|
quint16 mZTWatchdog;
|
||||||
qint16 mCCWatchdogState;
|
qint16 mCCWatchdogState;
|
||||||
bool mCCLinkState;
|
bool mCCLinkState;
|
||||||
QDateTime *mLastDateTime;
|
QDateTime *mLastDateTime;
|
||||||
|
|||||||
@ -154,7 +154,7 @@ unsigned int CSimulationScenario::CreateScenario()
|
|||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
InsertNewStep(STEP_ACTION_ACTIVATE_PGI,0);
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
InsertNewStep(STEP_ACTION_ACTIVATE_PGE,0);
|
||||||
//V00 DETECTION
|
//V00 DETECTION
|
||||||
// if(bogie != 9)
|
if(bogie != 9)
|
||||||
{
|
{
|
||||||
InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
InsertNewStep(STEP_ACTION_ACTIVATE_S1,SENSOR_DELAY);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user