Clearone Writing StreamNet User Manual Page 47

  • Download
  • Add to my manuals
  • Print
  • Page
    / 72
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 46
Control Driver Example
C-1
All specifications subject to change without notification. All rights reserved. Copyright © 2007 NetStreams
Main +1 512.977-9393 / fax +1 512.977.9398 / Toll Free Technical Support +1 866-353-3496
3600 W. Parmer Lane, Suite 100; Austin, TX 78727 / www.netstreams.com.
Appendix
C
Control Driver Example
This example shows how to control a Panamax MAX 5410 Pro AC power source via
its RS-232 interface. The driver will create six control subNodes which will represent
six buttons, each having a distinct function. These buttons can then be displayed on the
DigiLinX GUI. The subNodes will represent the following functions:
subNode Function Description
1 Power On Initiates power-on sequence
2 Power Off Initiates power-off sequence
3 Switched Cycles power to the switched outlets
4 High Current Cycles power to the high current outlets
5 All Off Turns off all outlets
6 Cycle Initiates a power-cycle sequence
The example uses a user created function, createButton, to encapsulate the repetitive
tasks for creating each of the button subNodes. Each subNode will have four
variables, Name, the name of the subNode used for addressing, xmit, the RS-232
string to transmit when the button is pressed, Label, the text that will appear on the
GUI button face, and indicatorState, which will determine whether or not the indicator
LED on the GUI button will be on or off. Each subNode will also contain one
function, handle_button, which is called whenever the corresponding GUI button is
pressed.
Because of the way Lua parses the source files, the functions that the example uses
must be defined before they are actually used, so that is why the functions will appear
first.
Page view 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 71 72

Comments to this Manuals

No comments