DMDX Help.


Output Keyword

<Output N1 [signalname]>
<o N1 [signalname]>
<op N1 [signalname]>
<Output designator [signalname]>
<o designator [signalname]>
<op designator [signalname]>

counter designators:
counter.name.
c.name.
counterN2
cN2

variants:
Output Hex Keyword

<OutputHex H [signalname]>
<ox H [signalname]>


    O switch alternative that outputs data to the currently installed output port.  Item file must also have selected <InputDevice PIO12> (selected with the TimeDX PIO Test) or some other device that supports output.  O outputs the word N1 or the value of the designated counter (be it named with .name. or numbered with N2) to the current output device unless the optional [signalname] has been used in which case signalname is the name of an input signal and this keyword becomes a signal based output specification.  Note that if using a counter the value is sampled at item parse time, if the value of the counter changes as the item executes the output will not pick up that new value.  Note that this keyword's format is a little different from other keywords that allow you to specify a counter for their parameter as here classic numbered counters are only legal with a c or counter before the number as a stand alone number by itself is a literal output value, not a counter number.  When using signals and the button that generates that signal is pressed (or released of course if it's a button release signal) the output word is sent within the next millisecond or so (depending how good your system's millisecond callback is).  Note that prior to version 6.5.1.0 if that signal was received multiple times the output would have been issued with each of them (possibly for the rest of the item fle), as of 6.5.1.0 only one will be sent until another <op> command for that signal is given.  Note, no output occurs in the frame the signal based output specification occurs in, only when the signal is received and that frame has been displayed.  If the <RevertOutput> parameter hasn't been used the PIO12 output's will stay latched with that output until either another output request is encountered or the item file is stopped (in which case the lines all float high which is usually seen by other devices as all 1s).
 
    The <OutputHex> variant accepts hexadecimal codes instead of decimal codes, handy for the multi-byte output devices below.  Note that this keyword's format is different from the <Output> keyword in that it only accepts hexadecimal constants.

    If the input device PIO12 has been installed then 8 bits of output are provided on port C of the PIO 12 (ports A and B are 16 bits of input). If the PIO12output16 device has been installed 16 bits are output, the lower 8 to port C and the upper 8 to port B (port A is 8 bits of input). If the PIO12output24 device has been installed 24 bits are output, the lower 8 to port C and the middle 8 to port B and the upper 8 to port A (no input bits).

    Should you have a networked EEG (or what have you) machine the <send> keyword can be used to obviate the need for messy parallel cables and interface cards and so on.

    The counters variants are evaluated at parse time so sequences like the following where data is to be sent to port B instead of port C (when counter 2 is 256) are fine:

<set c1=c2*255><op c1> / <set c1=c2*123><op c1> / <set c1=c2*255><op c1> 

    Using an input signal allows the output bits to follow a key press with code like this:

<o 0 "+left shift"> <o 255 "-left shift"> 

     Using a revert output parameter like this <ro 250,255> obviates the need for a -buttonname code to reset output lines.

     If your machine happens to have a standard printer port (by that I mean one that lives at port 0x378 all the time and doesn't jump around like some add on devices do) then there's a rather nice test that can be done using inpout32.dll (once you've run it's setup program, InstallDriver.exe in the DMDX program folder, as administrator anyway, I keep forgetting about that) that uses the fact that reading port 0x378 returns whatever was most recently written to port 0x378 (not always a given) so we can test how well DMDX is synchronizing itself with the raster, how well the millisecond callback is operating not to mention the actual mechanics of outputting data by sending what looks like a key press 1000 ms after a clock on and seeing whether the RT is in fact 1000 ms:

<vm desktop> <id keyboard> <msfd 1000> <ro 100,255> <id pio12> <invertoutput>
0 "using inpout32.dll 378 378 this test should see", @1 "1000 ms RTs" <op 255>;

+1 "clock on" * / <op 4>;
+1 "clock on" * / <op 4>;
+1 "clock on" * / <op 4>;
+1 "clock on" * / <op 4>;

0 "done";
 

     Here's a partial truth table to various port combinations possible with PIO12:

    Port C          
Bit.........Bit
7 6 5 4 3 2 1 0
---------------
0 0 0 0 0 0 0 0                                      <ox 0>      <o 0>
0 0 0 0 0 0 0 1                                      <ox 1>      <o 1>
0 0 0 0 0 0 1 0                                      <ox 2>      <o 2>
0 0 0 0 0 0 1 1                                      <ox 3>      <o 3>
0 0 0 0 1 0 0 0                                      <ox 8>      <o 8>
0 0 0 0 1 0 0 1                                      <ox 9>      <o 9>
0 0 0 0 1 0 1 0                                      <ox a>      <o 10>
0 0 0 0 1 0 1 1                                      <ox b>      <o 11>
0 0 0 0 1 1 0 0                                      <ox c>      <o 12>
0 0 0 0 1 1 0 1                                      <ox d>      <o 13>
0 0 0 0 1 1 1 0                                      <ox e>      <o 14>
0 0 0 0 1 1 1 1                                      <ox f>      <o 15>

0 0 0 1 0 0 0 1                                      <ox 11>     <o 17>
1 0 0 0 0 0 0 0                                      <ox 80>     <o 128>
1 1 1 1 1 1 1 1                                      <ox ff>     <o 255>


     Possible with PIO12output16:

    Port C           Port B           
Bit.........Bit  Bit.........Bit
7 6 5 4 3 2 1 0  7 6 5 4 3 2 1 0
---------------  ---------------

0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 0                    <ox 1>      <o 1>
0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 1                    <ox 100>    <o 256>
0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 1                    <ox 101>    <o 257>
1 0 0 0 0 0 0 0  1 0 0 0 0 0 0 0                    <ox 8080>   <o 32896>


     Possible with PIO12output24:

    Port C           Port B           Port A

Bit.........Bit  Bit.........Bit  Bit.........Bit
7 6 5 4 3 2 1 0  7 6 5 4 3 2 1 0  7 6 5 4 3 2 1 0
---------------  ---------------  ---------------

0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0    <ox 1>      <o 1>
0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 0    <ox 100>    <o 256>
0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 1    <ox 10000>  <o 65536>
0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 1  0 0 0 0 0 0 0 1    <ox 10101>  <o 65793>
1 0 0 0 0 0 0 0  1 0 0 0 0 0 0 0  1 0 0 0 0 0 0 0    <ox 808080> <o 8421504>
1 0 1 0 1 0 1 0  1 0 1 0 1 0 1 0  1 0 1 0 1 0 1 0    <ox aaaaaa> <o 11184810>

 




DMDX Index.