Home | News | Products | Support | Download | Sales | library | Guests | Contact | WebCam | Links
CDS Logo LanBox-Talk mail archive
 

By date: Prev | Next | Index By thread: Prev | Next | Index

SubjectLanBox and MS Visual Basic
FromBrian Hussey
DateTue, 03 Jun 2003 22:44:09 +0200


Hello;
The method I am disclosing here is useful for anyone who wants to trigger Lanbox cues from any application written in VB 6.0 (Microsoft Visual Studio). It utilizes a pre-existing ActiveX control included with VB named MSCOMM. (Ordinarily, MSCOMM is designed for serial modem communication, but in this case, I used it simply as an RS-232 port control.)

First, set up cues in LCedit+ and give them list numbers (e.g.. 4.1, 4.2, 4.x, etc).   Edit the step properties to give a hold time of "ever" for any cues that need indefinite hold during application runtime.  Check that your cues are giving you the desired light effects. After the cues have been set up, burn them into the Lanbox flash memory by using "Save to Lanbox" function.

Second, enable the Microsoft Comm Control into your Visual Studio Controls area.  (Right click on the controls area, select "Components", then check the box in front of "Microsoft Comm Control 6.0", and press the "Apply" button.)  Now select the icon just added to your controls, which looks like a telephone, and drop one of these onto your main application form area. You have now enabled the use of the ActiveX control "Mscomm" in any part of your program.

Third, add the following lines of code to the "Form", "Load" area of the program.  (This is the initialization of the COM1 or COM2 port, so it needs to load every time you run the program.)

   MSComm1.CommPort = 1
   MSComm1.Settings = "38400,N,8,1"
   MSComm1.InputLen = 0
   MSComm1.RThreshold = 1
   MSComm1.PortOpen = True

Obviously, if you cannot use COM1, then set the appropriate port at the first line.  To utilize this recommended baud rate on your machine, be sure to go to Properties, Device Manager, Communications Port and set the "Bits per second" line to 38400.  All other port settings can remain as default values.

Fourth,  use the following line of code anywhere in the program that you need a trigger for an LCedit-created cue:

   MSComm1.Output = "*56 XX YYYY SS#"

[where XX=the layer engine number, ie A is 01, B is 02, C is 03, etc in HEX and YYYY=the cue list number 1 through 999 (must have 4 digits, so use 0004 for cue 4.x) in HEX and SS=optional cue step number 1 though 99 (default value is 1 if you omit this) in HEX.]

Note: Using 0000 for YYYY resets the engine layer completely, while using 00 for SS resets current cuelist to it's .0 (home) position.


The string in parenthesis must start with an asterisk * and end with a hash # for the Lanbox to interpret the command sequence properly. The 56 is a hex number which makes an "EngineGo" command, as described in the LanBox Reference Manual v1.1a2, p.30.  Be sure to use the HEX values for numbers over 9.  If you are only using a single set of cue steps like me, this will not be confusing.

Fifth, here is a HOT TIP to troubleshoot your COM interface, and gain instant use of the LanBox serial commands. Use the following link and download the simple VB program called "Poor Man's Serial Instant Messenger". There is a download link  for VB6 somewhere mid-document. <http://www.htservices.com/Tools/VBandC/SerialCommunications.htm> When you have this application up and running, try communicating with the LanBox by using the following query in the lower (send) text window:

   *0B#

The LanBox should send you back a long (34 char) string of Hex numbers back, which gives the global data for the state of your LanBox and its current cue memory. For help with interpreting this, refer to the LanBox Reference Manual v1.1a2, p.26,  under the "EngineGetGlobalData" Serial & Network command. Just the fact that the LanBox returned a string may be all you need, however. ;-)

Good luck with all of this, and I hope your program runs as well as mine did.  This is a very powerful box, once you have this level of control!!


Brian Hussey
Hardware Engineer
(201) 332-9213 ext 251
brian.hussey@xxxxxxxxxxx

Identix Incorporated
One Exchange Place
Jersey City, NJ  07302
<<...OLE_Obj...>>

  • (- current message -), Brian Hussey

By date: Prev | Next | Index By thread: Prev | Next | Index