Serial Port Object

OS: Win11, PsychoPy Ver: 2024.2.4:

Hi,
Using a Serial OUT component, I try to send the following strings in one routine on COM2:

  • at 0 s: "O50E" via Serial1 components
  • at 3 s: "C50E" via Serial1
  • at 3.5 s: "O52E" via Serial2
  • at 5.5 s: "C52E" via Serial2

These are commands to control Arduino ports driving valves. I can successfully send the messages at 0 s and 3 s, but as soon as I add a second Serial OUT component for the command at 3.5s and 5.5s, I see a strange behavior: only the 0 s and 5.5 s commands go through (i.e. the start data of the first serial1 component the stop data of the serial2).

Am I using the Serial OUT component incorrectly?

(I can get everything working well using Python code, but I’d like to be able to do it with components, to make it simpler for my students who aren’t very familiar with programming.)

Thanks
Daniele

Hello @Daniele_Rov

serial1 sends data for 3 seconds, while serial2 sends data for 2 seconds. Could they simply overlap and interfere with each other? Do you need to send the data for that long? I usually set the duration to 0.01.

Best wishes Jens