Port code not working, how to add variables to data


Author
Message
Christin41
Christin41
Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)Associate Member (190 reputation)
Group: Forum Members
Posts: 12, Visits: 74
For an experiment I am using the following logic, to display all 5 odors in random order during the 5 different trials. Doing this with text elements also does work, when using this port code, however, only the first odor is presented (so only the first valve [together with the other two valves that that port code opens] is opened). Any idea what I did wrong? 
Also I was wondering how to add a variable to the data that displays what odor was presented to the participant during a given try?
Thank you so much in advance!!

This is the used port code: 
<item odor_items>
/ 1 = "01100001"
/ 2 = "01100010"
/ 3 = "01100100"
/ 4 = "01101000"
/ 5 = "01110000"
</item>

<port all_odors>
/ items = odor_items
/ port = LPT
</port>

<list all_odors>
/ items = (port.all_odors)
</list>

<trial rating>
/ ontrialbegin = [trial.rating.resetstimulusframes();
                 trial.rating.insertstimulustime(list.all_odors.nextvalue, 2850)]
/ stimulustimes = [0=port.air; 0=3; 1000=2; 2000=1; 3000=inhale; 5000=port.air]
/ timeout = 5000
/ pretrialpause = 1000
</trial>
(3, 2, 1 and inhale are all text elements, port.air is the same as the port code of item 5 in the item element)

And here the (working) text code:
<item odor_items>
/ 1 = "Fear1"
/ 2 = "Fear2"
/ 3 = "Neutral1"
/ 4 = "Neutral2"
/ 5 = "Air"
</item>

<text all_odors>
/ items = odor_items
/ fontstyle = ("Arial", 9%, true, false, false, false, 5, 1)
/ position = (50, 65)
/ erase = true(black)
</text>

<list all_odors>
/ items = (text.all_odors)
</list>

<trial rating>
/ ontrialbegin = [trial.rating.resetstimulusframes();
                 trial.rating.insertstimulustime(list.all_odors.nextvalue, 2850)]
/ stimulustimes = [0=3; 1000=2; 2000=1; 3000=inhale]
/ timeout = 5000
/ pretrialpause = 1000
</trial>
(3, 2, 1 and inhale are all text elements)


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search