GPIO activated capture

Everything that concerns the open-source Raman spectrometer
Post Reply
ced
Posts: 7
Joined: Mon May 20, 2024 4:29 pm

GPIO activated capture

Post by ced »

Hello,

I am building a linear mapping raman system based on open raman and I was wondering if there is a easy way to trigger the spectrum analyser acquisition using the Camera GPIO port? (This feature already work in spinview)
User avatar
Luc
Site Admin
Posts: 131
Joined: Fri Mar 17, 2023 9:18 am
Contact:

Re: GPIO activated capture

Post by Luc »

Not with the software as it is, you would have to modify the source code. At the moment, it forces the camera into Software Trigger mode everytime you connect to the camera as part of the initialization process.

However, there is a mechanism in the program to synchronize capture with other events. The interval.exe program demonstrates exactly that. If you control your linear stage from the computer, you can send a signal to the SpectrumAnalyzer program to acquire a spectrum and save it to the PC every time you position the stage at a given location.
ced
Posts: 7
Joined: Mon May 20, 2024 4:29 pm

Re: GPIO activated capture

Post by ced »

Hi Luc,

Thanks' for your answer!

So all is needed is to edit out the software trigger mode in the main code? Or would the acquisition sequence need to be rewritten?
I try running interval program but it return a critical error: "Cannot find icon!" Not sure where this is coming from.

F5 keystroke seem simple enough! although the original idea was to get the instrument to control the acquisition.. I suppose I could emulate a keyboard :D

At least there is the option!
User avatar
Luc
Site Admin
Posts: 131
Joined: Fri Mar 17, 2023 9:18 am
Contact:

Re: GPIO activated capture

Post by Luc »

It's a bit more complicated because there is no mechanism inside the software to record spectra as they are triggered by the hardware. Changing the Trigger mode from Software to Hardware will block the acquisition until the trigger is received but you will have to start the acquisition process yourself and save the resulting data afterwards.

About the icon issue, here is a fix:

// set icon of program
try
{
this->m_iconSmall = ImportedIcon("%SystemRoot%\\system32\\accessibilitycpl.dll", 16, 339);
this->m_iconLarge = ImportedIcon("%SystemRoot%\\system32\\accessibilitycpl.dll", 48, 339);

SendMessage(getWindowHandle(), WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)this->m_iconSmall.getIcon());
SendMessage(getWindowHandle(), WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)this->m_iconLarge.getIcon());
}
catch (...) {}

in virtual void init(void) I just added the try catch block.

I put the new program in attachment
Interval.zip
(125.21 KiB) Downloaded 97 times
ced
Posts: 7
Joined: Mon May 20, 2024 4:29 pm

Re: GPIO activated capture

Post by ced »

Hi Luc,

Thanks' for the explanation!

The amended Interval software work!

Have a great day!
Post Reply