A quick review of VPixx’s register write/update system
Before we get started, there is a very general principle to keep in mind about VPixx devices. Whether you are using a VIEWPixx, VIEWPixx /3D, PROPixx, DATAPixx series I/O hub, or a simulated version of one of these devices, all of these systems have an onboard data acquisition system.
You can think of this acquisition system as a controller that operates in parallel with your PC. It can store content for playback with precise timing, record new data from connected systems, and keep track of time and the events of the video signal. It even has its own clock.
Like all systems operating in parallel, we need a way for system A (your PC) to communicate with system B (the VPixx hardware). VPixx solves this with a method called register writing and register updating.
When you implement a line of code to control our hardware, this command does not do anything immediately. Instead, it waits for a special command that indicates it is time to execute. This command is called a register write.
dp.DPxSetAudVolume(0.5)
dp.DPxWriteRegCache()
Register writes have several advantages. First, they allow you to execute several queued device commands simultaneously. Second, this execution can be tied directly to the behaviour of your display; VPixx has a series of special register write functions that delay the time of write execution until a specific event in the video signal is detected. This allows you to synchronize your hardware commands with your video frames or visual stimulus onset.
Register updates follow the same principle as a register write, but they return a copy of the device status as well. This is useful for getting up to date information from our hardware, such as the system clock time and the current state of the I/O ports.
You can read more about our register system and these special video-based functions in our VOCAL The Logic of VPixx Hardware Control. We highly recommend this guide for researchers interested in very precise timing control in their experiments.
For now the key points to remember are:
With a handful of exceptions, most pypixxlib commands must be followed with a register write or a register update in order for your hardware to execute the requested changes.
A register write executes all queued hardware commands. It should be used in situations where you need a fast turnaround time, and do not need any data returned from the device.
A register update (also known as a write-read) performs a write and then returns a copy of the device status to your PC. It should be used in situations where you need a fresh copy of your hardware’s status.
It is a good idea to keep in mind this register system when troubleshooting your experiment code. Is your hardware not behaving as expected? You might want to check to make sure you included a register write. Does information retrieved from the device seem outdated, or missing? You might want to check when your last register update was, and whether you have up-to-date device information.