How do I read ECG values and send them to an EEG device via Psychopy?

If this template helps then use it. If not then just delete and start from scratch.
(e.g. Win10):
PsychoPy version (latest):
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:

How do I read ECG values and send them to an EEG device via Psychopy?

Is there a tutorial or instruction?
please help me

Part of the picture is as follows:
I set up an ECG output signal (control) in the physiological polyguide software. But,How do I read ECG values and send them to an EEG device via Psychopy?

The place to start is by looking at the manuals for both systems and seeing what communications protocols they support. There are very many ways in which devices like these work - come back to us with the details of each system and how they both send and receive data.

Also exactly specify what data you want to receive and what you then want to send on - e.g. are these just timing events (e.g. to synchronise the EEG and ECG), or an actual data stream (which is what your question currently implies)? What format does the EEG expect? How will each system be physically connected to your computer (e.g. by serial or parallel cables), or by a networking protocol over ethernet or wifi?

Thank your reply!

Please check to see if this is correct when my psychopy reads the PIN and sends it to the EEG device

import time
#from ctypes import windll
from psychopy import parallel

#P = windll.inpoutx64
port = parallel.ParallelPort(address=0x0378)
port.setData(0)


def SendPin(code):
    read = port.readPin(2) # Read the pulses from the physiological polyguide
    port.setPin(2, 1)
    P.Out32(0x0378, code)  # send the event code (could be 1-255)
    time.sleep(0.005)  # wait for 5 ms for BP to receive the code
    P.Out32(0x0378, 0)  # send a code to clear the register
    time.sleep(0.005)  # wait for 5 ms
  • So both devices are sharing the same parallel port?
  • What is this code intended do? It seems to read a value from the serial port but then doesn’t subsequently do anything with it (i.e. regardless of what is read, it will try to send the value code).

Again, as above, you really need describe exactly what you want to achieve, in plain language rather than in code.