The first byte in each S-Link command specifies which device you are talking to. For example, if you look inside the cdpcx200sls.cde file which is used for sending commands to CD players you will see the following prefix bytes defined (in binary):
prefix=10010000 #1
prefix=10010001 #2
prefix=10010010 #3
prefix=10010111 #ALL
That is, to address a command to player #2, you would prefix your command 91 hex. If you look further down in this same file, you will see the commands themselves defined:
00000000:play
00000001:stop
00000010:pause
00000011:pause_toggle
00001000:>>|
00001001:|<<
00001110:query_stored
00001111:mode # causes player mode to be reported
....
So, to send the mode command to player 2, the bytes 91 0F hex are sent out the S-Link port. It turns out that many commands are common between different S-Link devices. One such command is the mode command which causes a device to report its current state. To date, every device supports this command.
Using this information, we can send the mode command to all 256 possible device IDs and locate the ID(s) which give a response. CDJ has built in features to iterate S-Link codes which make this process very easy. To do this take the following steps.
First we need to add a special device file which allows us to output raw S-Link codes. This device file is called sls.cde in your Device Files directory. Add this device file and give it the name test. Connect it to the S-Link port where your new device is connected. Connect no other equipment to this port during these tests.
Instead of trying to view the results of the search on screen, it is better to log the results to a log file. Set up CDJ to record the results to a log file.
Now you're ready to search for the ID. Go to the S-Link viewer window and type test:test[**0F] in the send edit box. Type 00 in the Hex box. Now hit the iterate wildcards button. CDJ will now begin sending codes starting at 000F through FF0F and looping back to 000F. Hit the iterate wildcards button again after FF0F has been reached.
In order to view the log file, you must disable file logging. After this, you can open the log file in the text editor. Here's an excerpt from a log file run on a Sony STR-DE805G Receiver.
nomatch:sl1[BD0F]
nomatch:sl1[BE0F]
nomatch:sl1[BF0F]
nomatch:sl1[C00F]
nomatch:sl1[C87002120090]
nomatch:sl1[C10F]
nomatch:sl1[C20F]
nomatch:sl1[C30F]
nomatch:sl1[CB700000]
nomatch:sl1[C40F]
nomatch:sl1[C50F]
nomatch:sl1[C60F]
As you can see from this example, mode commands issue to device IDs C0 and C3 drew responses from the receiver. Note that each response has its own ID to distinguish it from a command. To date, these IDs are always 8 larger than the command IDs. Why can there be more than one device ID for a single device? Some equipment like receviers have many distinct subsections. Sony assigned a different device ID for each of these subsections. In the above example, it turns out that C0 represent the amplifier/main subsectoin and C3 is the surround subsection.
Now that we know what the device IDs are for our equipment, next we need to determine what the commands and responses are and what they mean.