Skip to content

Commit

Permalink
More ConfigParaDesc, part 1
Browse files Browse the repository at this point in the history
Utilize the new script ethercatmcConfigParaDesc.iocsh in
st.mcu006-PTP-B02.iocsh

Change the opi to show the now renamed paramters.
Make the indexer pick up the new parameters.

Note: Some cleanup is needed - will be done in the next commit.

Changes to be committed:
    modified:   ethercatmcApp/src/ethercatmcIndexerV2.cpp
    modified:   ethercatmcExApp/op/Boy/ethercatmcaxisConfig-pils-ptp-Max-Red-Current-TimeEncoder.opi
    modified:   ethercatmcExApp/op/Boy/tools/Makefile
    new file:   ethercatmcExApp/op/Boy/tools/ethercatmcaxisConfigParaDesc.mid
    modified:   ethercatmcExApp/op/Boy/tools/genAxisConfigCutomPara.sh
    modified:   test/startup/st.mcu006-PTP-B02.iocsh
  • Loading branch information
tboegi committed Feb 3, 2025
1 parent 106caa0 commit d1652b4
Show file tree
Hide file tree
Showing 6 changed files with 465 additions and 20 deletions.
29 changes: 29 additions & 0 deletions ethercatmcApp/src/ethercatmcIndexerV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,35 @@ asynStatus ethercatmcController::indexerReadAxisParametersV2(
sizeof(pAxis->drvlocal.clean.customParaNames[0]) - 1;
strncpy(pDst, customParaName, dstLen);
}
if (paramIndex <= 210) {
/* real custom parameter
TODO: check for known names instead */
char asynParaName[34];
memset(asynParaName, 0, sizeof(asynParaName));
snprintf(&asynParaName[0], sizeof(asynParaName) - 1,
"para%d-val", paramIndex);
status = ethercatmcCreateParam(asynParaName, asynParamFloat64,
&function);
if (status == asynSuccess) {
pAxis->drvlocal.clean.functionFromParamIndex[paramIndex] =
function;
}
memset(asynParaName, 0, sizeof(asynParaName));
snprintf(&asynParaName[0], sizeof(asynParaName) - 1,
"para%d-name", paramIndex);
status = ethercatmcCreateParam(asynParaName, asynParamOctet,
&function);
asynPrint(pasynUserController_, ASYN_TRACE_INFO,
"%s%s(%u) created function=%d "
"paramIndex=%d asynParaName='%s' "
"asynParaNamestatus=%s (%d)\n",
modNamEMC, functionName, axisNo, function, paramIndex,
asynParaName, ethercatmcstrStatus(status),
(int)status);
if (status == asynSuccess) {
setStringParam(axisNo, function, customParaName);
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2527,13 +2527,13 @@ $(pv_value)</tooltip>
<minimum>-1.7976931348623157E308</minimum>
<multiline_input>false</multiline_input>
<name>Text Input</name>
<precision>0</precision>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgTimCompModEncoder</pv_name>
<pv_name>$(P)$(M)-para195-val</pv_name>
<pv_value />
<rotation_angle>0.0</rotation_angle>
<rules>
<rule name="CfgTimCompModEncoder-Visible" prop_id="visible" out_exp="false">
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0!=0">
<value>false</value>
</exp>
Expand Down Expand Up @@ -2594,13 +2594,13 @@ $(pv_value)</tooltip>
<name>Text Input Template_30</name>
<next_focus>0</next_focus>
<password_input>false</password_input>
<precision>0</precision>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgTimCompModEncoder</pv_name>
<pv_name>$(P)$(M)-para195-val</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
<rule name="CfgTimCompModEncoder-Visible" prop_id="visible" out_exp="false">
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0==0">
<value>false</value>
</exp>
Expand Down Expand Up @@ -2662,7 +2662,7 @@ $(pv_value)</tooltip>
<password_input>false</password_input>
<precision>0</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgTimCompModEncoder.DESC</pv_name>
<pv_name>$(P)$(M)-para195-name</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
Expand Down Expand Up @@ -2717,13 +2717,13 @@ $(pv_value)</tooltip>
<minimum>-1.7976931348623157E308</minimum>
<multiline_input>false</multiline_input>
<name>Text Input</name>
<precision>0</precision>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgAddEncoderDelay</pv_name>
<pv_name>$(P)$(M)-para196-val</pv_name>
<pv_value />
<rotation_angle>0.0</rotation_angle>
<rules>
<rule name="CfgAddEncoderDelay-Visible" prop_id="visible" out_exp="false">
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0!=0">
<value>false</value>
</exp>
Expand Down Expand Up @@ -2784,13 +2784,13 @@ $(pv_value)</tooltip>
<name>Text Input Template_30</name>
<next_focus>0</next_focus>
<password_input>false</password_input>
<precision>0</precision>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgAddEncoderDelay</pv_name>
<pv_name>$(P)$(M)-para196-val</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
<rule name="CfgAddEncoderDelay-Visible" prop_id="visible" out_exp="false">
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0==0">
<value>false</value>
</exp>
Expand Down Expand Up @@ -2852,7 +2852,7 @@ $(pv_value)</tooltip>
<password_input>false</password_input>
<precision>0</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-CfgAddEncoderDelay.DESC</pv_name>
<pv_name>$(P)$(M)-para196-name</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
Expand All @@ -2876,4 +2876,194 @@ $(pv_value)</tooltip>
<x>140</x>
<y>480</y>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.TextInput" version="2.0.0">
<actions hook="false" hook_all="false" />
<alarm_pulsing>false</alarm_pulsing>
<auto_size>false</auto_size>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<background_color>
<color name="ioc_write_bg" red="115" green="223" blue="255" />
</background_color>
<border_alarm_sensitive>true</border_alarm_sensitive>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<border_style>3</border_style>
<border_width>1</border_width>
<confirm_message></confirm_message>
<enabled>true</enabled>
<font>
<fontdata fontName="Sans" height="15" style="0" pixels="false" />
</font>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<foreground_color>
<color name="Gray_14" red="0" green="0" blue="0" />
</foreground_color>
<format_type>1</format_type>
<height>25</height>
<horizontal_alignment>0</horizontal_alignment>
<limits_from_pv>false</limits_from_pv>
<maximum>1.7976931348623157E308</maximum>
<minimum>-1.7976931348623157E308</minimum>
<multiline_input>false</multiline_input>
<name>Text Input</name>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-para197-val</pv_name>
<pv_value />
<rotation_angle>0.0</rotation_angle>
<rules>
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0!=0">
<value>false</value>
</exp>
<exp bool_exp="pv0==0">
<value>true</value>
</exp>
<pv trig="true">$(P)$(M).CNEN</pv>
</rule>
</rules>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<scripts />
<selector_type>0</selector_type>
<show_units>false</show_units>
<style>0</style>
<text></text>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<transparent>false</transparent>
<visible>true</visible>
<widget_type>Text Input</widget_type>
<width>127</width>
<wuid>-68918818:158524ceeb4:-75bd</wuid>
<x>12</x>
<y>501</y>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.TextInput" version="2.0.0">
<actions hook="false" hook_all="false" />
<alarm_pulsing>false</alarm_pulsing>
<auto_size>false</auto_size>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<background_color>
<color name="IO OutputPV Bg" red="255" green="255" blue="255" />
</background_color>
<border_alarm_sensitive>true</border_alarm_sensitive>
<border_color>
<color name="IO Border" red="215" green="215" blue="215" />
</border_color>
<border_style>1</border_style>
<border_width>2</border_width>
<confirm_message></confirm_message>
<enabled>true</enabled>
<font>
<opifont.name fontName="arial" height="10" style="1" pixels="false">IO Output 1</opifont.name>
</font>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<foreground_color>
<color red="26" green="26" blue="26" />
</foreground_color>
<format_type>1</format_type>
<height>25</height>
<horizontal_alignment>2</horizontal_alignment>
<limits_from_pv>true</limits_from_pv>
<multiline_input>false</multiline_input>
<name>Text Input Template_30</name>
<next_focus>0</next_focus>
<password_input>false</password_input>
<precision>3</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-para197-val</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
<rule name="CfgXXYYZZ-Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0==0">
<value>false</value>
</exp>
<exp bool_exp="pv0!=0">
<value>true</value>
</exp>
<pv trig="true">$(P)$(M).CNEN</pv>
</rule>
</rules>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<scripts />
<show_native_border>true</show_native_border>
<show_units>false</show_units>
<style>1</style>
<text>######</text>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<visible>true</visible>
<widget_type>Text Input</widget_type>
<width>127</width>
<wuid>-6d2c06df:15c1f4b8e4e:-7d0a</wuid>
<x>12</x>
<y>501</y>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.TextInput" version="2.0.0">
<actions hook="false" hook_all="false" />
<alarm_pulsing>false</alarm_pulsing>
<auto_size>false</auto_size>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<background_color>
<color red="255" green="255" blue="255" />
</background_color>
<border_alarm_sensitive>false</border_alarm_sensitive>
<border_color>
<color name="IO Border" red="215" green="215" blue="215" />
</border_color>
<border_style>6</border_style>
<border_width>2</border_width>
<confirm_message></confirm_message>
<enabled>true</enabled>
<font>
<opifont.name fontName="arial" height="10" style="1" pixels="false">IO Output 1</opifont.name>
</font>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<foreground_color>
<color red="26" green="26" blue="26" />
</foreground_color>
<format_type>1</format_type>
<height>25</height>
<horizontal_alignment>0</horizontal_alignment>
<limits_from_pv>true</limits_from_pv>
<multiline_input>false</multiline_input>
<name>Text Input Template_29</name>
<next_focus>0</next_focus>
<password_input>false</password_input>
<precision>0</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(P)$(M)-para197-name</pv_name>
<pv_value />
<read_only>false</read_only>
<rules>
</rules>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<scripts />
<show_native_border>true</show_native_border>
<show_units>false</show_units>
<style>1</style>
<text>#####</text>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<visible>true</visible>
<widget_type>Text Input</widget_type>
<width>200</width>
<wuid>1d681a25:1522fd92503:-6475</wuid>
<x>140</x>
<y>500</y>
</widget>
</display>
3 changes: 2 additions & 1 deletion ethercatmcExApp/op/Boy/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ DEPENDENCIES_FOR_CONFIG_PILS_OPI = \
ethercatmcaxisConfig.start \
ethercatmcaxisConfig-pils.mid \
ethercatmcaxisConfigCustomPara.mid \
ethercatmcaxisConfigParaDesc.mid \
ethercatmcaxisConfig.end


Expand Down Expand Up @@ -291,7 +292,7 @@ PIEZO_PSTAT_NAMES += "BRAKE_ENABLED"
./genAxisConfigCutomPara.sh $@

../ethercatmcaxisConfig-pils-ptp-Max-Red-Current-TimeEncoder.opi: $(DEPENDENCIES_FOR_CONFIG_PILS_OPI) Makefile genAxisConfigCutomPara.sh
./genAxisConfigCutomPara.sh $@ CfgMoveCurrent CfgIdleCurrent CfgTimCompModEncoder CfgAddEncoderDelay
./genAxisConfigCutomPara.sh $@ CfgMoveCurrent CfgIdleCurrent para195 para196 para197

#ethercatmcaxisConfig-pils.opi
#ethercatmcaxisConfig-pils-ptp-Max-Red-Current-TimeEncoder.opi
Expand Down
Loading

0 comments on commit d1652b4

Please sign in to comment.