Wednesday, November 16, 2011

Host Blocks in QUARC 2.2

In our previous blogs we introduced some of the new features of the now-released version 2.2 of our QUARC control software. Today, let's have a look at the Host Blocks in QUARC 2.2:

Redesigned Host Peripheral Framework
In previous versions, QUARC supported the use of peripherals connected to the host interacting with models running on either host or target. In QUARC 2.2, this feature has been updated by introducing a new framework to enhance usability and performance.

Features included in this new framework:
  •  A new Host Initialize block,
  • Updated blocks for devices, such as keyboard, mouse and game controller,
  • The ability to use host devices with remote targets even without Simulink running on the host,
  • The option of restricting the use of host devices to a single window on the host rather than the entire desktop.

Host Initialize Block
The Host Initialize, similar to HIL Initialize, is introduced to work as a hub for configurations and settings of the peripherals on the host PC.

Host Keyboard Block
In the previous versions, interacting with multiple keys by using the Host Keyboard blocks could lead to a messy pile of Host Keyboard blocks occupying the entire screen as the old block only processes one key per block. Thanks to the updated framework, this situation becomes history. By defining the list of keys in the block parameters dialog, the block reads the state of the specified virtual keys on the host and outputs a vector of boolean values to indicate whether or not the keys are pressed at the current sampling instant. Also, it can read the state of more than one key at the same time. Please watch the video clip in the Host Device Usage Restriction section below to see how this block works.

Host Mouse Block
The updated Host Mouse Block brings more functionality into the equation. On top of the absolute coordinates and button monitoring functions offered in the previous version, it also supports scroll wheel state monitoring (Windows Vista or later), output mouse coordinates in pixels, in screen percentage, or high resolution count.

Controlling Remote Targets With Host Devices Without Simulink Running on the Host
A new client program Host Peripheral Client has been added into QUARC 2.2 to support the use of host peripherals without Simulink running. This program monitors host devices and communicates with the Host Initialize block running on a QUARC target. This application can be run manually via its menu item under the Start/Quanser/QUARC menu, or automatically when interfacing to the model through Simulink.

Host Device Usage Restriction
The input from host peripherals can be restricted to a window instead of the entire desktop. By checking the "Use a window instead of entire desktop" option in the Host Initialize block, a special "peripheral client window" will open when the model is started (or the Host Peripheral Client application is started). Actions from host peripherals will only be recognized when this window is the active window. Otherwise they are ignored. This feature can be useful for taking advantage of the mouse as a host device, for example, because it allows button clicks and mouse movement outside the peripheral client window to be treated normally and be ignored by the model.  

No comments: