Skip to content

Instantly share code, notes, and snippets.

@arnobaer
Last active November 19, 2019 17:16
Show Gist options
  • Select an option

  • Save arnobaer/4c762cbba767a0045a08da28b9c99775 to your computer and use it in GitHub Desktop.

Select an option

Save arnobaer/4c762cbba767a0045a08da28b9c99775 to your computer and use it in GitHub Desktop.
caen-firmware-version
// gcc -DLINUX -I/opt/xdaq/include -L/opt/xdaq/lib -lCAENVME firmware.c -o firmware
#include <stdio.h>
#include <stdlib.h>
#include <CAENVMElib.h>
int main()
{
char version[256];
long handle;
printf("\n");
printf("\n");
printf("This mini program reads out the versions of the CAENVME library,\n");
printf("the firmware of the three boards\n");
printf(" A2818 (PCI card)\n");
printf(" A2719 (optical link add-on)\n");
printf(" V2718 (VME conroller card)\n");
printf("\n");
printf("This program should only be run if no other program accesses the\n");
printf("VME bridge. Otherwise data corruption or prgram crashes could occur.\n");
printf("\n");
CAENVME_SWRelease(version);
printf("Software release : %s\n", version);
CAENVME_Init(cvA2818, 0, 0, &handle);
CAENVME_BoardFWRelease(handle, version);
printf("A2818 firmware : %s\n", version);
CAENVME_End(handle);
CAENVME_Init(cvA2719, 0, 0, &handle);
CAENVME_BoardFWRelease(handle, version);
printf("A2719 firmware : %s\n", version);
CAENVME_End(handle);
CAENVME_Init(cvV2718, 0, 0, &handle);
CAENVME_BoardFWRelease(handle, version);
printf("V2718 firmware : %s\n", version);
CAENVME_End(handle);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment