Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • kacperklys/sis8300llrf
  • mateusznabywaniec/sis8300llrf
  • epics-modules/rf/sis8300llrf
3 results
Show changes
Commits on Source (2)
5.6.7
* Make the read back tables be updated if they are change when a new pulses
arrive
5.6.6 5.6.6
* Update control table parameters as soon they are changed * Update control table parameters as soon they are changed
......
...@@ -189,6 +189,7 @@ record(waveform, "$(P)$(R)$(CTRL_TABLE_TYPE)Tbl$(SM=)-I-RB") { ...@@ -189,6 +189,7 @@ record(waveform, "$(P)$(R)$(CTRL_TABLE_TYPE)Tbl$(SM=)-I-RB") {
field(NELM, "$(TABLE_SMNM_MAX)") field(NELM, "$(TABLE_SMNM_MAX)")
field(STAT, "NO_ALARM") field(STAT, "NO_ALARM")
field(SEVR, "NO_ALARM") field(SEVR, "NO_ALARM")
field(SCAN, "I/O Intr")
info(DESCRIPTION, "Get the I control table.") info(DESCRIPTION, "Get the I control table.")
info(SYSTEM, "LLRF") info(SYSTEM, "LLRF")
...@@ -202,6 +203,7 @@ record(waveform, "$(P)$(R)$(CTRL_TABLE_TYPE)Tbl$(SM=)-Q-RB") { ...@@ -202,6 +203,7 @@ record(waveform, "$(P)$(R)$(CTRL_TABLE_TYPE)Tbl$(SM=)-Q-RB") {
field(NELM, "$(TABLE_SMNM_MAX)") field(NELM, "$(TABLE_SMNM_MAX)")
field(STAT, "NO_ALARM") field(STAT, "NO_ALARM")
field(SEVR, "NO_ALARM") field(SEVR, "NO_ALARM")
field(SCAN, "I/O Intr")
info(DESCRIPTION, "Get the Q control table.") info(DESCRIPTION, "Get the Q control table.")
info(SYSTEM, "LLRF") info(SYSTEM, "LLRF")
......
...@@ -90,6 +90,7 @@ sis8300llrfControlTableChannel::sis8300llrfControlTableChannel() : ...@@ -90,6 +90,7 @@ sis8300llrfControlTableChannel::sis8300llrfControlTableChannel() :
_TableSpeed = 0; _TableSpeed = 0;
_ConstantEnable = 0; _ConstantEnable = 0;
_Initialized = 0; _Initialized = 0;
_TableChange = 0;
_writeTableLoopTaskRun = 1; _writeTableLoopTaskRun = 1;
std::string taskname = "writeTableLoopTask"; std::string taskname = "writeTableLoopTask";
...@@ -512,6 +513,8 @@ ndsStatus sis8300llrfControlTableChannel::writeTableLoopTask(nds::TaskServiceBas ...@@ -512,6 +513,8 @@ ndsStatus sis8300llrfControlTableChannel::writeTableLoopTask(nds::TaskServiceBas
//NDS_DBG("Perf to load table: %f\n", perf); //NDS_DBG("Perf to load table: %f\n", perf);
doCallbacksInt32(0, _interruptIdWriteTable); doCallbacksInt32(0, _interruptIdWriteTable);
_WriteTable = 0; _WriteTable = 0;
// let IOC know that the table changed, so the readback will be updated on next pulse
_TableChange = 1;
} }
usleep(10); usleep(10);
} }
...@@ -534,6 +537,48 @@ ndsStatus sis8300llrfControlTableChannel::writeToHardware(){ ...@@ -534,6 +537,48 @@ ndsStatus sis8300llrfControlTableChannel::writeToHardware(){
dynamic_cast<sis8300llrfControlTableChannelGroup*> dynamic_cast<sis8300llrfControlTableChannelGroup*>
(getChannelGroup()); (getChannelGroup());
//If the table changed reload the read back
if (_TableChange){
_TableChange = 0;
NDS_TRC("Reload tables readback");
//This temporary pointer is used to load the data from memory
epicsFloat64 *tmp = new epicsFloat64[_MaxSamplesCount];
/* I and Q tables are interleaved. We fetch them as on table with
* 32 bit ellements from the device and than read it as two 16 bit
* tables */
epicsInt16 *pInt16Buffer = (epicsInt16 *) tmp;
int iterSrc, iterDest;
if (getCurrentState() == nds::CHANNEL_STATE_IOC_INITIALIZATION) {
delete[] tmp;
return ndsError;
}
status = sis8300llrfdrv_get_ctrl_table_raw(
_DeviceUser, _CtrlTableType,
ROUNDUP_TWOHEX(_SamplesCount), (epicsInt32 *)tmp);
SIS8300NDS_STATUS_CHECK("sis8300llrfdrv_get_ctrl_table_raw", status);
epicsFloat64 *I = new epicsFloat64[_SamplesCount];
epicsFloat64 *Q = new epicsFloat64[_SamplesCount];
for(iterDest = 0, iterSrc = 0;
iterDest < _SamplesCount; iterDest++, iterSrc += 2) {
I[iterDest] =( (epicsFloat64) pInt16Buffer[iterSrc+SIS8300LLRFDRV_RAW_SAMPLE_I_OFFSET] )/ _FFSPConvFact;
Q[iterDest] =( (epicsFloat64) pInt16Buffer[iterSrc+SIS8300LLRFDRV_RAW_SAMPLE_Q_OFFSET] )/ _FFSPConvFact;
}
//push values to the PVs
doCallbacksFloat64Array(I, _SamplesCount, _interruptIdITable);
doCallbacksFloat64Array(Q, _SamplesCount, _interruptIdQTable);
delete[] tmp;
delete[] I;
delete[] Q;
}
if (_TableModeChange) { if (_TableModeChange) {
_TableModeChange = 0; _TableModeChange = 0;
......
...@@ -111,6 +111,8 @@ protected: ...@@ -111,6 +111,8 @@ protected:
int _WriteTable; /**< Parameter to trigger write int _WriteTable; /**< Parameter to trigger write
* of tables */ * of tables */
int _TableChange; /** < Parameter tracking Table
* change */
int _SamplesCountChange; /** < Parameter Tracking Samples int _SamplesCountChange; /** < Parameter Tracking Samples
* count changes */ * count changes */
int _TableModeChange; /** < Parameter tracking Table int _TableModeChange; /** < Parameter tracking Table
......