http://tech.dir.groups.yahoo.com/group/psychtoolbox/message/11961
Re: TTL triggers in Linux
--- In psychtoolbox@yahoogroups.com, Andre Cravo <andrecravo@...> wrote:
>
> Hello,
>
> I was wondering if there is an easy way to send TTL triggers via parallel
> port in Linux (I'm currently using Ubuntu 10.10).
>
> I have seen the LabJack options, but if I understood correctly you have to
> use a USB DAQ device for it to work. I was using the " lptwrite" command in
> Windows and I was wondering if there is something similar for Linux.
>
I've just uploaded LinuxParportServer.zip to the files section of the forum. It
should work ok, although there are better solutions to come. A proper
implementation will be part of the IOPort driver in a future PTB beta.
This one works as follows:
1. unzip the file.
2. Compile the .cpp C file into a binary via (terminal window):
gcc -O2 -o parallelPortServer parallelPortServer.cpp
3. Run the executable in that terminal as root, e.g.:
sudo ./parallelPortServer
4. The server will wait for commands over a UDP network port. This is where you
use the M-File ParportTTL.m in your matlab code:
At beginnning of your script:
ParportTTL('Open', 'localhost');
At end of your script:
ParportTTL('Close', 'localhost');
For changing the state of the output lines of the parallel port in your code:
tRoundTrip = ParportTTL('Set', level [, duration=inf]);
--> See help ParportTTL for the meaning of the parameters.
This was used for a study where the stimulation computer and computer with
parallel port where different machines, therefore the network server design. You
could do the same by setting the hostname of the machine with the parallelport,
instead of 'localhost' if everything is running on the same machine.
Timing accuracy on a normal working local network is about 1 msec if i remember
correctly, but 'tRoundTrip' will give you a good upper bound on timing error for
each invocation. Last tested over 1 year ago, where the parallel port computer
was a linux box and the stimulation computer was a Apple OS/X box, so i hope it
still works "as is" on a modern system.
As i said, a proper implementation will follow as part of IOPort in the future -
one would design this quite differently nowadays, this was just quick throwaway
code for a special EEG study on a very special setup, but for the moment this
should do...
best,
-mario
> Thanks in advance
>
> --
> Andre Cravo
> Post-hoc Fellow
> University of Sao Paulo-Brazil
>
没有合适的资源?快使用搜索试试~ 我知道了~
cjayb-kingjr_natmeg_arhus-archive-refs-heads-master.zip
共438个文件
m:299个
m~:84个
mat:17个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 29 浏览量
2023-08-09
18:20:10
上传
评论
收藏 4.61MB ZIP 举报
温馨提示
cjayb-kingjr_natmeg_arhus-archive-refs-heads-master.zip
资源推荐
资源详情
资源评论
收起资源包目录
cjayb-kingjr_natmeg_arhus-archive-refs-heads-master.zip (438个子文件)
paretofront.c 3KB
eeg257_ok.ced 16KB
parallelPortServer.cpp 9KB
eeg257_ok.csd 25KB
default.dat 391KB
.dropbox 47B
.sync.ffs_db 5KB
ktaub.html 41KB
LICENSE 1KB
pipeline.m 41KB
lake.m 40KB
distributionPlot.m 35KB
venn.m 34KB
PrintTable.m 28KB
multiprod.m 24KB
_ft_jr_ecg_ica.m 21KB
plotSpread.m 20KB
polarplot3d.m 18KB
ktaub.m 15KB
ft_jr_ecg_ica.m 14KB
interparc.m 14KB
egi_bad.m 14KB
mult_comp_perm_t1.m 12KB
myregr.m 12KB
vennX.m 12KB
ft_combineplanar_local.m 11KB
colAUC.m 10KB
artefact_find.m 10KB
t2x.m 10KB
data2psi.m 10KB
statfun_ranksum.m 10KB
freezeColors.m 10KB
Hungarian.m 9KB
XY3DDensityPlotView_ControlPanel.m 9KB
plv.m 9KB
ft_jr_art.m 9KB
mixed_between_within_anova.m 8KB
XY3DDensityPlotView.m 8KB
hatch.m 8KB
HartigansDipTest.m 8KB
ranksum_fast.m 8KB
textbp.m 8KB
rgb.m 8KB
x2t.m 7KB
convert2html.m 7KB
histogram.m 7KB
myErrorbar.m 7KB
signrank_fast.m 7KB
CSD.m 7KB
dpsimplify.m 6KB
inpoly.m 6KB
data2psi2.m 6KB
ft_jr_art_trialfun.m 6KB
_jr_classify_20130127.m 6KB
usercolormap.m 6KB
ft_jr_art_plot.m 6KB
regroup_chans.m 6KB
wilcoxon.m 6KB
plot_all.m 6KB
distinguishable_colors.m 6KB
munkres.m 6KB
signrank_diff.m 6KB
_jr_classify_stats.m 5KB
weightedStats.m 5KB
ft_jr_art_chan.m 5KB
plot_3D_links.m 5KB
MW2cv.m 5KB
jr_classify_stats.m 5KB
barWhiskerBridge.m 5KB
mat2R2.m 5KB
_jr_classify.m 5KB
wbicoh.m 5KB
mat2R__.m 5KB
_mat2R.m 5KB
jr_classify_example.m 5KB
mat2R.m 5KB
mwwtest.m 5KB
ellipsoid_fit.m 5KB
wordcount2.m 5KB
plotunevenData.m 5KB
allwords.m 5KB
svg2mat.m 4KB
rm_anova2.m 4KB
parseArgs.m 4KB
XY3DDensityPlotData.m 4KB
__jr_classify.m 4KB
bareb.m 4KB
chi2test.m 4KB
urlreadpost.m 4KB
jr_classify.m 4KB
repanova2.m 4KB
loadods.m 4KB
ParportTTL.m 4KB
artefact_trialfun_thresh.m 4KB
countEntries.m 4KB
ft_topoplotPlanars.m 4KB
wordcount.m 4KB
wordcountfile.m 4KB
build_tree.m 4KB
WSMI.m 4KB
共 438 条
- 1
- 2
- 3
- 4
- 5
资源评论
AbelZ_01
- 粉丝: 887
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功