////////////////////////////////////////////////////////////////////////
/// Brain slice - Robot Training/Testing Protocol  
/// --------------------------------------------------------------------
/// version 3.1 (02.20.2026)
/// *This program is based on official SDK of MultiChannelSystems
///  https://github.com/multichannelsystems/McsUsbNet_Examples
////////////////////////////////////////////////////////////////////////

*This read me file gives the stepwise instructions to do "Priming", "Training" and "Test". 
*The description is divided in 5 sections to do system preparation, connection, priming, training and test.
*To run this program the system should have the following specifications both Windows11/Linux OS.



////////////////////////////////////////////////////////////////////////
/// 1. Preparation of programs and systems
/// --------------------------------------------------------------------

1.1. Connect required system
-computer1(Linux) - Shadow hand(robot)
-computer2(Windows) - MEA
                    - keyboard
                    - microphone
-computer1 -ethernet- computer2

1.2. Run "ciborg-shadowhand-control-master" in computer1

1.3. Run "MEA_Recording.exe" in computer2

*Change IPaddress and port number on MEA_Recording>Form1.cs>"UDP setting" section depends on computer1's setting
 

////////////////////////////////////////////////////////////////////////
/// 2. Connect to MEA
/// --------------------------------------------------------------------        

On an application window of MEA_Recording_Example,

2.1. "Data Selection Method" > choose "SetSelectedData"

2.2. "Data Mode" > choose "Signed_32bit"

2.3. Click "MEA Device present?"
 >if MEA is connected correctly, you can choose Device type from right pull-down box.

2.4. Click "Stimulator Connect?"
 >if MEA is connected correctly, message box will appear.

2.5. Choose 6 electrodes for M1,M2,M3 and S1,S2,S3


////////////////////////////////////////////////////////////////////////
/// 3. [Protocol] Response test (give 10 stimulations for each electrode
/// --------------------------------------------------------------------    

3.1. Fill "Brain-" name and "Day-" number, and choose the numbers of M1-S3 electrodes

3.2. Click "Set Electrodes Combination"

3.3. Click DAQ "Start"

3.4. Click "10Test Start" 
 >result file is created in bin>x64>Debug folder like "P3920_172452M1".

3.5. After completion message box showing up, click DAQ "Stop"


////////////////////////////////////////////////////////////////////////
/// 4. [Protocol] Priming and Training (give paired stimulations for each electrode)
/// -------------------------------------------------------------------- 

(4.0. make sure 3.1.-3.2. are done)

4.1. Check "Triple" or "Mix" of training mode
 >Triple for only DAY0 (Priming)
 >Mix for from DAY1- (Training)

4.2. Click DAQ "Start"

4.3. Click "Learning Start"
 >if you want to do training without robot movement, click "Training Start" in "Training and Test without Robot" section.

4.4. After completion message box showing up, click DAQ "Stop"


////////////////////////////////////////////////////////////////////////
/// 5. [Protocol] Test
/// -------------------------------------------------------------------- 

(5.0. make sure 3.1-3.2. are done)

5.1. Drag files which created in Response test phase to "RefListBox
-RefListBox < -S1max (first response test of Day1)
              -S2max (first response test of Day1)
              -S3max (first response test of Day1)

5.2. Click "Set reference"

5.3. Click "Sound record start", play some notes, and click "Sound record stop"
>if the sounds are not well recognized, you can click "Set sample" instead.

5.4. Click DAQ "Start"

5.5. Click "Play music for brain"

5.6. After completion message box showing up, click DAQ "Stop"

5.7. Again click DAQ "Start"

5.8. Click "Robot Playback Start"

5.9. After completion message box showing up, click DAQ "Stop"










