<div dir="ltr">Dear Paul,<div><br></div><div>Thank you for your advice. </div><div><br></div><div>You were right, there was 'bouncing' at the end of the falling edge, which was in part, causing the problem and additional unwanted events. </div>
<div><br></div><div>I am only interested with the 'rising' and not the falling edges (which in my case does not have delay/bouncing issue), so I have found a way to work around the problem of the bouncing in the falling by re-programming some functions in EEGLAB (which remove the falling bounce).</div>
<div><br></div><div>I will also try using a parallel port and see if it is a better option.  </div><div><br></div><div>Regards,</div><div>Jodie <br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Paul Groot</b> <span dir="ltr"><<a href="mailto:pfc.groot@gmail.com" target="_blank">pfc.groot@gmail.com</a>></span><br>


Date: Tue, Jan 21, 2014 at 4:15 PM<br>Subject: Re: Serial USB relay: Adding time-stamps to EEG Recordings<br>To: <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a><br><br><br><div dir="ltr">

Hi Jodie,<div>
<br></div><div>I don't see why this should be an eprime issue? The logic behind your script is that there is an active digital signal when the stimulus is presented. Not sure how biosemi normally encodes those events, but if it encodes rising and falling edges seperatly, there is no way of preventing the additional marker at the end of the stimulus. However, I doubt if the digital interface with relays is the right way to conenct the two systems. Relays can cause delay and bouncing problems, so I would prefer a direct (TTL) connection from the stimulus computer to the biosemi trigger input(s). Normally this can be done using a parallel printer port or IO board. I would be very suspicious about a possible bouncing issue when the relay is switched off. Especially when using high sampling rates...</div>



<div><br></div><div>Best</div><div>Paul</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 21 January 2014 13:24, Jodie <span dir="ltr"><<a href="mailto:jodie@naimfeil.org" target="_blank">jodie@naimfeil.org</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Forum,<div><br></div><div>I am having a little bit of trouble with my USB relay setup. Essentially, I have a USB 4-relay board which I using to communicate between E-prime and Biosemi.</div>



<div>My plan is to timestamp in the EEG recording when the stimulus event is being shown. My current script is the following (which just opens and closes the USB relay):<br></div><div><br></div><div>This in-line is immediately before the stimulus presentation:</div>



<div>----------------------------------</div><div><div>Dim arrDataa(2) As Integer</div><div><br></div><div>arrDatag(0) = 255</div><div>arrDatag(1) = 1</div><div>arrDatag(2) = 1 </div><div><br></div><div>Serial.WriteBytes arrDataa</div>



</div><div>---------------------------------</div><div><br></div><div>Following by the Stimulus presentation</div><div><br></div><div>Then, this in-line is immediately after the stimulus presentation:</div><div><br></div>



<div>----------------------------------<br></div><div><div><div>Dim arrDatab(2) As Integer</div><div><br></div><div>arrDatag(0) = 255</div><div>arrDatag(1) = 1</div><div>arrDatag(2) = 0 </div><div><br></div><div>Serial.WriteBytes arrDatab</div>



</div><div>---------------------------------</div></div><div><br></div><div>The script works nicely and is able to time-stamp into the Biosemi recording. The problem is that while it works perfectly for when the <span style="line-height:18px">trigger code is sent (lets say a 64 time-stamp appears in the trigger of Biosemi), when I 'stop' the trigger (after the stimulus is presented), there is a time-stamp of 64 with a zero underneath in the Biosemi recordings. This is problematic for when I try to analyse the EEG data because </span><span style="line-height:18px">all of the start and stop events are saved as the same 64 time-stamps (it ignores the zero
below the 64 in the 'stop' time-stamp condition) and therefore, the 'stop' is considered the same event as the initiation of the time-stamp. </span></div><div><span style="line-height:18px"><br></span></div>



<div><span style="line-height:18px">I contacted Biosemi and they told me that the issue is with the scripting in E-prime. I was wondering if anyone had any suggestions for how to fix this problem? </span></div><div><span style="line-height:18px">It would be much appreciated!!</span></div>



<div><span style="line-height:18px"><br></span></div><div><span style="line-height:18px">I hope I have been clear?</span></div><div><span style="line-height:18px"><br></span></div><div><span style="line-height:18px">Thank you for your help.</span></div>



<div><span style="line-height:18px"><br></span></div><div><span style="line-height:18px">Kind regards,</span></div><div><span style="line-height:18px">Jodie</span></div><span><font color="#888888"><div><br><span><font color="#888888">
</font></span></div><span><font color="#888888"><div><br></div><p><u></u><u></u></p></font></span></font></span></div><span><font color="#888888"><span><font color="#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/577e23e0-1789-4442-865c-65aa4233fef7%40googlegroups.com" target="_blank">https://groups.google.com/d/msgid/e-prime/577e23e0-1789-4442-865c-65aa4233fef7%40googlegroups.com</a>.<br>




For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
</font></span></font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">

<p></p>

-- <br>
You received this message because you are subscribed to a topic in the Google Groups "E-Prime" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/e-prime/V1otSAPBtFQ/unsubscribe" target="_blank">https://groups.google.com/d/topic/e-prime/V1otSAPBtFQ/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/CAKAdR-tP3UO%3DADjg%3D2_R4bsuDs1tETJx%2BG86pNEi12u%3DWWATog%40mail.gmail.com" target="_blank">https://groups.google.com/d/msgid/e-prime/CAKAdR-tP3UO%3DADjg%3D2_R4bsuDs1tETJx%2BG86pNEi12u%3DWWATog%40mail.gmail.com</a>.<br>



For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
</font></span></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="arial, helvetica, sans-serif">Dr.Jodie Naim-Feil</font><div><font face="arial, helvetica, sans-serif">Post-doctoral Fellow</font></div>


<div><font face="arial, helvetica, sans-serif">Research group of Elisha Moses</font></div><div><font face="arial, helvetica, sans-serif">Department of Physics of Complex Systems</font></div><div><font face="arial, helvetica, sans-serif">Weizmann Institute of Science</font></div>


<div><font face="arial, helvetica, sans-serif">76100 Rehovot, Israel<br></font></div></div>
</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/CAMr6WnORYJqsLOwoeR_j_1gOnSnn8T6ytGWMLHDZnomG-VbgDQ%40mail.gmail.com">https://groups.google.com/d/msgid/e-prime/CAMr6WnORYJqsLOwoeR_j_1gOnSnn8T6ytGWMLHDZnomG-VbgDQ%40mail.gmail.com</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />