Skip to content
Snippets Groups Projects
Commit a8d8ffab authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Enable hardware polling time

parent 55cc2573
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ namespace CryoCooler_ns
}
conf.output_offset = DB_END_OUTPUT_OFFSET;
conf.output_length = DB_END_OUTPUT_LEN;
// conf.periodic_timeout_ms = periodic_timeout_ms;
conf.periodic_timeout_ms = periodic_timeout_ms;
hwp = new HWProxy_ns::HWProxy (host_dev, conf);
if (!hwp)
......@@ -147,7 +147,7 @@ namespace CryoCooler_ns
conf.output_length = DB_WRITE_OUTPUT_LEN_V2;
}
// conf.periodic_timeout_ms = periodic_timeout_ms;
conf.periodic_timeout_ms = periodic_timeout_ms;
hwp_wr = new HWProxy_ns::HWProxy (host_dev,conf);
if (!hwp_wr)
......@@ -251,15 +251,19 @@ namespace CryoCooler_ns
DEBUG_STREAM << "CryoCoolerInterface::process_message (1) trying to set command request " << wi->byte_offset << std::endl;
if (hwp_wr)
{
// V2_COMMAND_REQUEST_BYTE = 0 in the DBR
// wi->byte_offset contains the command word as defined in the RI command table, e.g. OPEN_V9 BYTE B#16#6 , 0
// we have to write a short (write byte not possible in PLCServer device) as: 0xCMDW 0000
// soso
// V2_COMMAND_REQUEST_BYTE = 0 in the DBW
// wi->byte_offset contains the command word (2 bytes) as defined in the RI command table, e.g. OPEN_V9 BYTE B#16#6
// we have to write the 6 bytes (3 words) of the DBW all at once, e.g. 06 00 00 00 00 00
short cmd = wi->byte_offset;
cmd = cmd << 8;
// @SMI : à valider : écrire les 6 octets d'un seul coup ?
hwp_wr->write_short ("CryoCoolerInterface::process_message (1) trying to write INT value ", V2_COMMAND_REQUEST_BYTE, cmd);
// V2_COMMAND_VALUE_BYTE = 2 in the DBR. We write 0 in the next 4 bytes because no value to write for a command
hwp_wr->write_real ("CryoCoolerInterface::process_message (1) trying to write REAL value ", V2_COMMAND_VALUE_BYTE, 0.0);
short dbw[V2_COMMAND_REQUEST_DBW_SIZE];
dbw[0] = cmd;
dbw[1] = 0;
dbw[2] = 0;
hwp_wr->write_shorts ("CryoCoolerInterface::process_message (1) trying to write 6 BYTES", V2_COMMAND_REQUEST_BYTE,
V2_COMMAND_REQUEST_DBW_SIZE, &dbw[0]);
}
}
catch (...)
......@@ -288,15 +292,21 @@ namespace CryoCooler_ns
DEBUG_STREAM << "CryoCoolerInterface::process_message (1) trying to write REAL value " << wr->value << " for command request " << wr->byte_offset << std::endl;
if (hwp_wr)
{
// V2_COMMAND_REQUEST_BYTE = 0 in the DBR
// wi->byte_offset contains the command word as defined in the RI command table, e.g. SET_V11 BYTE B#16#11 , 45
// we have to write a short (write byte not possible in PLCServer device) as: 0xCMDW 0000
// soso
// V2_COMMAND_REQUEST_BYTE = 0 in the DBW
// wi->byte_offset contains the command word as defined in the RI command table, e.g. SET_V10 BYTE B#16#10
// we have to write the 6 bytes (3 words) of the DBW all at once, e.g. 10 00 42 50 00 00
short cmd = wr->byte_offset;
cmd = cmd << 8;
// @SMI : à valider : écrire les 6 octets d'un seul coup ?
hwp_wr->write_short ("CryoCoolerInterface::process_message (1) trying to write INT value ", V2_COMMAND_REQUEST_BYTE, cmd);
// V2_COMMAND_VALUE_BYTE = 2 in the DBR. We write the real value in the next 4 bytes
hwp_wr->write_real ("CryoCoolerInterface::process_message (1) trying to write REAL value ", V2_COMMAND_VALUE_BYTE, wr->value);
long * l = (long *) &wr->value;
short dbw[V2_COMMAND_REQUEST_DBW_SIZE];
dbw[0] = cmd;
dbw[1] = (short)(*l & 0x0000FFFF);
dbw[2] = (short)((*l & 0xFFFF0000) / 0x10000);
hwp_wr->write_shorts ("CryoCoolerInterface::process_message (1) trying to write 6 BYTES", V2_COMMAND_REQUEST_BYTE,
V2_COMMAND_REQUEST_DBW_SIZE, &dbw[0]);
}
}
catch (...)
......
......@@ -237,7 +237,7 @@ namespace CryoCooler_ns
// V2 protocol interface for commands (byte offsets)
//-----------------------------------------------------------------------------
const unsigned int V2_COMMAND_REQUEST_BYTE = 0;
const unsigned int V2_COMMAND_VALUE_BYTE = 2;
const unsigned int V2_COMMAND_REQUEST_DBW_SIZE = 3; // in words (3 x 2 bytes)
} //- namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment