Giter VIP home page Giter VIP logo

sscan's Introduction

sscan's People

Contributors

anjohnson avatar baldwinb avatar dirk-zimoch avatar dohnarms avatar gebhardt avatar hanak avatar jlmuir avatar justincslac avatar keenanlang avatar kmpeters avatar markrivers avatar mdavidsaver avatar prjemian avatar rsluiter avatar timmmooney avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sscan's Issues

saveData fails when saving to a NetApp appliance from a VxWorks IOC

VxWorks 6.9.4.1 only supports NFSv3 over UDP. NetApp appliances are only optimized for NFSv3 over TCP. A single VME doing a multidimensional scan is sufficient to overwhelm the single task handling UDP running in the "Legacy Domain" on the NetApp appliance.

Good periods where there are no problems saving data alternate with bad periods where every attempt to save data is abandoned. The call that fails during the bad periods is fseek in writeXDR_setpos in writeXDR.c:

return ((fseek(fd, pos, 0) < 0) ? 0 : 1);

The call to fseek fails, returning -1. errno is 3080197 (in decimal) and strerror(errno) is S_rpcLib_RPC_TIMEDOUT

sscan fails to build for win32-x86 against base-3.15.4

I'm using the following:

Windows 7 (64-bit)
Visual Studio 2010 Professional & Visual Studio 2015 Community Edition
Make 4.1 (from the EPICS web site)
Strawberry perl 5.20.3001

The sscan trunk (edd43ed) successfully builds against the released version of base-3.14.12.5 and fails to build against the released version of base-3.15.4 using both VS2010 and VS2015:

link -nologo /subsystem:windows /dll -LTCG -incremental:no -opt:ref -release       -out:sscan.dll -implib:sscan.lib        sscanRecord.obj scanparmRecord.obj re
cDynLink.obj req_file.obj saveData_writeXDR.obj writeXDR.obj      D:/synApps-testing/VS15/3.15/base-3.15.4/lib/win32-x86/dbRecStd.lib  D:/synApps-testing/VS15/3
.15/base-3.15.4/lib/win32-x86/dbCore.lib  D:/synApps-testing/VS15/3.15/base-3.15.4/lib/win32-x86/ca.lib  D:/synApps-testing/VS15/3.15/base-3.15.4/lib/win32-x86/
Com.lib
   Creating library sscan.lib and object sscan.exp
recDynLink.obj : error LNK2001: unresolved external symbol __imp__dbNameToAddr@8
sscan.dll : fatal error LNK1120: 1 unresolved externals
D:/synApps-testing/VS15/3.15/base-3.15.4/configure/RULES_BUILD:281: recipe for target 'sscan.dll' failed
make[4]: *** [sscan.dll] Error 1120
make[4]: Leaving directory 'D:/synApps-testing/VS15/3.15/synApps/support/sscan/sscanApp/src/O.win32-x86'
D:/synApps-testing/VS15/3.15/base-3.15.4/configure/RULES_ARCHS:61: recipe for target 'install.win32-x86' failed
make[3]: *** [install.win32-x86] Error 2
make[3]: Leaving directory 'D:/synApps-testing/VS15/3.15/synApps/support/sscan/sscanApp/src'
D:/synApps-testing/VS15/3.15/base-3.15.4/configure/RULES_DIRS:88: recipe for target 'src.install' failed
make[2]: *** [src.install] Error 2
make[2]: Leaving directory 'D:/synApps-testing/VS15/3.15/synApps/support/sscan/sscanApp'
D:/synApps-testing/VS15/3.15/base-3.15.4/configure/RULES_DIRS:88: recipe for target 'sscanApp.install' failed
make[1]: *** [sscanApp.install] Error 2
make[1]: Leaving directory 'D:/synApps-testing/VS15/3.15/synApps/support/sscan'
D:/synApps-testing/VS15/3.15/base-3.15.4/configure/RULES_DIRS:88: recipe for target 'D:/synApps-testing/VS15/3.15/synApps/support/sscan.install' failed
make: *** [D:/synApps-testing/VS15/3.15/synApps/support/sscan.install] Error 2

