010-53352947
































While network-based socket synchronization (as previously described in theCortiview-EPrimeSynchronization) is becoming more and more popular due to its convenience, but in many long-established ERP (event-related potential) laboratories, and even in some scene-specific near-infrared systems, the parallel port is still the classic method for precise synchronization of stimulus events and signals. It is like a "highway" that passes signals directly through the hardware interface. To navigate this road.The following principles must be observed:




Principle 1: Mark needs to rely on physical objects



The key concept in using parallel Marks in E-Prime is that each Mark signal must be "attached" to a specific, visible (or logical) physical object at program runtime.

The two main approaches and their dependencies:

1. OnsetSignal method (recommended and preferred):

Principle:Use the properties window of the E-Prime object (e.g. Slide picture stimulus, TextDisplay text, SoundOut sound) itself to send Marks. usually set in the Properties -> General or Port tab of the object.

Core dependencies: TheAn entity object must be bound! For example, to hit a Mark when a particular image stimulus starts to be presented:

1. Select the ImageDisplay object.

2. Find an option like OnsetSignal, OnsetPort, or Marker in Properties.

3. Fill in the corresponding Mark value.

Pros:High stability! Signaling is tightly bound to the object's lifecycle (e.g., event points such as start of presentation, end of presentation, key response, etc.) and is less likely to be missed. Timing accuracy is usually better.

Common Misconceptions:Do not use commands like OnsetSignal in an isolated Inline script object! Inline itself is not an entity object that has an explicit start moment at runtime (unless it is immediately followed by an entity object such as Wait to carry it).

2. WritePort method:

Principle:Active control of the parallel port output is accomplished by calling a WritePort statement (e.g., WritePort &H378) in an Inline script.

Dependencies:The WritePort statement can be placed in any Inline script and does not need to be directly bound to a specific stimulus object.

Major Hidden Dangers:

Hardware compatibility issues:The hardware implementation of the parallel port varies greatly from one computer motherboard to another, and the timing and reliability of the WritePort command execution may vary from machine to machine.

Leak Mark Risk:In practice, especially when the experiment process is complex, time is tight, or the computer load is high, the WritePort statement may be accidentally skipped or delayed in execution, resulting in Mark not hitting or hitting at the wrong time.




Principle II: Digital fencing of Mark values



The signal sent by the parallel port hitting Mark must itself be a specific number, and that number is limited to a specific range.

Core rules:

It has to be digital:Mark values can only be integers (1, 2, 3, ..., 255). Letters (e.g. A), symbols (e.g. #) or strings (e.g. Target) can never be recognized and recorded as valid Mark signals via the parallel port.

Scope Limitations:1-255;

Hardware limitations:The parallel port is an 8-bit digital interface. That is, up to 256 different state values (0-255) can be transmitted at a time.

Digital Exclusion Zone: '0' is usually used to "Reset" the port state before starting an experiment or after a critical node!




Principle 3: Never repeat Mark



Each Mark number in parallel port synchronization carries a specific meaning, and duplicate Mark codes can lead to confusion in locating events at a later stage!

Core principles:

1. stimulus type Mark:Absolutely unique! Mark values used to identify different experimental conditions can never be duplicated.Example:

11 = Neutral picture

7 = Positive Pictures

... Each condition must have an exclusive unique number.

2. Reaction positive and negative Mark:Independent and unique! If you want to analyze the signals of "correct response" and "incorrect response" trials separately:

The Positive and False Marks themselves need to be unique; at the same time, the Positive and False Marks must never be duplicated with any stimulus type Mark!

3. Stimulus ID:Try to avoid repetition.

Ideally: the total number of trials for the experiment is no more than 255, and try to give each trial a unique stimulus number Mark. so that each trial can be accurately tracked at a later stage.

Realistic challenge: the number of trials is well over 255. at which point the stimulus number inevitably needs to be recycled and reused.

Overrun Response Strategies:

Combined with the behavioral log: When it is necessary to remove specific trials based on stimulus number, it must be combined with the chronological order of the experimental run and the subject's behavioral response data file.

Exact match:In behavioral data, each trial is usually recorded with its presentation order number and stimulus number. In post-processing, this combined timestamp+stimulus ID+behavioral response information needs to be used to locate the exact point in time in the data when the corresponding Mark appeared in order to accurately delete or mark the trial with a specific duplicate number.




Principle 4: Zero Mark in time after playing it.



Parallel port hit Mark is not cleared in time, which can lead to superposition or confusion of Mark values.

Core issues:The parallel port state is holdover. The port level is not automatically reset after sending a Mark.

Solution:

Immediately after the Mark is sent, a Reset operation is performed. Immediately after the Mark is sent, a Reset Mark is sent in the Task Events of the same entity object, or in the OnsetSignal property of a short buffer/waiting screen immediately following the object, with a value of zero.

Inline Script Zeroing Method (use caution):Immediately following the Inline that sends a valid Mark is another Inline object. There is one and only one line of code in this clear Inline: WritePort &H378, 0

('WritePort &H378' specifies to write data to the parallel port (the specific address has to be confirmed according to the computer setting).' , 0' indicates writing value 0, i.e., clearing signal.)

The stability of parallel port playing Mark directly affects the accuracy of subsequent data analysis. Following the principle of entity dependence + instant clearing + unique numbering and prioritizing the adoption of the OnsetSignal method can significantly reduce the risk of data anomalies and make every time-locked signal clear, accurate, and reliable, paving the way for the subsequent in-depth exploration of brain mysteries!




If there is any infringement, please contact us for removal!










Company Profile

Ltd. is an innovative high-tech enterprise focusing on cutting-edge technology, specializing in brain science, neural management, human factors engineering, biomechanics, anthropomorphic environments and XR simulation reality and other multidisciplinary cross-cutting fields. The company is invested by Zhongke (Guangdong) Science Group, relying on the scientific research strength of Guangdong Human Factors Technology Research Institute and Wuhan Human Factors Engineering Technology Research Institute, and has constructed a professional operation system integrating research and development, production, sales and technical service to provide customers with one-stop, high-quality scientific and technological solutions.

With excellent innovation ability, Hengbest Technology has been awarded many invention patents, software copyrights and registered trademarks, selected in many authoritative lists such as National High-tech Enterprises, and participated in the compilation of national standards and group standards. The company has been serving universities and research institutes for a long time, and has cooperated deeply with many national societies such as the Chinese Society of Ergonomics, the Chinese Psychological Society, the Architectural Society of China, etc. The company organizes and participates in more than 40 academic conferences every year to promote technical exchanges and the development of the industry.

恒挚 Technology upholds the concept of "doing our part for the cause of scientific research", and is committed to becoming a leading scientific research-supporting science and technology enterprise, contributing to the progress of national science and technology and social development, and joining hands with partners from all walks of life to achieve a better future empowered by science and technology.



















Scan the code to follow us


















en_USEnglish