ID |
Date |
Author |
Topic |
Subject |
2087
|
10 Feb 2021 |
Isaac Labrie Boulay | Forum | Javascript error during run transitions. | Hi all,
I am encountering a Javascript error (TypeError: client.error is undefined) when
I transition between run states. Does anybody have an idea of what my problem
might be? I have pasted an example of what MIDAS logs during such sequences.
Thanks for all the help!
Isaac
09:24:08.611 2021/02/10 [mhttpd,INFO] Executing script
"~/ANIS_20210106/scripts/start_daq.sh" from ODB "/Script/Start DAQ"
09:24:13.833 2021/02/10 [Logger,LOG] Program Logger on host localhost started
09:24:28.598 2021/02/10 [fevme,LOG] Program fevme on host localhost started
09:24:33.951 2021/02/10 [mhttpd,INFO] Run #234 started
09:26:30.970 2021/02/10 [mhttpd,ERROR] [midas.cxx:4260:cm_transition_call,ERROR]
Client "Logger" transition 2 aborted while waiting for client "fevme":
"/Runinfo/Transition in progress" was cleared
09:26:31.015 2021/02/10 [mhttpd,ERROR] [midas.cxx:5120:cm_transition,ERROR]
transition STOP aborted: "/Runinfo/Transition in progress" was cleared
09:27:27.270 2021/02/10 [mhttpd,ERROR]
[system.cxx:4937:ss_recv_net_command,ERROR] timeout receiving network command
header
09:27:27.270 2021/02/10 [mhttpd,ERROR] [midas.cxx:12262:rpc_client_call,ERROR]
call to "fevme" on "localhost" RPC "rc_transition": timeout waiting for reply |
2090
|
11 Feb 2021 |
Isaac Labrie Boulay | Forum | Javascript error during run transitions. |
> > I am encountering a Javascript error (TypeError: client.error is undefined) when
> > I transition between run states. Does anybody have an idea of what my problem
> > might be? I have pasted an example of what MIDAS logs during such sequences.
>
>
> Not enough information. Can you do this:
>
> a) for the javascript error, if you get it every time, open the javascript debugger
> and capture the stack trace? or at least the file name, function name and line number
> where the javascript exception is thrown?
I've attached a screenshot of the call stack showing the file names and line numbers.
> b) for the run start failure, start the run from odbedit "start now -v" or from
> "mtransition -v -d 1 START" (or "stop" as the case may be). capture the output, email
> to me directly or put in this elog here.
I have also attached a screen capture of the output.
Thanks for your help as always.
Isaac
> K.O.
>
>
> >
> > Thanks for all the help!
> >
> > Isaac
> >
> >
> > 09:24:08.611 2021/02/10 [mhttpd,INFO] Executing script
> > "~/ANIS_20210106/scripts/start_daq.sh" from ODB "/Script/Start DAQ"
> >
> > 09:24:13.833 2021/02/10 [Logger,LOG] Program Logger on host localhost started
> >
> > 09:24:28.598 2021/02/10 [fevme,LOG] Program fevme on host localhost started
> >
> > 09:24:33.951 2021/02/10 [mhttpd,INFO] Run #234 started
> >
> > 09:26:30.970 2021/02/10 [mhttpd,ERROR] [midas.cxx:4260:cm_transition_call,ERROR]
> > Client "Logger" transition 2 aborted while waiting for client "fevme":
> > "/Runinfo/Transition in progress" was cleared
> >
> > 09:26:31.015 2021/02/10 [mhttpd,ERROR] [midas.cxx:5120:cm_transition,ERROR]
> > transition STOP aborted: "/Runinfo/Transition in progress" was cleared
> >
> > 09:27:27.270 2021/02/10 [mhttpd,ERROR]
> > [system.cxx:4937:ss_recv_net_command,ERROR] timeout receiving network command
> > header
> >
> > 09:27:27.270 2021/02/10 [mhttpd,ERROR] [midas.cxx:12262:rpc_client_call,ERROR]
> > call to "fevme" on "localhost" RPC "rc_transition": timeout waiting for reply |
Attachment 1: start_now_-v.PNG
|
|
Attachment 2: Call_Stack_for_JavaScript_Error.PNG
|
|
2098
|
25 Feb 2021 |
Isaac Labrie Boulay | Bug Report | Undefined client causing issues in transition. | Hi all,
I'm currently experiencing an issue during run transitions. It comes in the form
of an alert saying "TypeError: Cannot read property 'length' of undefined"
whenever I'm in the "transition" window on mhttpd. I have attached an image of
what the transition window looks like when this happens.
By the looks of it and by peering at the lines in transition.html where the
error occurs, it's pretty obvious that there is some strange undefined client
that the web page tries to access.
I don't know how to find what this client is. Is there a way to see it in the
ODB?
The issues happens in show_client() of transition.html (called by callback()).
Here's the trace:
Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
at show_client (?cmd=Transition:227)
at callback (?cmd=Transition:420)
at ?cmd=Transition:430
Any help would be very appreciated!
Thanks so much.
Isaac |
Attachment 1: error_message.PNG
|
|
Attachment 2: undefined_client.PNG
|
|
2109
|
26 Feb 2021 |
Isaac Labrie Boulay | Bug Report | Undefined client causing issues in transition. | > Clearly something goes wrong with the STARTABORT transition. Actually from your
> sceenshot, it is not clear why the STARTABORT transition was initiated.
>
> Usually it is called after some client fails the "start run" transition to inform
> other clients that the run did not start after all. (mlogger uses this to close the
> output file, etc).
>
> But in the screenshot, we do not see any client fail the transition (only rootana1
> was called, and it returned "green").
>
> So, a puzzle. One possibility is that the transition code gets so confused
> that it does not record correct transition data to ODB, then the web page
> gets even more confused.
>
> One way to see what happens, is to run the odbedit command "start now -v".
>
> Can you try that? And attach all its output here?
>
> K.O.
Thanks for getting back to me right away. I've attached two screenshots. The first one
is the output after running "start now -v" (everything seemed to work nicely there), the
second output is after using odbedit to stop the run with "stop". Notice that the DAQ
never stops because it gets stuck in between transitions (You can see the run status
being "stopping run" with the cancel transition button).
Thanks.
Isaac |
Attachment 1: start_now_-v_(1).PNG
|
|
Attachment 2: stop.PNG
|
|
Draft
|
26 Feb 2021 |
Isaac Labrie Boulay | Forum | Javascript error during run transitions. | > >
> > I have also attached a screen capture of the output.
> >
>
> so the error is gone?
>
> K.O.
Hi K.O.,
No the error persists, |
2113
|
26 Feb 2021 |
Isaac Labrie Boulay | Bug Report | Undefined client causing issues in transition. | > So there is no error on run start anymore? To debug the stuck run stop, please use "stop -v"
> to see where it got stuck. You can also play with the RPC timeouts (the connect timeout and
> the response timeout), to make it get "unstuck" quicker. Definitely it should not be stuck
> forever, it should timeout at maximum of "rpc timeout * number of clients". K.O.
You're right it does not stay stuck forever, it eventually gets unstuck. I forgot to mention this.
I will try to play with these timeout parameters. It does not get stuck if I run my DAQ using the
odbedit commands (start/stop). I don't know if this is relevant information that could help us
identify the problem.
Thanks for all your help as always!
Isaac |
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
|
|
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
|
2149
|
13 Apr 2021 |
Isaac Labrie Boulay | 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).
>
Hi Ben,
I have followed your suggestions and the program still stops immediately. My status as returned from "cm_yield(100)" is always 412 (SS_TIMEOUT) which is fine.
The issue is that, when run with the script button, the do-wile loop stops immediately because the !ss_kbhit() always evaluates to FALSE.
My temporary solution has been to let the loop run forever :)
Let me know what think. Thanks again!
Isaac
>
>
> #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;
> } |
2327
|
29 Jan 2022 |
Isaac Labrie Boulay | Forum | MIDAS and GRIF-16 digitizer (Standalone Mode). | Hi all,
I was sent a version of the frontend for the TIGRESS Detector lab setup so that
I can test detectors using a GRIF-16 digitizer in standalone mode.
I followed the GRIF-16 wiki (https://grsi.wiki.triumf.ca/wiki/GRIF-16#One-
level_operation) to setup the GRIF-16 through the webpage. The digitized data is
supposed to come into my UDP port 8800 but it is never retrieved in the
frontend.
Here's the readout scheme:
// readout sequence ...
// poll_event() true (if still have data in buffer or testmsg() true)
// -> read_trigger_event() -> read_grifc_event() - re-buffers into midas events
// -> grifc_eventread() - returns single grif fragment
// -> grifc_dataread() - returns single net-pkt
Here's poll_event():
INT poll_event(INT source, INT count, BOOL test)
{
int i, have_data=0;
for(i=0; i<count; i++){
if( data_available ){ break; }
have_data = ( testmsg(data_socket, 0) > 0 );
if( have_data && !test ){ break; }
}
return( (have_data || data_available) && !test );
}
This being said, testmsg() always returns empty and "data_available" is only set
to TRUE when there's leftover data after a GRIF-C reading (I'm obviously not
using a GRIF-C).
I know that when GRIF-16 is in standalone mode, MIDAS does not change GRIF-16s
settings based on the ODB, it has to be done through the GRIF-16 webpage. Is the
user frontend code even responsible for the GRIF-16 data readout in standalone
mode? If not, could it just be that my UDP offloader is incorrectly setup?
Here are its current settings:
SETTINGS/UDP
- Offloader: ON
- Dst IP: my IP
- Dst Port: 8800 (DATA_PORT)
SETTINGS/MIDAS
- Use MIDAS: OFF
- MIDAS Hostname: my hostname
- MIDAS IP: same as Dst IP from UDP settings
- Dst Port: 8080 (I'm assuming that this is the mhttpd port)
Again, the frontend runs but I get 0 events. What might I be missing?
Thanks for helping me out!
Isaac |
230
|
02 Nov 2005 |
I. K. arapkorir | Info | new mvmestd api | I manage to access some vme modules with the older vmicvme interface and seemed
confused with the
new interface as the sample code provided does not have a specific test sample.
The test code
provided in the earlier version for accessing V792 32ch. QDC was quite handy,
how can I apply it
for the new interface? |
2300
|
09 Nov 2021 |
Hunter Lowe | Forum | MityCAMAC Login | Hello all,
I've recently acquired a MityCAMAC system that was built at TRIUMF and I'm
having issues accessing it over ethernet.
The system: Ubuntu VM inside Windows 10 machine.
I've tried reconfiguring the network settings for the VM but nmap and arp/ip
commands have yielded me no results in finding the crate controller.
I was getting help from Pierre Amaudruz but I think he is now busy for some
time. I have the mac address of the crate controller and its name. The
controller seems to initialize fine inside of the CAMAC crate. The windows side
of the workstation also tells me that an unknown network is in fact connected.
I suspect I either need to do something with an ssh key (which I thought we
accomplished but maybe not), or perhaps the domain name in the controller needs
to be changed.
If anybody has experience working with MityARM I would appreciate any advice I
could get.
Best,
Hunter Lowe
UNBC Graduate Physics |
2365
|
23 Mar 2022 |
Hunter Lowe | Forum | ODB has issue with example analyzer | Trying to play with midas file but I get error:
[Analyzer,ERROR] [odb.cxx:845:db_validate_name,ERROR] Invalid name "/Analyzer/Tests/low_sum/Rate [Hz]" passed to db_create_key_wlocked: should not contain "["
I'm not sure what sets the name so I'm not sure how to fix this.
Thanks |
2376
|
29 Mar 2022 |
Hunter Lowe | Forum | Triggering without LAM signal - mcstd_libgpmc_camac driver | Hello,
I have a question for anyone experienced with simple CAMAC systems.
My understanding is that for a single ADC system you can use a gate to generate a
LAM signal for triggering on ADC.
The driver that I have "mcstd_libgpmc_camac" has LAM "not implemented" though,
so I'm not sure how I should trigger DAQ. The frontend code that I have seems to use a TDC
as trigger for ADC via "EQ_POLLED" type equipment setting. Should I simply plug in TDC in my
system and use this as trigger? Is it as simple as TDC generates signal via gate and ADC performs job?
Sorry if question is super basic, just confused how to trigger without LAM signal.
Thank you :)
Hunter Lowe
UNBC Grad Physics |
1930
|
04 Jun 2020 |
Hisataka YOSHIDA | Forum | Template of slow control frontend | I’m beginner of Midas, and trying to develop the slow control front-end with the latest Midas.
I found the scfe.cxx in the “example”, but not enough to refer to write the front-end for my own devices
because it contains only nulldevice and null bus driver case...
(I could have succeeded to run the HV front-end for ISEG MPod, because there is the device driver...)
Can I get some frontend examples such as simple TCP/IP and/or RS232 devices?
Hopefully, I would like to have examples of frontend and device driver.
(if any device driver which is included in the package is similar, please tell me.)
Thanks a lot. |
1933
|
04 Jun 2020 |
Hisataka YOSHIDA | Forum | Template of slow control frontend | Dear Stefan,
Thank you for you quick reply.
> Have you checked the documentation?
>
> https://midas.triumf.ca/MidasWiki/index.php/Slow_Control_System
Yes, I have read the wiki, but not easy to figure out how I treat the individual case.
> Basically you have to replace the nulldevice driver with a "real" driver. You find all existing drivers under
> midas/drivers/device. If your favourite is not there, you have to write it. Use one which is close to the one
> you need and modify it.
Okay, I will try to write drivers for my own devices using existing drivers.
(maybe I can find some device drivers which uses TCP/IP, RS232)
Best regards,
Hisataka Yoshida |
1934
|
04 Jun 2020 |
Hisataka YOSHIDA | Forum | Template of slow control frontend | Dear Giorgio,
Thank you very much for your kind and quick reply!
I appreciate you giving me such a nice explanation, experience, and great sample codes (This is what I desired!).
They all are useful for me. I will try to write my frontend codes using gift from you.
Thank you again!
Best regards,
Hisataka Yoshida |
1379
|
21 Jul 2018 |
Hiroaki Natori | Forum | Question about distributing event builder function on remote PC | Dear expert,
I'm going to develop MIDAS DAQ for COMET experiment.
I'm thinking to distribute the load of event building to different PCs.
I attach a schematics of one of the examples of the design.
Please tell me how can I accomplish a kind of "sub-EventBuilder".
I'm reading the midas code to understand the scheme of MIDAS but
it is a lot and I want to know which one to focus on.
Can I do it writing user function based on either "mfe.c" or "mevb.c"?
Frontend program with multithread equipment is the one to do?
Or should I modify the original midas files?
Best regards,
Hiroaki Natori |
Attachment 1: MIDAS_tmp.pdf
|
|
1381
|
28 Jul 2018 |
Hiroaki Natori | Forum | Question about distributing event builder function on remote PC | Dear Mr. Olchanski
Thank you for your comment.
We exect the number of readout channels is ~1000, boards ~100 and the frontend pc <10.
We expect that trigger rate is a few kHz.
Writing monolithic c++ code may need complete understanding on midas,
and I will consider more about writing from scratch or modifying midas code.
Best regards
Hiroaki Natori
> > I'm going to develop MIDAS DAQ for COMET experiment.
> > I'm thinking to distribute the load of event building to different PCs.
> > I attach a schematics of one of the examples of the design.
>
> Your schematic is reminiscent of the T2K/ND280 structure where the MIDAS DAQ
> was split into several separate MIDAS instances (separate "experiments": the FGD, the TPC,
> the slow controls, etc).
>
> They were joined together by the "cascade" equipment which provided a path
> for the data events to flow from subsidiary midas instances to the main system (the one
> with the final mlogger). It also provided a reverse path for run control, where starting
> a run in the main experiment also started the run in all the subsidiary experiments.
>
> This cascade frontend was never included in the midas distribution (an oversight),
> but I still have the code for it somewhere.
>
> How many "frontend PC" components do you envision? (10, 100, 1000?).
>
> In T2K/ND280, each subsidiary experiment had it's own ODB which made sense
> because e.g. the FGD and the TPC were quite different and were managed by different
> groups.
>
> But for you it probably makes sense to have one common ODB. This means a MIDAS
> structure where ODB is located on the main computer ("event builder PC"),
> all others connect to it via the mserver and midas rpc.
>
> But you will need to have the MIDAS shared event buffers on each "frontend PC" to be local,
> which means the bm_xxx() functions have run locally instead of throuhg the mserver rpc.
> This is not how midas works right now, but it could be modified to do this.
>
> On the other hand, you do not have to use midas to write the "frontend pc" code. Today's
> C++ provides enough features - threads, locks, mutexes, shared memories, event queues,
> etc so you can write the whole sub-event builder as one monolithic c++ program
> and use midas only to send the data to the main event builder. (plus midas rpc to handle
> run control). In this scheme, technically, this "frontend pc" program would
> be a multithreaded midas frontend.
>
> K.O. |
1565
|
24 Jun 2019 |
Hassan | Bug Report | ERROR INSTALLING 32BIT MIDAS LIBRARIES ON 64BIT HOST MACHINE | Hi, we are part of the Mu3e research based at University of Bristol. We have a
remote 32 bit frontend (raspberry pi) connected to a 64 bit Data Acquisition
system.we are following the instructions at installation/quickstart linux/Build
32-bit MIDAS libraries. when we execute the commands:
[mhostpc] cd /home/packages/midas
[mhostpc] make linux32
we get an error:
make NO_ROOT=1 NO_MYSQL=1 NO_ODBC=1 NO_SQLITE=1 OS_DIR=linux-m32 USERFLAGS=-m32
make[1]: Entering directory `/home/hh19285/packages/midas'
g++ -m32 -c -g -O2 -Wall -Wno-strict-aliasing -Wuninitialized -Iinclude -
Idrivers -Imxml -Imscb/include -DHAVE_FTPLIB -D_LARGEFILE64_SOURCE -DHAVE_ZLIB -
DHAVE_MSCB -DHAVE_MONGOOSE6 -DMG_ENABLE_THREADS -DMG_DISABLE_CGI -DMG_ENABLE_SSL
-DOS_LINUX -fPIC -Wno-unused-function -o lib/crc32c.o src/crc32c.cxx
src/crc32c.cxx: In function ‘uint32_t crc32c_hw(uint32_t, const void*, size_t)’:
src/crc32c.cxx:283:66: error: ‘asm’ operand has impossible constraints
: "r"(next), "0"(crc0), "1"(crc1), "2"(crc2));
^
src/crc32c.cxx:303:66: error: ‘asm’ operand has impossible constraints
: "r"(next), "0"(crc0), "1"(crc1), "2"(crc2));
^
src/crc32c.cxx: In function ‘uint32_t crc32c(uint32_t, const void*, size_t)’:
src/crc32c.cxx:348:34: error: PIC register clobbered by ‘%ebx’ in ‘asm’
: "%ebx", "%edx"); \
^
src/crc32c.cxx:362:5: note: in expansion of macro ‘SSE42’
SSE42(sse42);
^
make[1]: *** [lib/crc32c.o] Error 1
make[1]: Leaving directory `/home/hh19285/packages/midas'
make: *** [linux32] Error 2
Could you please help with getting past this? otherwise we may need to change
our whole experimental setup.
Thank you in advance |
|