The latest version of the sequencer (2.2.3) is used.

Line endings for sscanApp/Db/scanProgress.db and sscanApp/src/scanProg.st

If I crate a branch on forked repo and try to checkout the branch afterwards I get these error messages:

error: Your local changes to the following files would be overwritten by checkout:
	sscanApp/Db/scanProgress.db
	sscanApp/src/scanProg.st
Please, commit your changes or stash them before you can switch branches.
Aborting

It turns out that the line endings want to be different on my Linux system.

warning: CRLF will be replaced by LF in sscanApp/Db/scanProgress.db.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in sscanApp/src/scanProg.st.
The file will have its original line endings in your working directory.

It does not happen with any other epics-modules/.

Would maintainer consider fixing the two files in question?

Cannot build on Windows 10 with VS Code against EPICS V 7.0.4.1

I am trying to build sscan on a windows 10 machine using VS Code Compilers. I followed instructions here https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation-windows-plain.html to install:

  • EPICS base 7.0.4.1
  • asyn
  • autosave
  • alive
  • seq

If I try to build sscan I get the following error:

make[3]: *** No rule to make target 'scanProg.obj', needed by 'scanProgress.dll'.  Stop.
make[3]: Leaving directory 'C:/Users/sissy_user/epics/support/sscan/2-11-4/sscanApp/src/O.windows-x64'
make[2]: *** [C:\Users\sissy_user\epics\base-7.0.4.1\base-R7.0.4.1/configure/RULES_ARCHS:58: install.windows-x64] Error 2
make[2]: Leaving directory 'C:/Users/sissy_user/epics/support/sscan/2-11-4/sscanApp/src'
make[1]: *** [C:\Users\sissy_user\epics\base-7.0.4.1\base-R7.0.4.1/configure/RULES_DIRS:85: src.install] Error 2
make[1]: Leaving directory 'C:/Users/sissy_user/epics/support/sscan/2-11-4/sscanApp'
make: *** [C:\Users\sissy_user\epics\base-7.0.4.1\base-R7.0.4.1/configure/RULES_DIRS:85: sscanApp.install] Error 2

This thread on techtalk made me think it was probably to do with not getting somthing from the build of the sequencer support module. I have checked that the build succeeded for seq, and done a make clean uninstall before typing make to ensure that any changes to configure/RELEASE were picked up.

Any ideas? let me know if I can provide any more information to help diagnose the problem

Misdetecting LO_LIMIT/HI_LIMIT conditions

Hello all,
Recently, we've had a sscan record fail to execute complaining about the positioner limits (i.e., P0_ Value < LO_LIMIT @ point0). After some debugging, we have realized that the problem was on how LO_LIMIT and HI_LIMITs were determined for motors.

Particularly, from what I understand (and I could very well be wrong), if DHLM == DLLM == 0, the software limits are disabled (in the motor record) and the motor can move as long as it is within the hardware limits. The problem arises if we use the user fields as our positioner (VAL and RBV), because HLM = DHLM + OFF (or DLLM + OFF if DIR=-1) and LLM = DLLM + OFF (or DHLM + OFF for DIR=-1). But since the sscan record uses the upper_dist_limit/lower_dist_limit, which are obtained here, these limits are not read as 0 and the check fails (this check in particular).

We have worked around the issue by setting DHLM (and DLLM) to a very large range (-9999 and 9999), so that this is never triggered. But I wonder if there is a way we could improve upon it. The first question is if we could forego the check altogether, so that the positioner PV itself would limit the range. Alternatively, the check could be changed to be if (pPos>p_lr != pPos>p_hr), although in this case, it is possible someone has set the limits to the same location to block the motor into a fixed position (nevertheless, the positioner PV would still block itself from being set outside the desired limits). Finally, the message could remain the same, but the error be changed into a warning, so the scan would still run, but the user could be alerted of the "misconfiguration" (?).

