Professional Documents
Culture Documents
CIS Communications Protocol
CIS Communications Protocol
The CIS is composed of multiple programs. The programs that provide feedback
interfaces are referred to as CIS “titles”, not “games”. This is because feedback
interfaces may, or may not, be “game-like”. Some interfaces could include task
challenges very much like a neuropsyche test.
A CIS title acts as a server receiving commands via TCP on port 1001. Once the
acquisition system has connected to this port, it will be able to send commands to the
CIS, as well as receive data that’s intended for UI support. Optionally, the data sent by
the CIS title to the acquisition system doesn’t have to be acted upon, but it does facilitate
a way for a system manufacturer to mirror the UI found in the CIS icon (located in the
system tray when a CIS title is running) in whatever form deemed most appropriate for
integration into the acquisition system’s own UI. The UDP connection is unidirectional
(acquisition system sending values to the CIS title), and is made on port 1003. An .ini
file is used to determine/set the IP address the acquisition system should use to contact a
CIS title. This .ini file is named “installed titles.ini” and can be found in
C:\BeyondVR\initialsOfTheAcquisitionSystem. The entry is “gamecomputer”, under the
[Setup] section. If “gamecomputer=local” then the acquisition system and the CIS are on
the same computer, and an IP address of 127.0.0.1 (loopback) should be used.
The CIS includes an application called the “Internal Signal Generator” (ISG). This
application is a “fake” acquisition system that sends simulated data to CIS titles. This
makes it possible for users to get familiar with using the CIS titles and the multitude of
feedback interfaces, without having to use a real biofeedback system (though it looks
similar to one). The ISG uses the specification laid out in this document, so it is a good
example to turn to for implementation ideas.
SETUP
CIS titles are installed to specific predetermined (at this time) directories. The directory
structure is C:\BeyondVR\initialsOfTheAcquisitionSystem\nameOfTitle. Currently, .ini
files are used to control a number of things related to the operation of CIS titles, and these
files are located in the directory where the title was installed. In this section of this
document, references to files or folders are relative to the install directory of the CIS title
unless explicitly noted otherwise.
When a CIS title first starts, it will automatically display the feedback interface it last
used. The file named “interface-initialsOfTheAcquisitionSystem.ini” contains two entries
under the “Setup” section that can be used to set some interface startup preferences.
1) interface= name of file The name of the interface to start up with. The interfaces are
found in the folder named “interface”, and end in the extension .wrl.
2) currentUser= a user’s id If this entry is modified before the title is started, the title
will use and save user defaults. This makes it possible for the title to start up with the
interface the client last used, instead of whatever the title last used. The interface
defaults for users are automatically stored in “patient settings.ini”.
Note: The file named “interface-ISG.ini” works in the same manner as the file named
“interface-initialsOfTheAcquisitionSystem.ini”, but it is for the Internal Signal Generator
(do not modify it).
Once feedback begins, objects in the scene will begin to respond. Training should be
broken down into “periods”. After a period is over, a report screen will be displayed,
showing the user’s progress. This cycle continues until the training is complete. A
period can be defined in any way – it’s up to the acquisition system to decide what
constitutes a “period”. A period could be based on time training, points earned,
physiological criteria, etc….
EXIT=0
Tells the title to close.
PAUSE=boolean
Tells the title to temporally stop/start keeping track of how much time is spent
training. This info is used by some of the report screens. Total time training, and time
spent training during each period is kept track of.
Example:
'determine the reinforcement value
If FSreinforcementType(stream) = "INHIBIT" Then
FSreinforcement(stream) = FSthreshold(stream) / FSamplitude(stream)
If FSreinforcement(stream) >= 1 Then 'Succeeding
FSreinforcement(stream) = (FSreinforcement(stream) - 1) * 1
If FSreinforcement(stream) > 1 Then FSreinforcement(stream) = 1
Else 'Failing
FSreinforcement(stream) = (1 - FSreinforcement(stream)) * -1
If FSreinforcement(stream) < -1 Then FSreinforcement(stream) = -1
End If
ElseIf FSreinforcementType(stream) = "AUGMENT" Then
FSreinforcement(stream) = FSamplitude(stream) / FSthreshold(stream)
If FSreinforcement(stream) >= 1 Then 'Succeeding
FSreinforcement(stream) = (FSreinforcement(stream) - 1) * 1
If FSreinforcement(stream) > 1 Then FSreinforcement(stream) = 1
Else 'Failing
FSreinforcement(stream) = (1 - FSreinforcement(stream)) * -1
If FSreinforcement(stream) < -1 Then FSreinforcement(stream) = -1
End If
End If
REPORTSCREENTYPE=typeOfReport (string)
typeOfReport= bargraph-points, bargraph-points and achievements, bargraph-
points and time, bargraph-points achievements and time, bargraph-achievements
and time, picture
Defines the type of report screen to display. Send this command before sending
the “SHOWREPORT=True” command. It should be noted that some report screens are
not appropriate to use under certain circumstances. If the biofeedback software is
determining periods by a set amount of time, it’s kind of silly to use a report showing the
amount of time elapsed each period – it’s always the same and would just add useless
info the report screen. If the biofeedback software is advancing periods based on a set
number of points it isn’t informative to display a report screen after period showing them
they got 100 points every period. Chose a report screen type that is the most informative
without displaying irrelevant information. The report type called “picture” display the
points, achievements, and period info, but will not generate bar graphs.
SHOWREPORT=boolean
Tells the CIS to display, or stop displaying, a report screen for the completed
periods of training.
INTERFACELIST=0
Requests a list of available feedback interfaces. Each name in the list is separated
by a CHR(13) character (enter key).
INTERFACEDESCRIPTION=0
Request a refresh of the loaded feedback interface’s description. The description
is automatically sent whenever an interface is loaded, but some variables may change
during training.
GETPREVIEW=string
Returns a simple description of what an interface does. The name of the interface
needs to be a valid name returned by the “INTERFACELIST=0” command. The
interface doesn’t have to be loaded to get the short preview description.
LOAD=string
Load the feedback interface named “string”. Must be a valid interface name.
COMMAND=string
The feedback interfaces can accept various different commands. These
commands may be different from one interface to the next. Sending an invalid interface
command will not result in an error (nothing will happen). Interface commands are not
case-sensitive.
Interface commands should be able to be typed in a text field and sent by the user
by pressing a button or hitting enter.
GCOMMANDS=0
This command will request a list of the default commands for the currently loaded
interface. Each feedback interface can have its own set of commands that are
automatically executed by the CIS every time the interface is loaded, including when an
interface is immediately loaded after the display of a report screen.
DCOMMANDS=string
For sending an updated list of default commands (see GCOMMANDS) for the
currently loaded feedback interface. The CIS automatically saves this list of commands
to an .ini file specific to the feedback interface. Each command must be separated by
CHR(13) & CHR(10). This particular character combination tells a textBox object (in
Visual C++ or Visual Basic) to advance a line without showing a strange character. This
makes it possible to take the string and send it directly to a textBox and have it displayed
properly.
POINTSSUCCESSTIME=single
The amount of time that must elapse, while meeting all success criteria, in order
for a point to be awarded.
POINTSFAILURETIME=single
The amount of time that can elapse, while not meeting all success criteria, before
the accumulated success time for a point (see above) is reset back to 0.
ACHIEVEMENTSSUCCESSTIME=single
The amount of time that must elapse, while meeting all success criteria, in order
for an achievement to be awarded.
ACHIEVEMENTSFAILURETIME=single
The amount of time that can elapse, while not meeting all success criteria, before
the accumulated success time for an achievement (see above) is reset back to 0.
LONGTERMPOINTS=single
The number of points to elapse for each long term reward event.
The commands in this section can also be sent by the user via the Interface Command
feature accessed by the CIS icon. The ability to do so is an undocumented feature (other
than in this documentation). The commands that are accepted in the command field are
PST=, PFT=, PRR%=, AST=, AFT=, ARR%=, LTP= along with the appropriate value.
People who wish to use customized success criteria every time a particular feedback
interface is used, can put these interface commands in the “commands-
interfaceName.cfg” file.
POINTSINDICATOR=boolean
ACHEIVEMENTSINDICATOR=boolean
PERIODINDICATOR=boolean
FRAMERATEINDICATOR=boolean
Tells the title whether or not to display the various HUD indicators. Turning off
the FrameRate indicator is not recommended because it lets the clinician know if their
hardware is not able to render the 3D scene in a timely manner.
CDI=boolean
Determines whether or not the feedback interface modulates the playback volume
of CD audio based on feedback criteria, or if the CD should simply play the music
without it being tied to feedback criteria. Interfaces define the dynamic characteristics of
the CD volume modulation. Default is for the interface to control CD volume.
CDRT=boolean
Repeat/loop the track currently playing.
CDVOLUME=integer
The maximum volume for CD playback. Note that this is the maximum volume,
so it is the loudest that playback will be if the CD volume is controlled by the feedback
interface. This makes it possible to easily control the CD volume in relation to the other
sounds in the feedback interface. If CD volume is not set to be controlled by the
feedback interface (CDI=False) then this value will set the actual volume.
FRAMERATE=0
Requests the 3D engine’s current display framerate. This can be used in
conjunction with the CPU command to further optimize system performance.
DATARPS=0
Number of times per second the CIS should send incoming data into the scene
graph. This is NOT the amount of times per second the scene graph refreshes to the
screen (framerate). This facilitates asynchronous communication to a CIS title via the
UDP connection.
SNAPSHOT=string
Tells the CIS title to take a screen shot of what’s in the feedback interface
window. Specify a name to save the picture as. The picture will be saved in the folder
that the CIS title was installed in. Picture format is JPEG. Do not add the extension
name (.jpg) to the file save name.
RECEIVED COMMANDS
EXIT=0
The title was closed
P=integer
The current number of points. This is sent every time a point is earned.
A=integer
The current number of achievements (a type of “higher order” points). This is
sent every time an achievement is earned.
PR=integer
The current training period. Sent at the beginning of every training period.
INTERFACE=string
The name of the currently loaded feedback interface. This is automatically sent
every time an interface is loaded, including when an interface is automatically loaded
after displaying a report screen.
IDESCRIPTION=string
A full description of how the currently loaded interface functions (no need for the
user to locate a manual). This is automatically sent whenever an interface is loaded,
including when an interface is automatically loaded after displaying a report screen.
PREVIEW=string
A short description of how an interface works. This command is received after
the GETPREVIEW command was sent. GETPREVIEW / PREVIEW combination is
useful for a dialog box listing the available feedback interfaces. Suggested use - A user
can get a short description of an interface they click on without having to actually load it
to get the full description (IDESCRIPTION).
INTERFACELIST=string
A list of available feedback interfaces. This list is returned when the
INTERFACELIST=0 command is sent. The name of each interface is separated by
CHR(13).
#S=integer
The number of feedback streams the currently loaded interface supports.
Automatically sent whenever a feedback interface is loaded. It is very important for the
number of feedback streams supported by the currently loaded interface to match the
number of feedback streams currently being sent by the biofeedback software.
DCOMMANDS=string
This string is returned after the GCOMMANDS command was sent. Each
command is separated by CHR(13) & CHR(10). This particular character combination
tells a textBox object (in Visual C++ or Visual Basic) to advance a line without showing
a strange character. This makes it possible to take the string received and send it directly
to a textBox and have it displayed properly. The list of commands can then be edited in
the textBox by the user and should be automatically sent back to the CIS so that it can be
updated (via the DCOMMANDS sent command) when the user is done editing/looking at
the list.
POINTSSUCCESSTIME=single
The amount of time that must elapse, while meeting all success criteria, in order
for a point to be awarded.
POINTSFAILURETIME=single
The amount of time that can elapse, while not meeting all success criteria, before
the accumulated success time for a point (see above) is reset back to 0.
ACHIEVEMENTSSUCCESSTIME=single
The amount of time that must elapse, while meeting all success criteria, in order
for an achievement to be awarded.
ACHIEVEMENTSFAILURETIME=single
The amount of time that can elapse, while not meeting all success criteria, before
the accumulated success time for an achievement (see above) is reset back to 0.
LONGTERMPOINTS=single
The number of points to elapse for each long term reward event.
DTRAININGCRITERIA=string
A comma-delimitated list of values specifying the default training criteria for an
interface. The values are in this order: points success time, points failure time, points
random reward%, achievements success time, achievements failure time, achievements
random reward%, long term reward for points
REPORTSHOWING=boolean
Sent by the CIS when a report screen is first displayed, and when it’s unloaded.
POINTSINDICATOR=boolean
ACHEIVEMENTSINDICATOR=boolean
PERIODINDICATOR=boolean
FRAMERATEINDICATOR=boolean
Whenever the state of the HUD indicators is changed, the state is then transmitted
by the CIS. The user can change the state of the HUD indicators via the CIS icon in the
system tray, and it’s a good idea to make it possible for the user to be able to change it
from the biofeedback software as well.
CDI=boolean, CDRT=boolean
Whether or not the “CD controlled by the Interface” or “Repeat Current Track”
menu items of the CD playback menu are checkmarked.
CDTRACK=integer
The current track number of the CD that is playing.
FRAMERATE=single
This is returned whenever the FRAMERATE=0 command was sent.