加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

写mark-eprime注意事项

(2013-12-07 16:07:02)
标签:

e-prime

mark

分类: 脑科学_处理技术
nE-prime语句
nDispSample.OnsetSignalEnabled = True 
DispSample.OnsetSignalPort = &H378

刺激呈现时触发Mark

nDispSample.OnsetSignalData = c.GetAttrib("StimType")

为不同的实验条件设置不同的marker (整数,1 &nh; 255)

================================================= 

writePort &h378,0

sleep 1

writePort &h378,val(c.GetAttrib("con")) 

sleep 1 

---------- 

writeport &H378,0

sleep 1


if stimulus.ACC=1 then

writeport &H378,val(c.GetAttrib("con"))+10

sleep 1 

else 

if stimulus.RESP<>"" then

writeport &H378,val(c.GetAttrib("con"))+20

sleep 1

else

writeport &H378,val(c.GetAttrib("con"))+30

sleep 1

end if

 

end


val数值化处理,先归零再整你其他的

====================================================  


实例一:对图片反馈的mark, 蓝色的为通用语句;没有标记的为实验中,自己设定的控件名称。

pra.OnsetSignalEnabled = True

pra.OnsetSignalPort = &H378

 

 

If ImageDisplay2.ACC = 1 then

pracsinter.OnsetsignalData = 101

else if ((ImageDisplay2.ACC=0) and (ImageDisplay2.RT>0)) then

pracsinter.OnsetsignalData =102

else if ImageDisplay2.RT=0 then

pra.OnsetsignalData =100

else

pra.OnsetsignalData =0

 

end if

end if

end if

 

writeport &H378,0

=========================

实例二:对图片呈现的mark, 蓝色的为通用语句;没有标记的为实验中,自己设定的控件名称。

 

TextDisplay3.OnsetsignalEnabled = True

TextDisplay3.OnsetsignalPort = &H378

TextDisplay3.Onsetsignaldata = 9

writeport &H378,0

 

========

 

实例三:对图片呈现的mark, 调用了list里面的attribute(比如:如下调用了list里一个名为“kind”的属性);标蓝色的为通用语句;没有标记的为实验中,自己设定的控件名称。

 

Dim P <="" span="">

 

         P=c.GetAttrib("kind")

         ImageDisplay2.OnsetSignalEnabled = True

ImageDisplay2.OnsetSignalPort = &H378

ImageDisplay2.Onsetsignaldata = P

writeport &H378,0

 

 

 

========

实例四:对图片呈现的mark, 调用了list里面的attribute(比如:如下调用了list里一个名为“kind”的属性),并且在mark中对不同的attribute类型进行分类(比如:如下如果调用的是list里一个名为“kind”的属性;kind =12;那么mark则为:121122);标蓝色的为通用语句;没有标记的为实验中,自己设定的控件名称。

 

dim P <="" span="">

         P =c.GetAttrib("kind")

         TextDisplay1.OnsetSignalEnabled = True

         TextDisplay1.OnsetSignalPort = &H378

         TextDisplay1.Onsetsignaldata = P +120

writeport &H378,0

 

============

注意事项:

一。

TextDisplay1.OnsetSignalEnabled  ------表示的是:TextDisplay刺激呈现(OnsetSignal)那刻,打开得相应端口。

同样OffsetSignal则为刺激消失那刻的标记,但是需要注意in E-Prime parlance, stimulus "offset" does not mean either the end of stimulus presentation, nor the onset of the following stimulus; "offset" actually refers to when E-Prime stops executing code for that object and moves on to executing further instructions.

 

摘自

https://groups.google.com/forum/?fromgroups=#!msg/e-prime/nVGDGTfGnhk/9EZcFfi6EkwJ

 

PreRele value of 1-20 ms less than the Duration of the stimulus object.  E.g., for your object with a Duration of 500, set PreRele to 490.  Now your trigger will coincide exactly with the onset of your stimulus, and will t for 10 ms, when the "offset" of the stimulus occurs.

 

===============================================================================

Prerele是指提前准备刺激:我测试过此处为0100200的条件下RTmark中(刺激呈现时间mark(时间点)减去刺激反应时间mark(时间点);之后除以采样的Hz数即得出RT的秒数),这两个RT差值一般均为30ms-10ms不等,并求各种条件下的差值均值。均值都差不多。故我在实验中就没有Prerele

https://support.pstnet.com/hc/en-us/articles/229359587-INFO-How-do-I-send-a-signal-to-an-external-device-17212-

Detail
Support for sending a signal to an external device (e.g., another machine, EEG) is available in E-Prime via port communications or through writing your own Windows DLLs.
For port communications, a small amount of script must be used in an InLine Object. To send a signal to the port, you should use the WritePort command in an Inline in your experiment. The parameters for WritePort are follows:
WritePort address, value
The address of your port can be found by selecting "System" from the Windows Control Panel, clicking on the Device Manager tab, and navigating to Ports. Select the parallel (LPT or printer) port, click the Properties button, and select the Resources tab. The address of the currently accessible port will be shown.
In the WritePort command, the port address may be specified in decimal or hexadecimal notation. Ple refer to the Val function in the E-ic Help file for further explanation. When using hexadecimal notation, E-ic requires "&H" to be inserted prior to the address:


WritePort &Haddress, value

 


The most common parallel port address is (in decimal) 888, which translates in hexadecimal notation to 378. However, we strongly recommend that you refer to your own System properties to find the available port address on your own machine.
You must also remember that, when writing to the parallel port, you are sending 8 bits of data at once. For the WritePort command, the value parameter is translated into binary notation to determine the bit pattern. Since this binary representation corresponds to a specific bit representation, you must send a value which translates (in binary) to send the appropriate bit representation. Essentially, you should write a "1" to any bit whose corresponding pin you wish to turn "on." A "0" is written to any bit whose corresponding pin you wish to turn "off". If you were to send all "0"'s to the port, the binary notation for this would be 000000000. To send a signal to bit number '2', the binary notation would translate to 00000010.


The bit pattern then corresponds to the pin connections. Bits are either 0-ed or 1-ed. Pins are always 1-ed.*****Ple note: The first available bit to pin connection begins at bit number 1 and at pin number 2. You cannot send a signal to pin number one.


Therefore, if you wanted to turn on bit number one an a 1-ed bit pattern, and leave the rest off, you would send a signal of "1" to pin 2, and a signal of 0 to pins 3-9. In binary notation, this would be written 00000001. In decimal or hexadecimal notation, this would translate to "1". If your port address were (in hexadecimal) 378, the Write Port syntax for this would be:


WritePort &H378, 1

 


Bit to pin mapping is relatively standard for the parallel port. Ple refer to documentation for your hardware and/or port address for a mapping of bits to pins.
E-Prime is capable of sending a signal to the port for interfacing with an external device. The receipt and handling of the signal by the other machine is the responsibility of the user. With the WritePort command, E-Prime may be used to trigger an event (e.g., signal an external device to begin data acquisition) or notify an external device of an event (e.g., in order to mark the event in the data collected by the external device).


When sending more than a TTL pulse to the port, you must write your own Windows DLLs. The only information and/or support PST can offer is to direct you to the DECLARE statement in E-ic Help. Essentially, you can bring the library of calls from into E-Prime by copying and ting them into the User script of your experiment. In doing so, you will likely no longer use E-Prime's "WritePort" command for port communications, but will rather use the specific commands you have imported. Writing Windows DLLs is best done by a professional programmer, and is beyond the scope of PST's support for E-Prime.



This topic applies to:
E-Prime 1.0
E-Prime 1.1

E-Prime 2.0

 

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有