{
    "ModuleConfig": {
        "baseAddress": 0,
        "enabled": true,
        "id": "{9519291c-cb50-4504-a646-79a9d7d37b20}",
        "initScripts": [
            {
                "enabled": true,
                "id": "{83e08a7a-e060-4719-8de6-2f2a45ab339b}",
                "name": "Module Init",
                "properties": {
                    "icon": ":/vme_script.png"
                },
                "variable_table": {
                    "name": "",
                    "variables": {
                    }
                },
                "vme_script": "# Init script for the CAEN V1742 digitizer.\n# For testing purposes the module was triggered via the 'TRG IN' input using a periodic signal.\n\n## Parameters\nwrite a32 d16 0x8004 0x100  # set individual trigger\n#write a32 d16 0x8004 0x1000 # enable TRn to trigger\n#write a32 d16 0x8004 0x40   # TRn falling edge\n#write a32 d16 0x8004 0x800  # enable TRn readout\nwrite a32 d16 0x8120 0b1111 # group enable mask: lowest bit is group0, highest group 3\nwrite a32 d16 0x8020 0      # number of samples: 0: 1024,1: 520, 2:256, 3: 136 samples\nwrite a32 d16 0x80d8 0      # sampling frequency: 0: 5GHz, 1: 2.5GHz, 2: 1GHz, 3: 750MHz\nwrite a32 d16 0x8114 0      # triggerdelay\nwrite a32 d16 0xef08 0x10   # board id (available in the header data of each event)\nwait 10ms\n\nread  a32 d16 0x1088        #\nwrite a32 d16 0x1098 0x5fd8 # group 0 offset, negative signals\nwait 10ms\n\nread  a32 d16 0x1188        #\nwrite a32 d16 0x1198 0x5fd8 # group 1 offset, negative signals\nwait 10ms\n\nread  a32 d16 0x1288        #\nwrite a32 d16 0x1298 0x5fd8 # group 2 offset, negative signals\nwait 10ms\n\nread  a32 d16 0x1388        #\nwrite a32 d16 0x1398 0x5fd8 # group 3 offset, negative signals\nwait 10ms\n\nread  a32 d16 0x1088        # group 0  status\nwrite a32 d16 0x10d4 0x51c6 # group 0  tr 0 threshhold\nwait 10ms\n\nread  a32 d16 0x1288        # group 2  status\nwrite a32 d16 0x12d4 0x51c6 # group 2  tr 0 threshhold\nwait 10ms\n\n# Readout Control 0xef00 - enable BERR at end of readout and 64 bit alignment\nprint \"readout control\"\nset readout_control 0b11'0000\t\t# [5]align64,[4]berr'[3]optical link irq enable,[2:0]irq\nread  a32 d16 0xef00\nwrite a32 d16 0xef00 ${readout_control}\nread  a32 d16 0xef00\n\nprint \"max events per blt\"\nwrite a32 d16 0xef1c 0x1    # max nr. of events per blt 18-Aug-2022\nread  a32 d16 0xef1c\n\nprint \"start acq\"\nread  a32 d16 0x8100\nwrite a32 d16 0x8100 0x4    # start acquisition\nwait 1s\n"
            }
        ],
        "name": "caen_v1742",
        "type": "caen_v1742",
        "variable_table": {
            "name": "",
            "variables": {
            }
        },
        "vmeReadout": {
            "enabled": true,
            "id": "{ff49579e-4fb7-4404-8a7b-723ee28c1d0b}",
            "name": "Module Readout",
            "properties": {
                "icon": ":/vme_script.png"
            },
            "variable_table": {
                "name": "",
                "variables": {
                }
            },
            "vme_script": "# BLT readout until BERR or number of transfers reached\n# Readout commands go here. For example a BLT read from the module.\n\nmvlc_stack_begin \t\t\t# for interactive debugging only\n\nmvlc_wait 3000\t\t\t\t# delay before reading out to account for the conversion time\n\n#read a32 d16 0x812c\t\t\t# debugging: data ready if value = 1\n#read a32 d16 0x814c\t\t\t# debugging: event length in 32 bit words\n\n# Use either swapped mblt or 2esst transfers for the readout. This way data words will arrive in the\n# correct order.\n#mblts a32 0x0000 65535\t\t# swapped mblt\n2essts 0x0000 320mb 65535\t# swapped 2esst\n\n# Debugging: add additional data words to make the multi event splitter in the mvme analysis work:\n# the splitter assumes the extracted number of data words is the number following the header. This is not\n# true for the CAEN V1742 which includes the header in the word count.\n#marker 0xbeefbeef\n#marker 0xbeefbeef\n\nmvlc_stack_end   \t\t\t# for interactive debugging only\n"
        },
        "vmeReset": {
            "enabled": true,
            "id": "{a7a98997-7566-4b1e-ac16-823eae622b34}",
            "name": "Module Reset",
            "properties": {
                "icon": ":/vme_script.png"
            },
            "variable_table": {
                "name": "",
                "variables": {
                }
            },
            "vme_script": "# Reset the module to a clean default state here. This is executed before\n# initializing the modules at DAQ start time.\n\nwrite a32 d16 0xef24 1      # soft reset\nwait 10ms "
        }
    },
    "ModuleMeta": {
        "displayName": "CAEN V1742",
        "eventHeaderFilter": "1010 SSSS SSSS SSSS SSSS SSSS SSSS SSSS",
        "typeId": 144,
        "typeName": "caen_v1742",
        "variables": [
        ],
        "vendorName": "CAEN",
        "vmeAddress": 0
    }
}