My main concern is that if this check was to be changed, the current functionality would also be changed, so an upgrade could cause major issues (for IOCs relying on the current behavior). But I wanted to open up the discussion in case others also encountered the same issue.

Warnings while compiling the code

Warnings while compiling the code

Steps to reproduce

  1. make (-Wstringop-truncation -Wformat=)

Expected behaviour
No warnings

Actual behaviour
The compilation reports warnings about potential string truncation and overflow. One formatting warning was reported too.
warn.txt

Build Environment
Architecture: linux-x86_64, RTEMS-beatnik, RTEMS-mvme2307, RTEMS-mvme3100
Epics Base Version: EPICS 7
Dependent Module Versions: sequencer 2-2-9

Does not compile for vxWorks 5.5

In saveData_writeXDR.c line 3561 a variable is declared after code. The vxWorks 5.5 C compiler does not accept this.

{
		/* extract the host name */
		cout= hostname;
		int i = 0;
[...]
}

See pull requerst #16

error: unknown type name ‘READONLY’

I get the following error when building sscan-R2-11-4 against base-7.0.6:

make[3]: Entering directory '/scratch/synApps_2_1/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64'
/usr/bin/gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE         -DUSE_TYPED_RSET   -D_X86_64_  -DUNIX  -Dlinux      -O3 -g   -Wall -Werror-implicit-function-declaration      -mtune=generic      -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include      -I/scratch/synApps_2_1/support/seq-2-2-9/include -I/scratch/base-7.0.6/include/compiler/gcc -I/scratch/base-7.0.6/include/os/Linux -I/scratch/base-7.0.6/include        -c ../saveData_writeXDR.c
../saveData_writeXDR.c: In function ‘extraValCallback’:
../saveData_writeXDR.c:1841:2: error: unknown type name ‘READONLY’
 1841 |  READONLY DBR_VAL * pval = eha.dbr;
      |  ^~~~~~~~
../saveData_writeXDR.c:1841:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
 1841 |  READONLY DBR_VAL * pval = eha.dbr;
      |                   ^
../saveData_writeXDR.c:1850:23: error: ‘pval’ undeclared (first use in this function)
 1850 |   size= strlen((char*)pval);
      |                       ^~~~
../saveData_writeXDR.c:1850:23: note: each undeclared identifier is reported only once for each function it appears in
../saveData_writeXDR.c: In function ‘extraDescCallback’:
../saveData_writeXDR.c:1888:2: error: unknown type name ‘READONLY’
 1888 |  READONLY DBR_VAL * pval = eha.dbr;
      |  ^~~~~~~~
../saveData_writeXDR.c:1888:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
 1888 |  READONLY DBR_VAL * pval = eha.dbr;
      |                   ^
../saveData_writeXDR.c:1892:31: error: ‘pval’ undeclared (first use in this function)
 1892 |  strncpy(pnode->desc, (char *)pval, MAX_STRING_SIZE);
      |                               ^~~~
make[3]: *** [/scratch/base-7.0.6/configure/RULES_BUILD:259: saveData_writeXDR.o] Error 1
make[3]: Leaving directory '/scratch/synApps_2_1/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64'
make[2]: *** [/scratch/base-7.0.6/configure/RULES_ARCHS:58: install.linux-x86_64] Error 2
make[2]: Leaving directory '/scratch/synApps_2_1/support/sscan-R2-11-4/sscanApp/src'
make[1]: *** [/scratch/base-7.0.6/configure/RULES_DIRS:85: src.install] Error 2
make[1]: Leaving directory '/scratch/synApps_2_1/support/sscan-R2-11-4/sscanApp'
make: *** [/scratch/base-7.0.6/configure/RULES_DIRS:85: sscanApp.install] Error 2

Adding shareLib.h to saveData_writeXDR.c eliminates the build error:

