[help]How to send trigger in psyshopy via parallel port?

device version:
psychopy v2023.2.3
neuroscan+win10

Previously I was writing the code via matlab, also with trigger marking via the parallel port. I am not familiar with psychopy especially here parallel port marking trigger.
Matlab part of the code:
lpt_address = 53264;
nrchannels = 2;
freq = 512;

%
for i = 1:length(movement_order)
% mark
switch movement_order(i)
case 1
mark_code = 1;
case 2
mark_code = 2;
case 3
mark_code = 3;
case 4
mark_code = 4;
end
lptwrite(lpt_address, mark_code);

What I want is to mark a corresponding label for each auditory stimulus (limited) that is produced, how do I do this, is there a simple example please?

Hi There,

In the most recent release of PsychoPy there are some demos in the app to help with this under the Hardware section in Builder View.

You also might find these slides and these docs pages on communicating with external hardware helpful.

Becca

I have made some progress. I’ve been able to send the appropriate tags at the start of the stimulus (there are four of them 1, 2, 3, and 4). I guess it’s probably my device (neuroscan) that needs to send 0 before sending the label. now I’m wondering how to send the label twice in the same frame (before stimulus onset, after stimulus end).

Use the code component:
Starting the routine with my settings, the
stimulus_pulse_started1 = False
stimulus_pulse_ended1 = False
parallel.setData(0)
In each frame one.
If name_wav1.status == STARTED and not stimulus_pulse_started1:
if stim_type1 == 1:

        parallel.setData(1)
    elif stim_type1 == 3:
        
        parallel.setData(3)
    stimulus_pulse_started1 = True
elif stimulus_pulse_started1 is not stimulus_pulse_ended1:
     parallel.setData(0)
    stimulus_pulse_started1 = True elif stimulus_pulse_started1 is not
    stimulus_pulse_ended1 = True

The result of this is that the classification labels at the beginning of the stimulus are realized, but the labels at the end of the stimulus do not have the expected effect

The labels are shown