Multiple Trigger Codes from E-prime to Brain Vision Recorder
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Multiple Trigger Codes from E-prime to Brain... Expand / Collapse
Author
Message
Posted 4/10/2008 7:18:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/26/2008 6:07:46 AM
Posts: 4, Visits: 16
Hi

I am using eprime alongside Brain Products BrainVision software and I am having problems sending trigger codes. I want to be able to send 20 different trigger codes but when I use the following code:

If c.GetAttrib("Value") = "10" Then
WritePort &H378, 1
ElseIf c.GetAttrib("Value") = "20" Then
WritePort &H378, 2
ElseIf c.GetAttrib("Value") = "30" Then
WritePort &H378, 3

......

ElseIf c.GetAttrib("Value") = "180" Then
WritePort &H378, 18
ElseIf c.GetAttrib("Value") = "190" Then
WritePort &H378, 19
ElseIf c.GetAttrib("Value") = "200" Then
WritePort &H378, 20
End If

it gives the following sequence of trigger codes

s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, r1, s1, s2, s3, s4, s5, s1, s2........

I know it is something to do with hexadecimal values, but cant figure out what I need to output to get s1, ..., s20 rather than what I have above. Any help would be greatly appreciated

Thanks

Paul
Post #1470
Posted 4/10/2008 9:20:20 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: 2 days ago @ 8:55:28 AM
Posts: 536, Visits: 1,158
I think there is just a translation going on that needs to be deciphered.  Unless the documentation they provide already has it, you can determine some additional info by trying more values so the sequence can be deciphered.  Try running the following script and report back ALL of the values retrieved.  From there either myself or another forum member may be able to assist.  The code below is just basicallly walking through all values that an 8-bit data value can hold from 0 to 255.  I've put a clear zero in there in the event that the software needs a low transition to accept the change.  Thus, you'll either likely get 256 values or 512 values.  Please send them all back.  If your result is too large, you can optionally dump it in a .txt file and attach to the forum thread.

Dim x As Long
For x = 0 To 255
 WritePort &H378, x
 Sleep 10
 WritePort &H378, 0
 Sleep 10
Next 'x

Post #1471
Posted 4/10/2008 11:02:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/26/2008 6:07:46 AM
Posts: 4, Visits: 16
Thanks for getting back to me. I have run the script and attached a copy of the marker (trigger code) output file.

Paul


  Post Attachments 
testoutputmarkers.txt (10 views, 14.18 KB)
Post #1472
Posted 4/11/2008 9:18:15 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: 2 days ago @ 8:55:28 AM
Posts: 536, Visits: 1,158
From the values reported, it appears that you can have 15 unique Stimulus (S) values and 15 unique Response (R) values.  So you can only have a total of 30 unique values.

If you send values 1 - 15 to the port you'll result in S1 through S15 values.  If you take 1 - 15 and multiply that by 16 and send to the port you'll get R1 through R15 values.

You could possibly obtain more unique values by analyzing the data and determining which values ocurred at the same time stamp and the massaging those back into a binary representation but I that may be more effort than what it is worth and error prone.  I would suggest advice from the manufacture if you go that route.

To take your example you initially had, it appeared the values needed to be divided by 10 to get the root value.  So you could do something like the following to get 30 transitions.  Any attempts to go higher than 30 would result in multiple S/R combinations to appear.

Dim nValue As Long
nValue = c.GetAttrib("Value") / 10

If nValue >= 1 And <= 15 Then
 WritePort &H378, nValue
ElseIf nValue > 15 And <= 30
 WritePort &H378, (nValue * 16)
End If

Post #1478
Posted 4/14/2008 9:41:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/26/2008 6:07:46 AM
Posts: 4, Visits: 16
Thanks so much, that worked and has solved my problem. Thanks again

Paul
Post #1480
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 2:56pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 11 queries. Compression Disabled.