sscan-R2-11-4$ git diff sscanApp/src/saveData_writeXDR.c
diff --git a/sscanApp/src/saveData_writeXDR.c b/sscanApp/src/saveData_writeXDR.c
index 24ba3df..a98c284 100644
--- a/sscanApp/src/saveData_writeXDR.c
+++ b/sscanApp/src/saveData_writeXDR.c
@@ -208,6 +208,7 @@
 #include <dbDefs.h>         /* for PVNAME_STRINGSZ */
 #include <epicsTypes.h>     /* for MAX_STRING_SIZE */
 #include <epicsStdio.h>                /* for epicsSnprintf() */
+#include <shareLib.h>          /* for READONLY */
 
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #define MIN(a,b) ((a)<(b)?(a):(b))

Does not compile for Debian 10, Centos 7, and Raspbian

Dear all,

I tried to compile Synchrotron applications downloaded via the scripts "assemble_synApps.sh" from this repo, but the compilation failed on "saveData_writeXDR.c" on all three operating systems mentioned above. The following are the errors I got.

Debian 10

make[1]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4'
make -C ./configure install
make[2]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure'
make -C O.linux-x86_64 -f ../Makefile TOP=../..
T_A=linux-x86_64 install
make[3]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure/O.linux-x86_64'
perl -CSD /opt/epics/R70.5/base/bin/linux-x86_64/convertRelease.pl checkRelease
make[3]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure/O.linux-x86_64'
make[2]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure'
make -C ./sscanApp install
make[2]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp'
make -C ./src install
make[3]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src'
make -C O.linux-x86_64 -f ../Makefile TOP=../../..
T_A=linux-x86_64 install
make[4]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64'
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -D_X86_64_ -DUNIX -Dlinux -O3 -g -Wall -Werror-implicit-function-declaration -mtune=generic -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/base/include/compiler/gcc -I/opt/epics/R70.5/base/include/os/Linux -I/opt/epics/R70.5/base/include -c ../saveData_writeXDR.c
../saveData_writeXDR.c: In function ‘extraValCallback’:
../saveData_writeXDR.c:1841:2: error: unknown type name ‘READONLY’; did you mean ‘O_RDONLY’?
READONLY DBR_VAL * pval = eha.dbr;
^~~~~~~~
O_RDONLY
../saveData_writeXDR.c:1841:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1850:23: error: ‘pval’ undeclared (first use in this function)
size= strlen((char
)pval);
^~~~
../saveData_writeXDR.c:1850:23: note: each undeclared identifier is reported only once for each function it appears in
../saveData_writeXDR.c: In function ‘extraDescCallback’:
../saveData_writeXDR.c:1888:2: error: unknown type name ‘READONLY’; did you mean ‘O_RDONLY’?
READONLY DBR_VAL * pval = eha.dbr;
^~~~~~~~
O_RDONLY
../saveData_writeXDR.c:1888:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘*’ token
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1892:31: error: ‘pval’ undeclared (first use in this function)
strncpy(pnode->desc, (char *)pval, MAX_STRING_SIZE);
^~~~
make[4]: *** [/opt/epics/R70.5/base/configure/RULES_BUILD:259: saveData_writeXDR.o] Error 1
make[4]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64'
make[3]: *** [/opt/epics/R70.5/base/configure/RULES_ARCHS:58: install.linux-x86_64] Error 2
make[3]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src'
make[2]: *** [/opt/epics/R70.5/base/configure/RULES_DIRS:85: src.install] Error 2
make[2]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp'
make[1]: *** [/opt/epics/R70.5/base/configure/RULES_DIRS:85: sscanApp.install] Error 2
make[1]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4'
make: *** [/opt/epics/R70.5/base/configure/RULES_DIRS:85: /opt/epics/R70.5/synApps/support/sscan-R2-11-4.install] Error 2

Centos 7

