ID |
Date |
Author |
Topic |
Subject |
1827
|
12 Feb 2020 |
Berta Beltran | Bug Report | Compiling Midas in OS 10.15 Catalina | > Another thought: Can you delete the midas build directory and run cmake again? Like
>
> $ cd midas/build
> $ rm -rf *
> $ cmake ..
> $ make VERBOSE=1
>
> If you have the old build cache and upgraded your OS in meantime, the cache needs to be rebuild. The VERBOSE
> flag tells you the compiler options, and you see where the compiler looks for the SDK directory.
>
> Cheers,
> Stefan
Hi Stefan,
Thanks again for your reply. Yes! the suggestion of rebuilding the cache was the right one, this is the output of cmake ..
Darrens-Mac-mini:~ betacage$ cd packages/midas/build/
Darrens-Mac-mini:build betacage$ rm -rf *
Darrens-Mac-mini:build betacage$ cmake ..
-- MIDAS: cmake version: 3.16.3
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- MIDAS: CMAKE_INSTALL_PREFIX: /Users/betacage/packages/midas
-- MIDAS: Found ROOT version 6.18/04
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- MIDAS: Found ZLIB version 1.2.11
-- Found OpenSSL: /usr/lib/libcrypto.dylib (found version "1.1.1d")
-- MIDAS: Found OpenSSL version 1.1.1d
-- MIDAS: MySQL not found
-- MIDAS: ODBC not found
-- MIDAS: SQLITE not found
-- MIDAS: nvidia-smi not found
-- Setting default build type to "RelWithDebInfo"
-- Found Git: /usr/bin/git (found version "2.21.1 (Apple Git-122.3)")
-- MIDAS example/experiment: MIDAS in-tree-build
-- MIDAS: Found ZLIB version 1.2.11
-- MIDAS example/experiment: Found ROOT version 6.18/04
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/betacage/packages/midas/build
Unfortunately running make VERBOSE=1 the compilation crashes, with the following error
[ 39%] Linking CXX executable mhttpd
cd /Users/betacage/packages/midas/build/progs && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/mhttpd.dir/link.txt
--verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O2 -g -DNDEBUG -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-
headerpad_max_install_names CMakeFiles/mhttpd.dir/mhttpd.cxx.o CMakeFiles/mhttpd.dir/mongoose6.cxx.o CMakeFiles/mhttpd.dir/mgd.cxx.o
CMakeFiles/mhttpd.dir/__/mscb/src/mscb.cxx.o -o mhttpd ../libmidas.a /usr/lib/libssl.dylib /usr/lib/libcrypto.dylib -lz
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [progs/mhttpd] Error 1
make[1]: *** [progs/CMakeFiles/mhttpd.dir/all] Error 2
make: *** [all] Error 2
Libcrypto seems to be part of the OpenSSL, so I am back to the original problem again. I did install OpenSSL via MacPorts.
I have found this tread regarding this problem. But have to go and pick up my kids from school, so I don't have time to investigate today.
https://stackoverflow.com/questions/58446253/xcode-11-ld-error-your-binary-is-not-an-allowed-client-of-usr-lib-libcrypto-dy
Thanks again for staying with me and for responding so promptly.
Berta |
1828
|
13 Feb 2020 |
Stefan Ritt | Bug Report | Compiling Midas in OS 10.15 Catalina | Now you are stuck with openssl, which is optional for mhttpd. If you only use mhttpd locally, you maybe don't need SSL support. In that case you can jus do
[midas/build] $ cmake -D NO_SSL=1 ..
To disable that. If you do need SSL, maybe you can try to install openssl11 via mac ports.
Stefan |
1832
|
13 Feb 2020 |
Berta Beltran | Bug Report | Compiling Midas in OS 10.15 Catalina | > Now you are stuck with openssl, which is optional for mhttpd. If you only use mhttpd locally, you maybe don't need SSL support. In that case you can jus do
>
> [midas/build] $ cmake -D NO_SSL=1 ..
>
> To disable that. If you do need SSL, maybe you can try to install openssl11 via mac ports.
>
> Stefan
Thanks Stefan.
If I run the compilation with the flag NO_SSL it works just fine. Still I think that Mhttpd is going to be important for us in the future as we may want to control the experiment remotely, so I will keep trying. But at least I
can get started.
Thanks
Berta |
1847
|
28 Feb 2020 |
Konstantin Olchanski | Bug Report | Compiling Midas in OS 10.15 Catalina | > > [midas/build] $ cmake -D NO_SSL=1 ..
> If I run the compilation with the flag NO_SSL it works just fine. ...
FYI, the mongoose616 branch now has support for using the mbedtls https library,
this library seems to build easily from sources and removes our dependency
on where/how/which openssl library is installed. I hope to have this included
in the next release of midas.
K.O. |
1848
|
03 Mar 2020 |
Berta Beltran | Bug Report | Compiling Midas in OS 10.15 Catalina | Thanks Konstantin,
I will keep an eye for the next release so that I can update my Midas to include ssl libraries.
Thanks
> > > [midas/build] $ cmake -D NO_SSL=1 ..
> > If I run the compilation with the flag NO_SSL it works just fine. ...
>
> FYI, the mongoose616 branch now has support for using the mbedtls https library,
> this library seems to build easily from sources and removes our dependency
> on where/how/which openssl library is installed. I hope to have this included
> in the next release of midas.
>
> K.O. |
2655
|
12 Dec 2023 |
Zaher Salman | Bug Report | Compilation error on RPi | Hello,
Since commit bc227a8a34def271a598c0200ca30d73223c3373 I've been getting the compilation error below (on a Raspberry Pi 3 Model B Plus Rev 1.3).
The fix is obvious from the reported error, but I am wondering whether this should be fixed in the main git??
Thanks,
Zaher
[ 7%] Building CXX object CMakeFiles/objlib.dir/src/json_paste.cxx.o
/home/nemu/nemu/tmidas/midas/src/json_paste.cxx: In function ‘int GetQWORD(const MJsonNode*
, const char*, UINT64*)’:
/home/nemu/nemu/tmidas/midas/src/json_paste.cxx:324:19: error: ‘const class MJsonNode’ has
no member named ‘GetLL’; did you mean ‘GetInt’?
*qw = node->GetLL();
^~~~~
GetInt
make[2]: *** [CMakeFiles/objlib.dir/build.make:271: CMakeFiles/objlib.dir/src/json_paste.cx
|
2658
|
14 Dec 2023 |
Zaher Salman | Bug Report | Compilation error on RPi | This issue was resolved thanks to Konstantin and Stefan. I simply had to update submodules:
git submodule update
and then recompile.
Zaher |
2662
|
29 Dec 2023 |
Konstantin Olchanski | Bug Report | Compilation error on RPi | > git pull
> git submodule update
confirmed. just run into this myself. I think "make" should warn about out of
date git modules. Also check that the build git version is tagged with "-dirty".
K.O. |
2665
|
03 Jan 2024 |
Stefan Ritt | Bug Report | Compilation error on RPi | > > git pull
> > git submodule update
>
> confirmed. just run into this myself. I think "make" should warn about out of
> date git modules. Also check that the build git version is tagged with "-dirty".
>
> K.O.
The submodule business becomes kind of annoying. I updated the documentation at
https://daq00.triumf.ca/MidasWiki/index.php/Quickstart_Linux#MIDAS_Package_Installatio
n
to tell people to use
1) "git clone ... --recurse-submodules" during the first clone
2) "git submodule update --init --recursive" in case they forgot 1)
3) "git pull --recurse-submodules" for each update or to use
4) "git config submodule.recurse true" to make the --recurse-submodules the default
I use 4) since a while and it works nicely, so one does not have to remember to pull
recursively each time.
Stefan |
178
|
14 Dec 2004 |
Konstantin Olchanski | Info | Commit local TWIST modifications | I am commiting MIDAS modification accumulated during the last few months of running TWIST:
1) system.c::ss_shm_open() fail if trying to map a file that is smaller than we expect.
2) midas.c::bm_lock_buffer(), el_submit(), el_delete_message(): do not wait for mutexes forever, use a 5
minute timeout. If we can't get the lock, cm_msg()/abort().
The above helps dealing with complete midas freezes. I also have code to keep track of "who locked
the mutex *and* is still holding it?!?" but it is way too ugly to commit. I wish we had a "lockedByPid"
entry for all lockable objects.
K.O.
|
179
|
14 Dec 2004 |
Konstantin Olchanski | Info | Commit local TWIST modifications | > I am commiting MIDAS modification accumulated during the last few months of running TWIST:
More:
- mfe.c: in error messages "cannot find statistics record", also print
the name of the record we are looking for.
- mlogger.c: in warning message "Write operation took N ms", report the name
of the offending data stream.
- system.c: do not chdir("/") in ss_daemon_init()- it prevents us from ever
getting core dumps from midas daemons. The old behaviour is trivially
restored by "cd /" before starting the daemon; or by "limit coredumpsize 0".
- odb.c: db_validate_db() detect and break infinite looping on free list corruption.
K.O. |
182
|
15 Dec 2004 |
Stefan Ritt | Info | Commit local TWIST modifications | > - system.c: do not chdir("/") in ss_daemon_init()- it prevents us from ever
> getting core dumps from midas daemons. The old behaviour is trivially
> restored by "cd /" before starting the daemon; or by "limit coredumpsize 0".
The chdir("/") is from one of the unix text books. They say you HAVE to do it. If you start a
daemon on an NFS file system, you cannot unmount that file system as long as the daemon is
running. I'm sure the same code is inside most other daemons (apache, ...). So if we go away
from that standard, we have to be aware of the consequences. |
2899
|
18 Nov 2024 |
Lukas Gerritzen | Suggestion | Comma-separated indices in alarm conditions | I have the following use case: I would like to check if two elements of an array exceed a certain threshold.
However, they are not consecutive. Currently, I have to write two alarms, one checking Array[8] and one
checking Array [10].
It would be nice if we could enter conditions such as "/Path/To/Array[8,10] > 0.5".
I looked into the code of al_evaluate_condition() and it seems very C-style. I know that you have been
refactoring a lot of code to work with STL strings and their functions. If you find the time to refactor
alarm.cxx, I ask that you consider adding comma-separated lists as a new feature.
Cheers
Lukas |
2920
|
10 Dec 2024 |
Stefan Ritt | Suggestion | Comma-separated indices in alarm conditions | These kind of alarm conditions have been implemented and committed. The documentation at
https://daq00.triumf.ca/MidasWiki/index.php/Alarm_System
has been updated.
/Stefan |
2062
|
18 Dec 2020 |
Stefan Ritt | Suggestion | Code formatting | May I ask for your quick opinion on code formatting. MIDAS had a coding style
which pretty much followed the ROOT coding style described at
https://root.cern/contribute/coding_conventions/
so we followed the "3 spaces indent" convention, braces according to Kernigham &
Ritchie and a few other things. I see however that code written by different
people still is formatted differently, like spaces before and after comparators
etc. I wonder if it would make sense to keep a consistent code formatting through
the whole midas repository.
Looking again at what the ROOT guys doe (see link above), they have a ClangFormat
file, which I attached to this post. Putting this file into the root of midas
ensures that all files are formatted in exactly the same way, which would increase
readability largely.
The nice thing with ClangFormat is that can be integrated into my editor (Clion) as
well as in emacs and vim:
https://clang.llvm.org/docs/ClangFormat.html
This would also make the emacs settings in our files obsolete:
/* emacs
* Local Variables:
* tab-width: 8
* c-basic-offset: 3
* indent-tabs-mode: nil
* End:
*/
I don't like these because they are only for people using emacs. If everybody would
put statements into the files with their favourite editor, all our source files
would be cluttered quite a bit.
So the question is now how style to use? I attached different trials with a simple
file from the distribution, so you can see the differences. They use the style from
- LLVM
- ROOT
- GNU
- Google
I consciously skipped the "Microsoft" style ;-)
Which one should we settle on? Any opinion? If I don't hear anything, I will pick a
style at the end of this year 2020. I have a slight favour of the ROOT style, although
I don't like that the "case" is not indented there under the opening brace of the
switch statement which seems inconsistent to me. The only one doing that right is the
Google format, but that one has an indentation of 2 chars instead our usual 3 chars.
At the end of the day I think it's not so important on which style we agree, as long
as we DO have a common style for all midas files.
Best,
Stefan |
Attachment 1: .clang-format
|
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
# This would be nice to have but seems to also (mis)align function parameters
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
# This option is "deprecated and is retained for backwards compatibility."
# AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 3
ContinuationIndentWidth: 3
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^("|<)T'
Priority: 4
- Regex: '^("|<)ROOT/'
Priority: 5
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 6
IndentCaseLabels: false
IndentWidth: 3
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 3
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60000
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 3
UseTab: Never
...
|
Attachment 2: cnaf_callback_llvm.cxx
|
/********************************************************************\
Name: cnaf_callback.c
Created by: Stefan Ritt
Created by: moved here from mfe.c by Konstantin Olchanski
Contents: The system part of the MIDAS frontend. Has to be
linked with user code to form a complete frontend
$Id$
\********************************************************************/
#include <stdio.h>
#include <assert.h>
#include "midas.h"
#include "msystem.h"
#include "mcstd.h"
/*------------------------------------------------------------------*/
static int cnaf_debug = 0;
INT cnaf_callback(INT index, void *prpc_param[]) {
DWORD cmd, b, c, n, a, f, *pdword, *size, *x, *q, dtemp;
WORD *pword, *pdata, temp;
INT i, count;
/* Decode parameters */
cmd = CDWORD(0);
b = CDWORD(1);
c = CDWORD(2);
n = CDWORD(3);
a = CDWORD(4);
f = CDWORD(5);
pdword = CPDWORD(6);
pword = CPWORD(6);
pdata = CPWORD(6);
size = CPDWORD(7);
x = CPDWORD(8);
q = CPDWORD(9);
/* determine repeat count */
if (index == RPC_CNAF16)
count = *size / sizeof(WORD); /* 16 bit */
else
count = *size / sizeof(DWORD); /* 24 bit */
switch (cmd) {
/*---- special commands ----*/
case CNAF_INHIBIT_SET: cam_inhibit_set(c);
break;
case CNAF_INHIBIT_CLEAR: cam_inhibit_clear(c);
break;
case CNAF_CRATE_CLEAR: cam_crate_clear(c);
break;
case CNAF_CRATE_ZINIT: cam_crate_zinit(c);
break;
case CNAF_TEST: break;
case CNAF:
if (index == RPC_CNAF16) {
for (i = 0; i < count; i++)
if (f < 16)
cam16i_q(c, n, a, f, pword++, (int *) x, (int *) q);
else if (f < 24)
cam16o_q(c, n, a, f, pword[i], (int *) x, (int *) q);
else
cam16i_q(c, n, a, f, &temp, (int *) x, (int *) q);
} else {
for (i = 0; i < count; i++)
if (f < 16)
cam24i_q(c, n, a, f, pdword++, (int *) x, (int *) q);
else if (f < 24)
cam24o_q(c, n, a, f, pdword[i], (int *) x, (int *) q);
else
cam24i_q(c, n, a, f, &dtemp, (int *) x, (int *) q);
}
break;
case CNAF_nQ:
if (index == RPC_CNAF16) {
if (f < 16) {
cam16i_rq(c, n, a, f, &pword, count);
*size = (POINTER_T) pword - (POINTER_T) pdata;
}
} else {
if (f < 16) {
cam24i_rq(c, n, a, f, &pdword, count);
*size = (POINTER_T) pdword - (POINTER_T) pdata;
}
}
/* return reduced return size */
break;
default: printf("cnaf: Unknown command 0x%X\n", (unsigned int) cmd);
}
if (cnaf_debug) {
if (index == RPC_CNAF16)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pword[0], (int) *x, (int) *q);
else if (index == RPC_CNAF24)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pdword[0], (int) *x, (int) *q);
}
return RPC_SUCCESS;
}
void register_cnaf_callback(int debug) {
cnaf_debug = debug;
/* register CNAF callback */
cm_register_function(RPC_CNAF16, cnaf_callback);
cm_register_function(RPC_CNAF24, cnaf_callback);
}
/* end file */
|
Attachment 3: cnaf_callback_root.cxx
|
/********************************************************************\
Name: cnaf_callback.c
Created by: Stefan Ritt
Created by: moved here from mfe.c by Konstantin Olchanski
Contents: The system part of the MIDAS frontend. Has to be
linked with user code to form a complete frontend
$Id$
\********************************************************************/
#include <stdio.h>
#include <assert.h>
#include "midas.h"
#include "msystem.h"
#include "mcstd.h"
/*------------------------------------------------------------------*/
static int cnaf_debug = 0;
INT cnaf_callback(INT index, void *prpc_param[])
{
DWORD cmd, b, c, n, a, f, *pdword, *size, *x, *q, dtemp;
WORD *pword, *pdata, temp;
INT i, count;
/* Decode parameters */
cmd = CDWORD(0);
b = CDWORD(1);
c = CDWORD(2);
n = CDWORD(3);
a = CDWORD(4);
f = CDWORD(5);
pdword = CPDWORD(6);
pword = CPWORD(6);
pdata = CPWORD(6);
size = CPDWORD(7);
x = CPDWORD(8);
q = CPDWORD(9);
/* determine repeat count */
if (index == RPC_CNAF16)
count = *size / sizeof(WORD); /* 16 bit */
else
count = *size / sizeof(DWORD); /* 24 bit */
switch (cmd) {
/*---- special commands ----*/
case CNAF_INHIBIT_SET: cam_inhibit_set(c); break;
case CNAF_INHIBIT_CLEAR: cam_inhibit_clear(c); break;
case CNAF_CRATE_CLEAR: cam_crate_clear(c); break;
case CNAF_CRATE_ZINIT: cam_crate_zinit(c); break;
case CNAF_TEST: break;
case CNAF:
if (index == RPC_CNAF16) {
for (i = 0; i < count; i++)
if (f < 16)
cam16i_q(c, n, a, f, pword++, (int *)x, (int *)q);
else if (f < 24)
cam16o_q(c, n, a, f, pword[i], (int *)x, (int *)q);
else
cam16i_q(c, n, a, f, &temp, (int *)x, (int *)q);
} else {
for (i = 0; i < count; i++)
if (f < 16)
cam24i_q(c, n, a, f, pdword++, (int *)x, (int *)q);
else if (f < 24)
cam24o_q(c, n, a, f, pdword[i], (int *)x, (int *)q);
else
cam24i_q(c, n, a, f, &dtemp, (int *)x, (int *)q);
}
break;
case CNAF_nQ:
if (index == RPC_CNAF16) {
if (f < 16) {
cam16i_rq(c, n, a, f, &pword, count);
*size = (POINTER_T)pword - (POINTER_T)pdata;
}
} else {
if (f < 16) {
cam24i_rq(c, n, a, f, &pdword, count);
*size = (POINTER_T)pdword - (POINTER_T)pdata;
}
}
/* return reduced return size */
break;
default: printf("cnaf: Unknown command 0x%X\n", (unsigned int)cmd);
}
if (cnaf_debug) {
if (index == RPC_CNAF16)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int)cmd, (int)count, (int)c, (int)n, (int)a,
(int)f, (int)pword[0], (int)*x, (int)*q);
else if (index == RPC_CNAF24)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int)cmd, (int)count, (int)c, (int)n, (int)a,
(int)f, (int)pdword[0], (int)*x, (int)*q);
}
return RPC_SUCCESS;
}
void register_cnaf_callback(int debug)
{
cnaf_debug = debug;
/* register CNAF callback */
cm_register_function(RPC_CNAF16, cnaf_callback);
cm_register_function(RPC_CNAF24, cnaf_callback);
}
/* end file */
|
Attachment 4: cnaf_callback_gnu.cxx
|
/********************************************************************\
Name: cnaf_callback.c
Created by: Stefan Ritt
Created by: moved here from mfe.c by Konstantin Olchanski
Contents: The system part of the MIDAS frontend. Has to be
linked with user code to form a complete frontend
$Id$
\********************************************************************/
#include <stdio.h>
#include <assert.h>
#include "midas.h"
#include "msystem.h"
#include "mcstd.h"
/*------------------------------------------------------------------*/
static int cnaf_debug = 0;
INT cnaf_callback (INT index, void *prpc_param[])
{
DWORD cmd, b, c, n, a, f, *pdword, *size, *x, *q, dtemp;
WORD *pword, *pdata, temp;
INT i, count;
/* Decode parameters */
cmd = CDWORD(0);
b = CDWORD(1);
c = CDWORD(2);
n = CDWORD(3);
a = CDWORD(4);
f = CDWORD(5);
pdword = CPDWORD(6);
pword = CPWORD(6);
pdata = CPWORD(6);
size = CPDWORD(7);
x = CPDWORD(8);
q = CPDWORD(9);
/* determine repeat count */
if (index == RPC_CNAF16)
count = *size / sizeof (WORD); /* 16 bit */
else
count = *size / sizeof (DWORD); /* 24 bit */
switch (cmd)
{
/*---- special commands ----*/
case CNAF_INHIBIT_SET: cam_inhibit_set (c);
break;
case CNAF_INHIBIT_CLEAR: cam_inhibit_clear (c);
break;
case CNAF_CRATE_CLEAR: cam_crate_clear (c);
break;
case CNAF_CRATE_ZINIT: cam_crate_zinit (c);
break;
case CNAF_TEST: break;
case CNAF:
if (index == RPC_CNAF16)
{
for (i = 0; i < count; i++)
if (f < 16)
cam16i_q (c, n, a, f, pword++, (int *) x, (int *) q);
else if (f < 24)
cam16o_q (c, n, a, f, pword[i], (int *) x, (int *) q);
else
cam16i_q (c, n, a, f, &temp, (int *) x, (int *) q);
}
else
{
for (i = 0; i < count; i++)
if (f < 16)
cam24i_q (c, n, a, f, pdword++, (int *) x, (int *) q);
else if (f < 24)
cam24o_q (c, n, a, f, pdword[i], (int *) x, (int *) q);
else
cam24i_q (c, n, a, f, &dtemp, (int *) x, (int *) q);
}
break;
case CNAF_nQ:
if (index == RPC_CNAF16)
{
if (f < 16)
{
cam16i_rq (c, n, a, f, &pword, count);
*size = (POINTER_T) pword - (POINTER_T) pdata;
}
}
else
{
if (f < 16)
{
cam24i_rq (c, n, a, f, &pdword, count);
*size = (POINTER_T) pdword - (POINTER_T) pdata;
}
}
/* return reduced return size */
break;
default: printf ("cnaf: Unknown command 0x%X\n", (unsigned int) cmd);
}
if (cnaf_debug)
{
if (index == RPC_CNAF16)
printf ("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pword[0], (int) *x, (int) *q);
else if (index == RPC_CNAF24)
printf ("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pdword[0], (int) *x, (int) *q);
}
return RPC_SUCCESS;
}
void register_cnaf_callback (int debug)
{
cnaf_debug = debug;
/* register CNAF callback */
cm_register_function (RPC_CNAF16, cnaf_callback);
cm_register_function (RPC_CNAF24, cnaf_callback);
}
/* end file */
|
Attachment 5: cnaf_callback_google.cxx
|
/********************************************************************\
Name: cnaf_callback.c
Created by: Stefan Ritt
Created by: moved here from mfe.c by Konstantin Olchanski
Contents: The system part of the MIDAS frontend. Has to be
linked with user code to form a complete frontend
$Id$
\********************************************************************/
#include <stdio.h>
#include <assert.h>
#include "midas.h"
#include "msystem.h"
#include "mcstd.h"
/*------------------------------------------------------------------*/
static int cnaf_debug = 0;
INT cnaf_callback(INT index, void *prpc_param[]) {
DWORD cmd, b, c, n, a, f, *pdword, *size, *x, *q, dtemp;
WORD *pword, *pdata, temp;
INT i, count;
/* Decode parameters */
cmd = CDWORD(0);
b = CDWORD(1);
c = CDWORD(2);
n = CDWORD(3);
a = CDWORD(4);
f = CDWORD(5);
pdword = CPDWORD(6);
pword = CPWORD(6);
pdata = CPWORD(6);
size = CPDWORD(7);
x = CPDWORD(8);
q = CPDWORD(9);
/* determine repeat count */
if (index == RPC_CNAF16)
count = *size / sizeof(WORD); /* 16 bit */
else
count = *size / sizeof(DWORD); /* 24 bit */
switch (cmd) {
/*---- special commands ----*/
case CNAF_INHIBIT_SET: cam_inhibit_set(c);
break;
case CNAF_INHIBIT_CLEAR: cam_inhibit_clear(c);
break;
case CNAF_CRATE_CLEAR: cam_crate_clear(c);
break;
case CNAF_CRATE_ZINIT: cam_crate_zinit(c);
break;
case CNAF_TEST: break;
case CNAF:
if (index == RPC_CNAF16) {
for (i = 0; i < count; i++)
if (f < 16)
cam16i_q(c, n, a, f, pword++, (int *) x, (int *) q);
else if (f < 24)
cam16o_q(c, n, a, f, pword[i], (int *) x, (int *) q);
else
cam16i_q(c, n, a, f, &temp, (int *) x, (int *) q);
} else {
for (i = 0; i < count; i++)
if (f < 16)
cam24i_q(c, n, a, f, pdword++, (int *) x, (int *) q);
else if (f < 24)
cam24o_q(c, n, a, f, pdword[i], (int *) x, (int *) q);
else
cam24i_q(c, n, a, f, &dtemp, (int *) x, (int *) q);
}
break;
case CNAF_nQ:
if (index == RPC_CNAF16) {
if (f < 16) {
cam16i_rq(c, n, a, f, &pword, count);
*size = (POINTER_T) pword - (POINTER_T) pdata;
}
} else {
if (f < 16) {
cam24i_rq(c, n, a, f, &pdword, count);
*size = (POINTER_T) pdword - (POINTER_T) pdata;
}
}
/* return reduced return size */
break;
default: printf("cnaf: Unknown command 0x%X\n", (unsigned int) cmd);
}
if (cnaf_debug) {
if (index == RPC_CNAF16)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pword[0], (int) *x, (int) *q);
else if (index == RPC_CNAF24)
printf("cmd=%d r=%d c=%d n=%d a=%d f=%d d=%X x=%d q=%d\n", (int) cmd, (int) count, (int) c, (int) n, (int) a,
(int) f, (int) pdword[0], (int) *x, (int) *q);
}
return RPC_SUCCESS;
}
void register_cnaf_callback(int debug) {
cnaf_debug = debug;
/* register CNAF callback */
cm_register_function(RPC_CNAF16, cnaf_callback);
cm_register_function(RPC_CNAF24, cnaf_callback);
}
/* end file */
|
2063
|
04 Jan 2021 |
Stefan Ritt | Suggestion | Code formatting | After pondering over the holidays, I decided to use the widely used LLVM code formatting,
just adapted slightly for 3 spaces and "case" indentation in a "switch" statement. This
formatting is now very close to our original one. Nevertheless, I did not reformat all
existing code, since that would screw up the git repository, and you cannot see then anymore
who wrote which line of code. But having the .clang-format file now in the midas root, all
NEW files fill follow that standard.
The CLion editor automatically picks up the .clang-format file if your enable ClangFomrat
via Preferences -> Code Style -> General -> Enable ClangFormat.
EMACS can also use this file by adding following lines to your .emacs:
(load "<path-to-clang>/tools/clang-format/clang-format.el")
(global-set-key [C-M-tab] 'clang-format-region)
One problem left is if you check out midas on a new machine, you might not have there your
personal .emacs file. If there is a way to ship a .emacs with midas, which gets
automatically loaded, I would be happy to put this into the distribution.
Stefan |
Attachment 1: .clang-format
|
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignOperands: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: MultiLine
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 3
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 3
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 3
UseTab: Never
|
2145
|
12 Apr 2021 |
Isaac Labrie Boulay | Forum | Client gets immediately removed when using a script button. | Hi all,
I'm running into a curious problem when I try to run a program using my custom
script button. I have been using a script button to start my DAQ, this button
has always worked. It starts by exporting an absolute path to scripts and then
runs scripts, my frontend, my analyzer, and mlogger relative to this path.
I recently added a line of code to run a new script "logic_controller". If I run
the script_daq from my terminal (./start_daq), mhttpd accepts the client and the
program works as intended. But, if I use the script button, the logic_controller
program is immediately deleted by MIDAS. It can be seen appearing in the status
page clients list and then immediately gets deleted. This is a client that runs
on the local experiment host.
What might be the issue? What is the difference between running the script
through the terminal as opposed to running it through the mhttpd button?
I have added a picture of my simple script and the logic_controller code.
Any help would be greatly appreciated.
Cheers.
Isaac |
Attachment 1: logicCtrl.cpp
|
//
// Isaac Labrie-Boulay
//
// Program that enables the modification of gate and delay values
// in the logic unit
//
// Last Edit: 2021-030-29
//
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <iostream>
using namespace std;
#include "CAEN_PLULib.h"
#include "midas.h"
#include "assert.h"
#include "mfe.h"
#include "mvmestd.h"
#include "odbxx.h"
//#include "CAEN_PLULib_TEST.h"
#ifdef WIN32 // Windows
#include <windows.h>
#include <conio.h>
#else // Linux
#define _popen popen
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
char _getch() {
char buf = 0;
struct termios old = { 0 };
fflush(stdout);
if (tcgetattr(0, &old)<0)
perror("tcsetattr()");
old.c_lflag &= ~ICANON;
old.c_lflag &= ~ECHO;
old.c_cc[VMIN] = 1;
old.c_cc[VTIME] = 0;
if (tcsetattr(0, TCSANOW, &old)<0)
perror("tcsetattr ICANON");
if (read(0, &buf, 1)<0)
perror("read()");
old.c_lflag |= ICANON;
old.c_lflag |= ECHO;
if (tcsetattr(0, TCSADRAIN, &old)<0)
perror("tcsetattr ~ICANON");
printf("%c\n", buf);
return buf;
}
#endif
char *base_address = "32100000";
void err_check(CAEN_PLU_ERROR_CODE err);
int main()
{
cm_connect_experiment("", "", "logic_controller", NULL);
midas::odb::set_debug(true);
//Establish a connection with the unit through the V1718
int handle;
CAEN_PLU_ERROR_CODE err_code;
err_code = CAEN_PLU_OpenDevice(CAEN_PLU_CONNECT_VME_V1718, base_address, 0, 0, &handle);
err_check(err_code);
//Create an ODB key to hold the V2495 handle
midas::odb hKey = {{"V2495 Handle", handle}};
hKey.connect("/Modules/Logic");
uint32_t firmware;
err_code = CAEN_PLU_ReadReg(handle, 0x1000, &firmware);
err_check(err_code);
printf("Firmware version: %d\n", firmware);
//Initialize Gate and Delay Generators
err_code = CAEN_PLU_InitGateAndDelayGenerators(handle);
err_check(err_code);
//Take the Default gate values from the ODB
midas::odb def("/Modules/Logic/Default");
uint32_t commonGate = (uint32_t)def["width"];
uint32_t commonDelay = (uint32_t)def["delay"];
uint32_t commonScale = (uint32_t)def["scale"];
//Set all gates to the same default settings
err_code = CAEN_PLU_SetGateAndDelayGenerators(handle, commonGate, commonDelay, commonScale);
err_check(err_code);
//Watch the ODB subtree
midas::odb to_watch("/Modules/Logic");
//Lambda function
//
// if any of these keys are changed through the web server,
// write the new value to the logic unit
//
to_watch.watch([](midas::odb &logic){
//std::cout << "Value of key \"" + logic.get_full_path() + "\" changed to " << logic << std::endl;
CAEN_PLU_ERROR_CODE err_code;
//Retrieve the V2495 handle
midas::odb temp("/Modules/Logic");
int h = temp["V2495 Handle"];
//Get the QDC parameters
midas::odb qdc("/Modules/Logic/QDCGateA");
uint32_t qdcGate = qdc["width"];
uint32_t qdcDelay = qdc["delay"];
uint32_t qdcScale = qdc["scale"];
//Set the new values
err_code = CAEN_PLU_SetGateAndDelayGenerator(h, 0, 1, qdcGate, qdcDelay, qdcScale);
err_check(err_code);
//Get the TDC parameters
midas::odb tdc("/Modules/Logic/TDCGate");
uint32_t tdcGate = tdc["width"];
uint32_t tdcDelay = tdc["delay"];
uint32_t tdcScale = tdc["scale"];
//Set the new values
err_code = CAEN_PLU_SetGateAndDelayGenerator(h, 1, 1, tdcGate, tdcDelay, tdcScale);
err_check(err_code);
});
do {
int status = cm_yield(100);
if (status == SS_ABORT || status == RPC_SHUTDOWN)
break;
} while (!ss_kbhit());
cm_disconnect_experiment();
return 0;
}
void err_check(CAEN_PLU_ERROR_CODE err)
{
if (err != CAEN_PLU_OK)
{
printf("Error %d\n", err);
exit(0);
}
}
|
Attachment 2: start_daq.PNG
|
|
2146
|
12 Apr 2021 |
Ben Smith | Forum | Client gets immediately removed when using a script button. | > if I use the script button, the logic_controller program is immediately deleted by MIDAS.
This is indeed very curious, and I can't reproduce it on my test experiment. Can you redirect stdout and stderr from the logic_controller program into a file, to see how far the program gets? If it gets to the while loop at the end, then it would be useful to add some debug statements to see what condition causes it to exit the loop.
Are there any relevant messages in the midas message log about the program being killed? What's the value of "/Programs/logic_controller/Watchdog timeout"? |
2147
|
12 Apr 2021 |
Isaac Labrie Boulay | Forum | Client gets immediately removed when using a script button. | > > if I use the script button, the logic_controller program is immediately deleted by MIDAS.
>
> This is indeed very curious, and I can't reproduce it on my test experiment. Can you redirect stdout and stderr from the logic_controller program into a file, to see how far the program gets? If it gets to the while loop at the end, then it would be useful to add some debug statements to see what condition causes it to exit the loop.
I have redirected stdout and stderr into a text file and I have attached it to this entry. From what the stdout says, it seems that the lambda
function gets called 4 times before the program disconnects from the experiment. Somehow the status must become SS_ABORT or RPC_SHUTDOWN.
> Are there any relevant messages in the midas message log about the program being killed? What's the value of "/Programs/logic_controller/Watchdog timeout"?
There are no interesting messages in the midas.log and "/Programs/logic_controller/Watchdog timeout" is 10000 when I run the command from the terminal window.
What happens when you run it on your test experiment?
I'll try some more debugging.
Thanks for helping me out! Cheers.
Isaac |
Attachment 1: debug_logic_controller.txt
|
Get definition for ODB key "/Modules/Logic"
Get definition for ODB key "/Modules/Logic/QDCGateA"
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate"
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/Default"
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/V2495 Handle"
Get ODB key "/Modules/Logic/V2495 Handle": 0
Get definition for ODB key "/Modules/Logic/QDCGateA"
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate"
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/Default"
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/V2495 Handle"
Get ODB key "/Modules/Logic/V2495 Handle": 0
Firmware version: 0
Get definition for ODB key "/Modules/Logic/Default"
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get ODB key "/Modules/Logic/Default/width": 200
Get ODB key "/Modules/Logic/Default/delay": 10
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic"
Get definition for ODB key "/Modules/Logic/QDCGateA"
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate"
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/Default"
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/V2495 Handle"
Get ODB key "/Modules/Logic/V2495 Handle": 0
Get definition for ODB key "/Modules/Logic/QDCGateA"
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/width"
Get ODB key "/Modules/Logic/QDCGateA/width": 200
Get definition for ODB key "/Modules/Logic/QDCGateA/delay"
Get ODB key "/Modules/Logic/QDCGateA/delay": 10
Get definition for ODB key "/Modules/Logic/QDCGateA/scale"
Get ODB key "/Modules/Logic/QDCGateA/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate"
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/TDCGate/width"
Get ODB key "/Modules/Logic/TDCGate/width": 200
Get definition for ODB key "/Modules/Logic/TDCGate/delay"
Get ODB key "/Modules/Logic/TDCGate/delay": 10
Get definition for ODB key "/Modules/Logic/TDCGate/scale"
Get ODB key "/Modules/Logic/TDCGate/scale": 200
Get definition for ODB key "/Modules/Logic/Default"
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/Default/width"
Get ODB key "/Modules/Logic/Default/width": 200
Get definition for ODB key "/Modules/Logic/Default/delay"
Get ODB key "/Modules/Logic/Default/delay": 10
Get definition for ODB key "/Modules/Logic/Default/scale"
Get ODB key "/Modules/Logic/Default/scale": 200
Get definition for ODB key "/Modules/Logic/V2495 Handle"
Get ODB key "/Modules/Logic/V2495 Handle": 0
|
2148
|
12 Apr 2021 |
Ben Smith | Forum | Client gets immediately removed when using a script button. | I think it would be useful to find the minimal example that exhibits this behaviour.
What happens if your logic controller code is simply the 17 lines below? What happens if you create another script button that only starts the logic controller, not any of the other programs? etc. Gradually re-add features until you hit the problem (or scream in horror if it breaks with 17 lines of C++ and a 1 line shell script).
#include "midas.h"
#include "stdio.h"
int main() {
cm_connect_experiment("", "", "logic_controller", NULL);
do {
int status = cm_yield(100);
printf("cm_yield returned %d\n", status);
if (status == SS_ABORT || status == RPC_SHUTDOWN)
break;
} while (!ss_kbhit());
cm_disconnect_experiment();
return 0;
} |
|