ManniAT's personal site

I'm from Austria - which means: Please excuse my English

Velleman Kits Velleman Homepage Velleman Kits

In the Studio K8055 shines with K8055N35

K8055N35 also works perfect with Microsoft Visual Studio 2008 and the free Microsoft Visual Studio Express Editions like Visual C# 2008 Expression or Visual Basic 2008 Express Edition.
The object browser shows best how much information you get from the component.

K8055N35 in the Visual Studio object browser



Below is a screen shot of a dashboard for 4 USB Experiment Interface Boards - K8055.
This (included with the product) sample is a window holding 4 User Controls for the USB Interface Boards.
The "Leds" have been built in Microsoft Expression Blend 3 - the rest is done in Visual Studio.

K8055N35 Dashboard

Dashboard for the K8055 
It took me about half an hour to build this solution. Most work has been Layout (Grid sizes, Labels,...).
Databinding was mostly done by Copy and Paste.
The code behind are exactly 2 Lines per board in the main window.
Here it is:
Snippet created with CBEnhancer
private void Window_Loaded(object sender, RoutedEventArgs e) {
    //bind the boards to the user controls
    Board0.DataContext = K8055XBoardHolder.Board0;
    Board1.DataContext = K8055XBoardHolder.Board1;
    Board2.DataContext = K8055XBoardHolder.Board2;
    Board3.DataContext = K8055XBoardHolder.Board3;
    //don't care if a board is present - K8055N35 will handle it
    //simply give every board an autoread delay
    K8055XBoardHolder.Board0.AutoreadDelay = m_nGlobalDelay;
    K8055XBoardHolder.Board1.AutoreadDelay = m_nGlobalDelay;
    K8055XBoardHolder.Board2.AutoreadDelay = m_nGlobalDelay;
    K8055XBoardHolder.Board3.AutoreadDelay = m_nGlobalDelay;
}

 

The User control

Also very little code behind:
Snippet created with CBEnhancer
private void btnResetCounter1_Click(object sender, RoutedEventArgs e) {
    K8055Board kB = DataContext as K8055Board;
    if(kB != null) {
        kB.ResetCounter1();
    }
}

private void btnResetCounter2_Click(object sender, RoutedEventArgs e) {
    K8055Board kB = DataContext as K8055Board;
    if(kB != null) {
        kB.ResetCounter2();
    }
}

The XAML looks like this (snippet):
Snippet created with CBEnhancer
<UserControl.Resources>
   <k85:BindableBoards x:Key="BBoards" d:IsDataSource="True"/>
   <converters:Bool2_0_1Double x:Key="convB2D" />
   <Style TargetType="{x:Type TextBlock}">
       <Setter Property="Foreground" Value="White"/>
   </Style>
</UserControl.Resources>
<UserControl.DataContext>
   <Binding Path="Board0" Mode="Default" Source="{StaticResource BBoards}"/>
</UserControl.DataContext>

And here some bindings:
Snippet created with CBEnhancer
<ProgressBar Value="{Binding Analog2In, Mode=OneWay}" Grid.Row="1" Orientation="Vertical"
            Width="18" Maximum="255" SmallChange="1" LargeChange="10"/>
<ToggleButton IsChecked="{Binding DigitalOut[0], Mode=TwoWay}" Style="{DynamicResource RedTBLedStyle}"