make[1]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4' make -C ./configure install make[2]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/configure'
make -C O.linux-x86_64 -f ../Makefile TOP=../..
T_A=linux-x86_64 install
make[3]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/configure/O.linux-x86_64' perl -CSD /home/wucheng/EPICS/epics-base/bin/linux-x86_64/convertRelease.pl checkRelease make[3]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/configure/O.linux-x86_64'
make[2]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/configure' make -C ./sscanApp install make[2]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp'
make -C ./src install
make[3]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp/src' make -C O.linux-x86_64 -f ../Makefile TOP=../../.. \ T_A=linux-x86_64 install make[4]: Entering directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64'
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -D_X86_64_ -DUNIX -Dlinux -O3 -g -Wall -Werror-implicit-function-declaration -mtune=generic -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/home/wucheng/EPICS/synApps/support/seq-2-2-8/include -I/home/wucheng/EPICS/epics-base/include/compiler/gcc -I/home/wucheng/EPICS/epics-base/include/os/Linux -I/home/wucheng/EPICS/epics-base/include -c ../saveData_writeXDR.c
../saveData_writeXDR.c: In function ‘extraValCallback’:
../saveData_writeXDR.c:1841:2: error: unknown type name ‘READONLY’
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1841:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1850:23: error: ‘pval’ undeclared (first use in this function)
size= strlen((char
)pval);
^
../saveData_writeXDR.c:1850:23: note: each undeclared identifier is reported only once for each function it appears in
../saveData_writeXDR.c: In function ‘extraDescCallback’:
../saveData_writeXDR.c:1888:2: error: unknown type name ‘READONLY’
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1888:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘*’ token
READONLY DBR_VAL * pval = eha.dbr;
^
In file included from /usr/include/string.h:633:0,
from ../saveData_writeXDR.c:196:
../saveData_writeXDR.c:1892:31: error: ‘pval’ undeclared (first use in this function)
strncpy(pnode->desc, (char *)pval, MAX_STRING_SIZE);
^
make[4]: *** [saveData_writeXDR.o] Error 1
make[4]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-x86_64' make[3]: *** [install.linux-x86_64] Error 2 make[3]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp/src'
make[2]: *** [src.install] Error 2
make[2]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4/sscanApp' make[1]: *** [sscanApp.install] Error 2 make[1]: Leaving directory /home/wucheng/EPICS/synApps/support/sscan-R2-11-4'
make: *** [/home/wucheng/EPICS/synApps/support/sscan-R2-11-4.install] Error 2

Raspian

make[1]: Leaving directory '/opt/epics/R70.5/synApps/support/busy-R1-7-3'
make -C /opt/epics/R70.5/synApps/support/sscan-R2-11-4 install
make[1]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4'
make -C ./configure install
make[2]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure'
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/makeMakefile.pl O.linux-arm ../..
mkdir -p O.Common
make -C O.linux-arm -f ../Makefile TOP=../..
T_A=linux-arm install
make[3]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure/O.linux-arm'
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/convertRelease.pl checkRelease
make[3]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure/O.linux-arm'
make[2]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/configure'
make -C ./sscanApp install
make[2]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp'
make -C ./src install
make[3]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src'
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/makeMakefile.pl O.linux-arm ../../..
mkdir -p O.Common
make -C O.linux-arm -f ../Makefile TOP=../../..
T_A=linux-arm install
make[4]: Entering directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-arm'
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/dbdToRecordtypeH.pl -I. -I.. -I../O.Common -I../../../dbd -I/opt/epics/R70.5/synApps/support/seq-2-2-8/dbd -I/opt/epics/R70.5/epics-base/dbd -o scanparmRecord.h ../scanparmRecord.dbd
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/dbdToRecordtypeH.pl -I. -I.. -I../O.Common -I../../../dbd -I/opt/epics/R70.5/synApps/support/seq-2-2-8/dbd -I/opt/epics/R70.5/epics-base/dbd -o sscanRecord.h ../sscanRecord.dbd
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/dbdToMenuH.pl -I. -I.. -I../O.Common -I../../../dbd -I/opt/epics/R70.5/synApps/support/seq-2-2-8/dbd -I/opt/epics/R70.5/epics-base/dbd -o menuSscan.h ../menuSscan.dbd
preprocessing ../scanProg.st
/usr/bin/gcc -x c -E -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include ../scanProg.st > scanProg.i
compiling scanProg.i to C
/opt/epics/R70.5/synApps/support/seq-2-2-8/bin/linux-arm/snc scanProg.i -o scanProg.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF scanProg.d scanProg.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF writeXDR.d ../writeXDR.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF saveData_writeXDR.d ../saveData_writeXDR.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF req_file.d ../req_file.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF recDynLink.d ../recDynLink.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF scanparmRecord.d ../scanparmRecord.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -MM -MF sscanRecord.d ../sscanRecord.c
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/mkmf.pl -m scanProg.st.d . ../compiler/gcc ../compiler/default . ../os/Linux ../os/posix ../os/default .. scanProg.i ../scanProg.st
Installing generic include file ../../../include/recDynLink.h
mkdir ../../../include
Installing generated generic include file ../../../include/scanparmRecord.h
Installing generated generic include file ../../../include/sscanRecord.h
Installing generated generic include file ../../../include/menuSscan.h
Expanding dbd file ../sscanInclude.dbd
perl -CSD /opt/epics/R70.5/epics-base/bin/linux-arm/dbdExpand.pl -I. -I.. -I../O.Common -I../../../dbd -I/opt/epics/R70.5/synApps/support/seq-2-2-8/dbd -I/opt/epics/R70.5/epics-base/dbd -o sscan.dbd ../sscanInclude.dbd
Installing created dbd file ../../../dbd/sscan.dbd
mkdir ../../../dbd
Installing dbd file ../../../dbd/sscanSupport.dbd
Installing dbd file ../../../dbd/sscanProgressSupport.dbd
Installing dbd file ../../../dbd/menuSscan.dbd
Installing dbd file ../../../dbd/scanparmRecord.dbd
Installing dbd file ../../../dbd/sscanRecord.dbd
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -c ../sscanRecord.c
../sscanRecord.c: In function ‘get_units’:
../sscanRecord.c:2039:4: warning: ‘strncpy’ output may be truncated copying 7 bytes from a string of length 15 [-Wstringop-truncation]
strncpy(units, pPos[i].p_eu, 7);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sscanRecord.c: In function ‘process’:
../sscanRecord.c:1080:58: warning: ‘%1d’ directive writing between 1 and 6 bytes into a region of size between 3 and 13 [-Wformat-overflow=]
sprintf(psscan->smsg, "Already busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~
../sscanRecord.c:1080:26: note: directive argument in the range [-32768, 32767]
sprintf(psscan->smsg, "Already busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sscanRecord.c:1080:26: note: directive argument in the range [-32768, 32767]
../sscanRecord.c:1080:26: note: using the range [0, 4294967295] for directive argument
../sscanRecord.c:1080:4: note: ‘sprintf’ output between 40 and 66 bytes into a destination of size 40
sprintf(psscan->smsg, "Already busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
numTrigCb, numAReadCb, numGetCb, precPvt->calledBy);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sscanRecord.c:1092:56: warning: ‘%1d’ directive writing between 1 and 6 bytes into a region of size between 5 and 15 [-Wformat-overflow=]
sprintf(psscan->smsg, "Still busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~
../sscanRecord.c:1092:26: note: directive argument in the range [-32768, 32767]
sprintf(psscan->smsg, "Still busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sscanRecord.c:1092:26: note: directive argument in the range [-32768, 32767]
../sscanRecord.c:1092:26: note: using the range [0, 4294967295] for directive argument
../sscanRecord.c:1092:4: note: ‘sprintf’ output between 38 and 64 bytes into a destination of size 40
sprintf(psscan->smsg, "Still busy! PTAG_CBs=%1d_%1d_%1d_%02d; CB=0x%x", numPosCb,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
numTrigCb, numAReadCb, numGetCb, precPvt->calledBy);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -c ../scanparmRecord.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -c ../recDynLink.c
../recDynLink.c: In function ‘recDynLinkGetUnits’:
../recDynLink.c:433:2: warning: ‘strncpy’ output may be truncated copying between 0 and 7 bytes from a string of length 7 [-Wstringop-truncation]
strncpy(units,pdynLinkPvt->units,maxToCopy);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -c ../req_file.c
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUSE_TYPED_RSET -DUNIX -Dlinux -O3 -Wall -Werror-implicit-function-declaration -D_FILE_OFFSET_BITS=64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/opt/epics/R70.5/synApps/support/seq-2-2-8/include -I/opt/epics/R70.5/epics-base/include/compiler/gcc -I/opt/epics/R70.5/epics-base/include/os/Linux -I/opt/epics/R70.5/epics-base/include -c ../saveData_writeXDR.c
../saveData_writeXDR.c: In function ‘extraValCallback’:
../saveData_writeXDR.c:1841:2: error: unknown type name ‘READONLY’; did you mean ‘O_RDONLY’?
READONLY DBR_VAL * pval = eha.dbr;
^~~~~~~~
O_RDONLY
../saveData_writeXDR.c:1841:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1850:23: error: ‘pval’ undeclared (first use in this function)
size= strlen((char
)pval);
^~~~
../saveData_writeXDR.c:1850:23: note: each undeclared identifier is reported only once for each function it appears in
../saveData_writeXDR.c: In function ‘extraDescCallback’:
../saveData_writeXDR.c:1888:2: error: unknown type name ‘READONLY’; did you mean ‘O_RDONLY’?
READONLY DBR_VAL * pval = eha.dbr;
^~~~~~~~
O_RDONLY
../saveData_writeXDR.c:1888:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘*’ token
READONLY DBR_VAL * pval = eha.dbr;
^
../saveData_writeXDR.c:1892:31: error: ‘pval’ undeclared (first use in this function)
strncpy(pnode->desc, (char *)pval, MAX_STRING_SIZE);
^~~~
make[4]: *** [/opt/epics/R70.5/epics-base/configure/RULES_BUILD:259: saveData_writeXDR.o] Error 1
make[4]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src/O.linux-arm'
make[3]: *** [/opt/epics/R70.5/epics-base/configure/RULES_ARCHS:58: install.linux-arm] Error 2
make[3]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp/src'
make[2]: *** [/opt/epics/R70.5/epics-base/configure/RULES_DIRS:85: src.install] Error 2
make[2]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4/sscanApp'
make[1]: *** [/opt/epics/R70.5/epics-base/configure/RULES_DIRS:85: sscanApp.install] Error 2
make[1]: Leaving directory '/opt/epics/R70.5/synApps/support/sscan-R2-11-4'
make: *** [/opt/epics/R70.5/epics-base/configure/RULES_DIRS:85: /opt/epics/R70.5/synApps/support/sscan-R2-11-4.install] Error 2

READONLY definitions EPICS 7

Hi, had to change READONLY to const to get it building with EPICS 7

diff --git a/sscanApp/src/saveData.c b/sscanApp/src/saveData.c
index 12a6845..66526b7 100644
--- a/sscanApp/src/saveData.c
+++ b/sscanApp/src/saveData.c
@@ -1844,7 +1844,7 @@ LOCAL void extraValCallback(struct event_handler_args eha)
PV_NODE * pnode = eha.usr;
long type = eha.type;
long count = eha.count;

  •   READONLY DBR_VAL * pval = eha.dbr;
    
  •   const DBR_VAL * pval = eha.dbr;
      char *string;
    
      size_t size=0;
    

@@ -1891,7 +1891,7 @@ LOCAL void extraValCallback(struct event_handler_args eha)
LOCAL void extraDescCallback(struct event_handler_args eha)
{
PV_NODE * pnode = eha.usr;

  •   READONLY DBR_VAL * pval = eha.dbr;
    
  •   const DBR_VAL * pval = eha.dbr;
    
      epicsMutexLock(pnode->lock);
    

diff --git a/sscanApp/src/saveData_writeXDR.c b/sscanApp/src/saveData_writeXDR.c
index 24ba3df..8fff761 100644
--- a/sscanApp/src/saveData_writeXDR.c
+++ b/sscanApp/src/saveData_writeXDR.c
@@ -1838,7 +1838,7 @@ LOCAL void extraValCallback(struct event_handler_args eha)
PV_NODE * pnode = eha.usr;
long type = eha.type;
long count = eha.count;

  •   READONLY DBR_VAL * pval = eha.dbr;
    
  •   const DBR_VAL * pval = eha.dbr;
      char *string;
    
      size_t size=0;
    

@@ -1885,7 +1885,7 @@ LOCAL void extraValCallback(struct event_handler_args eha)
LOCAL void extraDescCallback(struct event_handler_args eha)
{
PV_NODE * pnode = eha.usr;

  •   READONLY DBR_VAL * pval = eha.dbr;
    
  •   const DBR_VAL * pval = eha.dbr;
    
      epicsMutexLock(pnode->lock);
    

saveData's subdirectory-existence check fails on Windows

saveData_writeXDR.c's proc_file_subdir function appends a directory separator, "/", before checking for the existence of the specified subdirectory:
https://github.com/epics-modules/sscan/blob/master/sscanApp/src/saveData_writeXDR.c#L3625

This is a problem because stat() returns -1 on Windows if the path has a trailing directory separator.

This is confusing for users because when they choose a valid directory for $(P)saveData_fileSystem, $(P)saveData_message is "saveData OK", but when they choose a valid directory for $(P)saveData_subDir, $(P)saveData_message is "Invalid directory !!!". If they choose a subdirectory that doesn't exist, saveData successfully creates it and then fails to detect that the directory exists. This is the debug message that gets printed when the subdirectory PV is updated:

epics> var debug_saveData 10
epics> saveDataTask: MSG_FILE_SUBDIR, val=12
saveData: stat returned -1 for filename 'C:/data/mda/2016/12/'; errno=2

areaDetector handles this by stripping the trailing directory separator before testing for the existence of the directory:
https://github.com/areaDetector/ADCore/blob/master/ADApp/ADSrc/asynNDArrayDriver.cpp#L77

There are many ways to fix this in saveData_writeXDR.c (appending the separator in proc_file_subdir after calling fileStatus, stripping a trailing separator in fileStatus before calling stat), but it isn't obvious which approach is best.

Missed and Bunched posting of CPT field

Has anyone else noticed that the CPT field sometimes is not posted, and posted in bunch of two?
I do think that it is incremented correctly it is just that it is posted irregularly, and to the user it looks like it might take two data points one some steps, and zero on some.

Example monitoring the CPT field and FAZE field, note that I run the positioner very slow so there several seconds when the positioner is moving. The following example are camonitors of what happens at each step. This is continuous sequence were the motors moves for several seconds when I comment.

# Sequence when when CPT is not posted:
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 TRIG_DETCTRS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:DETCTRS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 RECORD SCALAR DATA  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 MOVE_MOTORS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:MOTORS  
# Sequence when when CPT is posted only once:
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 TRIG_DETCTRS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:DETCTRS  
SCANNING:GRID.CPT              2016-11-25 16:04:50.931012 1  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 RECORD SCALAR DATA  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 MOVE_MOTORS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:MOTORS  
# Sequence when when CPT is posted twice:
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 TRIG_DETCTRS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:DETCTRS  
SCANNING:GRID.CPT              2016-11-25 16:04:50.931012 2  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 RECORD SCALAR DATA  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 MOVE_MOTORS  
SCANNING:GRID.FAZE             2016-11-25 16:04:50.931012 WAIT:MOTORS  
SCANNING:GRID.CPT              2016-11-25 16:04:50.931012 3  

It seems like it it sometimes misses to post CPT and then post it two times.

Build Environment
Architecture: x86_64 CentOS7
Epics Base Version: 3.14.12.5, 3.15.4
sscan version: https://github.com/epics-modules/sscan/tree/e543806b6405311aa03a5ecbeb7a4dc2037326ce
But there are no changes to sscanRecord.c after that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.