Shop OBEX P1 Docs P2 Docs Learn Events
Visual Basic and the BS2 — Parallax Forums

Visual Basic and the BS2

terahertzterahertz Posts: 55
edited 2006-11-13 21:21 in General Discussion
After spending too many hours figuring out that the various free and "easy" programs out there that will interface with the BS2 cannot do what I want them to do, I surrender, I need to learn VB.

I need two-way comms between a PC and a BS2. I'd like a pretty GUI with sensor displays and the ability to send control signals.·I can do this with VB right?

So I decide to buy a copy of VB, I go to the·compUSA (gift card)·website to look around and there seems to be dozens of variants of VB for sale, grrrrrr. So, there's a steep learning curve just to figure out what version I need? I know some versions allow serial comms some don't...I don't know which.

Visual Studio 2005 Professional Edition Upgrade $359.98·, Visual Basic .NET 2003 $105.99, Visual Studio® .NET 2003 Professional $558.99, Visual Studio 2005 Professional Edition $544.99, Visual C++ .NET $105.99, Windows CE Toolkit for Visual Basic 6.0 $199.99, Microsoft Windows CE Toolkit for Visual C++ 6.0 $199.99 etc. etc. shocked.gif

Would someone kindly explain this to me before I go insane?
·
«1

Comments

  • Harrison.Harrison. Posts: 484
    edited 2006-10-19 02:35
    Don't waste your money buying visual studio unless you plan on marketing your product.· Microsoft has express versions of their visual studio components.· You can download VB.NET Express 2005 at http://msdn.microsoft.com/vstudio/express/vb/.· The express version has almost everything the retail studio has except remote debugging and deployment options.· I used it for a while before I got Visual Studio 2005 Standard (required for legally producing binaries that are released to people other than yourself).

    Serial port communication is very easy to do with vb.net 2005.· Whatever you do, don't get visual studio 2003 since the .net 1 framework does not support serial port access.

    Versions that have serial port:
    Visual Studio 2005 - .NET 2.0·(Express, Std, Pro, Enterprise)
    Visual Studio 4,5,6 (through mscomm control)

    Versions that don't have serial port:
    Visual Studio 2003 - .NET 1.0/1.1

    Harrison

    Post Edited (hpham) : 10/19/2006 2:47:27 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-19 02:37
    There are all kinds of ways to produce pretty GUIs. You can certainly do this with VB, but the BS2 piece is just an ordinary serial connection (you have to have the serial comms!). The magic is in you deciding what you want to communicate back and forth. Any system that supports standard Windows COM ports and does GUIs should work. The rest depends on what you're familiar with and how much you want to spend. Keep in mind that GUIs are usually complicated no matter what programming system you want to use. There are free systems that can be used for this, but they may not be things you're familiar with. For example, I would probably do a system like you're proposing in Smalltalk which is available for the Mac/Windows/Linux (for free) and is extremely well suited for GUI creation and does two-way serial comms just fine. It's just something unfamiliar to most programmers.
  • terahertzterahertz Posts: 55
    edited 2006-10-19 03:15
    Thanks for the quick response guys.

    Mike, I really respect your opinion since I think I've read hundreds of your posts. smile.gif·

    I'd like to stick with a MS product because, well, I'll admit it, I like MS. If you know one MS product, you're half way there for learning the rest of them. I don't mind paying for software, as long as it's useful.

    I like the looks of this version because it looks LabView-ish which I'm somewhat familiar with, do you know what version this is?http://www.controlanything.com/Merchant2/merchant.mvc?Screen=CTGY&Store_Code=NCD&Category_Code=VBASIC

    I've got a $150 gift card to CompUSA, anyone care to make a specific recomendation?

    I'm about done with the PBASIC code, that wasn't a problem. The PC interface is my problem.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-19 04:34
    The problem with the LabView-ish link that you posted is that it show what is probably VB6, which you can't purchase new any longer. Microsoft discontinued it 4-5 years ago.

    The latest version of Visual Studio is 2005, and 2007 is in the works. The best thing you could do is to download one of the free Express editions from Microsoft's website. You'll have 4 language choices: Visual Basic, C# (C-Sharp), C++, and J# (J-Sharp). Each has it's pros/cons, but any should be able to get you moving. The VB & C# versions have some very good videos that you can also download.

    Here's a link to the Express page: msdn.microsoft.com/vstudio/express/

    If you have any questions concerning which to choose, just ask.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-10-19 05:05
    Ive always has a softspot for TK as a rapid GUI development environment, it has its own script language TCL, but can be bound to many of the popular languages (perl, python, ruby, etc).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • TiboTibo Posts: 81
    edited 2006-10-19 13:37
    Hi,

    What experience do you have of VB ? Mean if you know it since the 4th version, it has change a lot....
    Visual Basic.Net isnt the same as the 4th, 5th or 6th
    May be you should consider learning a new language ?

    ++
  • RDL2004RDL2004 Posts: 2,554
    edited 2006-10-19 14:14
    I think you may still be able to get the full version of Visual Studio 2005 for free:



    http://www.learn2asp.net/Campaign.aspx





    I got mine back in June, this is a real deal.

    Edit: Well, nevermind. It looks like the free Visual Studio offer is over.
    Now all they are giving away is a 90 day trial of the professional version.
    Too bad. Back in June you got the full version of Visual Studio Standard, not a download, it came in the mail in a box - 5 CDs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick

    Post Edited (RDL2004) : 10/19/2006 11:18:05 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-10-19 15:36
    terahertz,

    For a Visual Basic test drive, you might also consider Microsoft Excel. There is a Visual Basic shell wrapped inside of Excel that is very capable. If you have the right DLL's, you can do a lot of
    the things you want to accomplish. Depending on how deep you want to get into things, you can even write your own DLL's that cater to your objective.

    "I need two-way comms between a PC and a BS2. I'd like a pretty GUI with sensor displays and the ability to send control signals."

    I'm pretty sure the COM can be done (I will need to look to confirm), and since Excel has many 'graph' / 'graphics capabilities' I would think you could hook into those features as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • terahertzterahertz Posts: 55
    edited 2006-10-19 16:15
    Thanks again everyone!

    Beau, That's interesting about Excel, I didn't know Excel had serial communication capabilities. I've been playing with StampDAQ for a few days and I think that program may be incorporated somehow in my final product.

    I downloaded the C++·and the C# version of VB (express) this morning, I'll take them for a test drive this afternoon.

    I know just enough to be dangerous in the following languages since someone asked: PASCAL lol.gif , C++, assembly, and now PBASIC tongue.gif , I also speak fluent MATLABian.

    I still don't undersatand exactly what VB is though, I always thought it was a language itself, I guess it isn't. It's a graphical way to use a language? That's why there's a·specific version for a specific language? Can you do more with VB C++ than you can with C++ alone? Or can you use VB C++ without actualy knowing C++?

    For me hardware=fun, software=frustrating but necessary.

    I also have the full version of SIMULINK, anyone know if that can be useful?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-10-19 16:28
    terahertz,

    "...Beau, That's interesting about Excel, I didn't know Excel had serial communication capabilities..."

    Most people aren't even aware that there is a VB editor inside Excel.· Inherently the communication capabilities
    are turned off, but it looks like you can add them through "Tools-->References" under the "Visual Basic Editor".

    [b]From Microsoft Excel:[/b]
    To Bring up the Editor            - Tools-->Macro-->Visual Basic Editor
       
    [b]From Visual Basic Editor:[/b]
    To Bring up a Code Window         - View-->Code
    To browse the Objects you can use - View-->Object Browser
    To Add new Objects you can use    - Tools-->References
    
    

    · Edit:
    I just checked, and you can add COM capabilities.· You will need 'MSCOMM32.OCX' ... for me this was located in "WINDOWS\system32"
    To add this you will do it through "Tools-->References" under the "Visual Basic Editor" ... from there you will need to select "Browse..."
    and go to that particular file.· This is an ActiveX control, so you will need to select the *.ocx extension under the browser menu.
    Now you should be able to see it and the functions under "View-->Object Browser". Look under the new added header... "MSCommLib"

    Be sure to·set the DTREnable signal to False!

    ····· Example:
       Begin MSCommLib.MSComm RS232 
          Left            =   1320
          Top             =   3480
          _Version        =   65536
          _ExtentX        =   677
          _ExtentY        =   677
          _StockProps     =   0
          CDTimeout       =   0
          CommPort        =   1
          CTSTimeout      =   0
          DSRTimeout      =   0
          [b]DTREnable     =   0   'False[/b]
          Handshaking     =   0
          InBufferSize    =   1024
          InputLen        =   0
          Interval        =   1000
          NullDiscard     =   0   'False
          OutBufferSize   =   512
          ParityReplace   =   "?"
          RThreshold      =   0
          RTSEnable       =   0   'False
          Settings        =   "4800,n,8,1"
          SThreshold      =   0
       End
    
    


    ·
    ······ Sending Data:
        If RS232.PortOpen = "True" Then
           RS232.Output = "Hello Basic Stamp"
        End If
    
    

    ······ Receiving Data:
        If RS232.PortOpen = "True" Then
           DataString = RS232.Input 
        End If
    



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/19/2006 5:16:00 PM GMT
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-19 17:18
    Terahertz, you're confusing Visual Basic with Visual Studio.

    Visual Basic is Basic. The word Visual is a marketing term that refers to the drag and drop RAD features of the IDE. So, in a certain sense, VB is the whole RAD system, but the language is Basic. Microsoft uses the word Visual to create a brand association here; Visual C++ isn't nearly as "visual" as VB.

    What you downloaded is part of Visual Studio - again, capitalizing on the word visual. VS contains several languages in one IDE. The Express versions are single language versions, but the other versions contain all of the languages.

    All of the VSExpress downloads will let you do very "visual" drag and drop programming with WinForms, which is their default configuration. WinForms are part of the .Net framework, and the applications get compiled to IL VM language, which is native JIT compiled at run-time.

    The only language version that will let you do native (not targeting the .Net VM) Win32 programming is Visual C++. However, to do this with the Express edition, you need to do some additional downloading and configuration. If you were serious about Visual C++ programming, it would be worth using VS standard or above for the out of the box configuration for Win32.

    So, now that you've downloaded C# & C++, you'll notice that in WinForms/.Net, the development is very similar, with minor language syntax being the big difference. Of the 2 languages, C++ will give you more flexibility, but C# has better IDE support. VC++ (and VB.Net) will let you do non-OO style programming, where C# (and J#) are strictly OO languages. This may or may not make a difference,; it depends on your programming style preferences.

    If you want to see three example programs, I posted a zip file in this thread:

    http://forums.parallax.com/showthread.php?p=607328

    It's called StampSendVS.zip. It has a VB.Net, C#, and C++ .Net versions of the same program that you can compare.
  • metron9metron9 Posts: 1,100
    edited 2006-10-19 17:19
    While you play with communications thru the serual port, you may wish to view and log its communication for debugging.

    I was looking again at the freebasic fourm, seems there are still some problems with com communications but one post had this link.

    http://www.serial-port-monitor.com/

    I am going to investigate using freebasic for communicating with uCs I have tried freebasic for other stuff and it works pretty good.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • metron9metron9 Posts: 1,100
    edited 2006-10-19 18:52
    I just tried the serial port monitor picture attached.

    The above link is for the free version, this link is for the various products they offer if you need more features.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
    576 x 719 - 31K
  • CJCJ Posts: 470
    edited 2006-10-20 01:30
    I like realbasic from realbasic.com it is like the old visual basic and I have used it for serial comms

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • T ChapT Chap Posts: 4,223
    edited 2006-10-20 01:49
    CJ I just posted on RB forums to see if usb was possible, someone said no. Do you know where to find an example of a sending a string to usb>ser could be found? I put on the RB OS X demo today, but have had no luck with how to get it to usb. I have never used the program, but need to send some info from an app to usb to serial to the Prop.

    Post Edited (originator99) : 10/20/2006 1:56:44 AM GMT
  • CJCJ Posts: 470
    edited 2006-10-20 02:42
    the usb->ser works just as a standard serial port

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • Istha PowronIstha Powron Posts: 74
    edited 2006-10-20 11:59
    Hey! You are not alone!

    I have been writing code since just after the earth cooled and the dinosaurs died.

    I have been mainly writing in c and assembler for embedded applications for the last 10 or so.

    I am using BS2s for small mobile robots and have been trying to work out how to write GUIs for PCs. I have tried Visual Studio 2005 which is just a ridiculous amount of complexity and hard disk space and memory and processing for simple applications. As I understand it, there is no "drop in" comm module so you have to scratch around the net for methods that other people have written to simmulate the VB6 comms module. I don't know any VB6, but it would appear that 2005 was a backward step if everyone is trying to make it behave like VB6.

    It would also appear that MS products are now aimed at software engineers rather than robotics or automation engineers.

    I then gave Java a try, it was easy to creat GUIs, however it was bloody hard to make them poll.

    As I see it, a GUI needs·four things;

    1) A drag and drop design front end.
    2) Easy to implement comms.
    3) Event driven user input
    4) Timed (polled) or interrupt driven input

    I have yet to find this in a language for windows which doesn't take a 3 month learning curve.·So I have to either learn VB6 which is no longer supported (but has timer and comm modules) or to use Labview which I know, but which is more overkill. Surely there must be an easy way to set up a GUI.

    Issy

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
    Adam Smith
  • terahertzterahertz Posts: 55
    edited 2006-10-20 13:51
    I've learned quite a bit since yesterday. VB is fairly easy to use, I've built a few·simple windows applications but I haven't attempted communication with my BS2 yet.

    It turns out what I'm really looking for is a "digital dashboard". There are two options for this as far as·I can tell, build from scratch (not gonna happen) or use someone else's code for the gauges and controls. VB includes a gauge package that can be imported but the license is $700. There are a few free code samples out there for gauges but they look like a three year old drew them with crayons.

    I did however find find this absolutely gorgeous package http://www.dundas.com/Products/Gauge/index.aspx·-big bucks for a license though. It is exactly what I'm looking for so I downloaded the free evaluation version and imported it into VB (PITA for a noob like me). I made a nice looking dashboard·using the included gauge wizard which is easy to use. The gauges don't do anything at the moment except look pretty. It isn't clear from the company's web site what the limitations of the evaluation version are. I have some other projects·I need to focus on for a few days, anyone who's trying to do the same thing want to pick this up from here?

    Beau, I haven't had the chance to explore the excel angle yet but I'm looking forward to trying that out.

    Note to the fine engineers from Parallax: I'd love the opportunity to pay Parallax for something like what is described in this thread! tongue.gif
  • stamptrolstamptrol Posts: 1,731
    edited 2006-10-20 14:06
    Terahertz,
    Your reference to 'digital dashboard' remided me that the early days, we developed a small VB application to use at trade shows which would talk/listen to a Stamp. It had several gauges, some sliders and reported the status of various Stamp registers. It also allowed several equations to be written so that you could say something like: 'when input 1 is ON and input 2 is OFF then turn on output 10".

    We compiled it as standalone program and it was kind of neat to play with....never went anywhere commercially.

    You can see the screen shot on my website under "projects".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-20 19:52
    terahertz,

    What exactly, again, is your requirement? If I'm not mistaken, you can get a developer license of StampPlot Pro for around $50, and it will let you build dashboard type UIs. If it does what you want, it would be easier than building your own equivalent.
  • terahertzterahertz Posts: 55
    edited 2006-10-20 21:24
    kevin,

    I have stampPlot Pro, I didn't pay anything for it though, as far as I know the eval version is full featured now, only with a 10 minute run time limit.·I tried it but I found the customization macros very difficult to use, once·I tried to change anything everything stopped working.

    I'm trying to build a nice looking real-time PC interface for my BS2 to monitor 7 sensors and control 2 DC motors.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-10-21 05:50
    terahertz,

    I had to play around a bit with my suggestion using Excel's VB...· Here is just a bare bones COM demonstration between a BS2 and Excel.

    With a direct connection from·Stamp to Excel,·this would make a great data logger with slight modification.

    Make sure that the COMport setting and the Baud are correct·on the Excel SpreadSheet before you press the·Start Basic StampII COM Macro
    button on the Excel SpreadSheet.

    This Demo allows you to have full control over ALL of the I/O Pin states and directions.
    BS2Excel.bs2      - BS2 Program
    BS2Excel.x1s      - XLS Program (<- Change extension name to .xls)
    ------------------------------------------------------------------
    Parallax.frm      - Source code for BS2Excel.x1s
    Parallax.frx      - Object code for BS2Excel.xls
    ------------------------------------------------------------------
    SCREEN1.JPG       - Screen Shot of  BS2Excel.xls
    


    Enjoy!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • terahertzterahertz Posts: 55
    edited 2006-10-21 14:54
    WOW Beau!
    That looks amazing, I can't wait to try it!
    Unfortunately my wife "owns" me on the weekends·wink.gif··so I'm not allowed to work on my projects. Unless....idea.gif ...maybe I'll head off to Blockbuster to rent some chick-flicks, cause I'm such a good husband.
  • AImanAIman Posts: 531
    edited 2006-11-02 14:23
    Beau Schwabe said...
    Here is just a bare bones COM demonstration between a BS2 and Excel
    ·· I am going to serious look into the EXCEL VBA hookup. I write in VBA all day and if this will work it will be a serious boost for some projects I am doing.
    Will this work for the Propeller and the SX?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-11-02 16:04
    AIman,

    If you already have VBA, then use that to call up Excel. That would be the best approach. The Earlier solution is what I posted for someone who already has Excel, and perhaps didn't realize that VB was
    part of the package.

    Below is an example to launch and create an Excel spread sheet from VB (Microsoft Visual Basic 4.0 Professional Edition is the flavor that I use)...

    Sub BuildSpreadSheet()                          'Build a spreadsheet
        Dim Sheet1 as Object
        Dim objExcel as Object
        Dim ObjWorkbook as Object
        Dim ObjSpreadSheet as Object
        Set objExcel = CreateObject("Excel.Application")
        Set objWorkBook = objExcel.WorkBooks.Add
        Set objSpreadSheet = objExcel.ActiveWorkbook.ActiveSheet
        Set Sheet1 = objWorkBook.Sheets("Sheet1")
        objExcel.Visible = True
        objExcel.ScreenUpdating = False
        Sheet1.Columns("A:BM").ColumnWidth = 2.2
        Sheet1.Rows("1:66").RowHeight = 11.5
        Sheet1.Rows("1:1").RowHeight = 15
        Sheet1.Rows("34:34").RowHeight = 15
        Sheet1.Range("A1:BM66").Font.Name = "Parallax"
        Sheet1.Range("A1:BM66").Font.Size = 9
        Sheet1.Range("A1:BM1").Font.Size = 12
        Sheet1.Range("A34:BM34").Font.Size = 12
        Sheet1.Range("A1:BM66").NumberFormat = "@"
        Sheet1.Range("A2:AF33").Interior.Color = RGB(255, 204, 153)
        Sheet1.Range("A35:AF66").Interior.Color = RGB(255, 204, 153)
        Sheet1.Range("AH2:BM33").Interior.Color = RGB(255, 204, 153)
        Sheet1.Range("AH35:BM66").Interior.Color = RGB(255, 204, 153)
        Sheet1.Range("A1:BM66").Borders.LineStyle = 3
        Sheet1.Range("A2").FormulaR1C1 = "OO"           'Place "00" in upper left corner
        Sheet1.Range("A2").Copy
        Sheet1.Range("B2:AF2").Select
        Sheet1.Paste                                    'Create a row of 32 "00"'s across
        Sheet1.Range("A2:AF2").Copy
        Sheet1.Range("A3:A33").Select
        Sheet1.Paste                                    'Create a square of 32x32 "00"'s ; bank 0
        Sheet1.Range("A2:A33").Copy
        Sheet1.Range("AH2:BM33").Select
        Sheet1.Paste                                    'Copy 32x32 square of "00"'s to bank1
        Sheet1.Range("A35:AF66").Select
        Sheet1.Paste                                    'Copy 32x32 square of "00"'s to bank2
        Sheet1.Range("AH35:BM66").Select
        Sheet1.Paste                                    'Copy 32x32 square of "00"'s to bank3
        objExcel.CutCopyMode = False
        Sheet1.Range("A1").Font.Bold = True
        Sheet1.Range("A1").FormulaR1C1 = "Memory Bank0 - 1K Byte (32x32)"
        Sheet1.Range("AH1").Font.Bold = True
        Sheet1.Range("AH1").FormulaR1C1 = "Memory Bank1 - 1K Byte (32x32)"
        Sheet1.Range("A34").Font.Bold = True
        Sheet1.Range("A34").FormulaR1C1 = "Memory Bank2 - 1K Byte (32x32)"
        Sheet1.Range("AH34").Font.Bold = True
        Sheet1.Range("AH34").FormulaR1C1 = "Memory Bank3 - 1K Byte (32x32)"
        Sheet1.Range("A1").Select
        objExcel.ScreenUpdating = True
    End Sub
    
    


    As far as Propeller and SX?· ... Yes, there is an application in mind that I am currently working on that uses a Propeller <--> VB <--> Excel interface (See Image)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 11/2/2006 4:32:07 PM GMT
    1383 x 823 - 867K
  • T ChapT Chap Posts: 4,223
    edited 2006-11-02 18:00
    Just another opinion thrown in here: I was looking at VB for some projects and decided on tackling Realbasic instead. The license is $99 for the standard edition that works on one platform of your choice Mac/WIn/Lin. The pro edition is 500 and will export your app in all 3 formats. There is a free 14 day demo that will export the app in all 3 platforms as well so you can check it out.

    Once you get the fundamentals down sending and receiving via serial or usb2serial is ultra simple. I have included here a mini app that you can load on RB and test out within seconds of downloading it. Get the RB demo of your flavor, load the file and pres RUN. It will prompt you to search for the port, in my case it shows 3 options, one being usbserial. After selecting the port, there are several windows, type in the test box at the top and press send, whatever you have hooked up will receive the string that you typed. Also, in the lower box, it will show whatever is being received in real time. This mini app I adapted is set at 9600, 8 bits, 1 stop.

    For example if you were to drag a button to the window, name it whatever, size it however, then double click on it, you'd get the window to type in the code for it ( or enter a method for it to call, whichever).

    This his how difficult it is:
      dim TxStr as string       ' sets TxStr s variable
      TxStr=TxE.text             'Txtr var is now equal to whatever is typed in the top textfield(Txe)
      Serial1.Write TxStr        'write means send it out!
    
    


    This is a slightly more invloved version using 4 sliders to generate the values to be included in the string:
      dim x as integer
      dim y as integer
      dim z as integer
      dim r as integer
      Dim OutputString As String     ' your variable for the string to be sent
      Dim Tab, Space, CR as String
      Tab=Chr(9)
      Space=Chr(32)
      CR=Chr(13)
      X = Xslider.Value       'whatevef value your slider are set to
      Y =Yslider.Value
      Z =Zslider.Value
      R =Rotslider.Value  
      OutputString = str(X)  + TAB + str(Y) + TAB +  str(Z) + TAB + str(R)  + CR
      Serial1.Write outputString
      Serial1.XmitWait       'optional wait till all data has been sent before cotinuing, otherwise it is not held up here
    
    


    The User Defined button is where you can double click it in the real basic software and enter your own fixed value(s) to be sent for test purposes.


    As far as Propeller/SX/Stamp it is very simple to use, for the Propstick just tell your Spin code to look at pin P31(40 )for Rx, set P30(pin39) to Tx. Use the full duplex object with Spin and you are all set. With THe SX or Stamps, just set tp baud 9600. On the stamp demo board it works fine just using the input16 that is the default serin.

    Ok here is one thing I found to be of big help, get two usb2serial adapters or you will regret it. What I am doing is have OS X sending and Receiving on one usb2serial(wires hangin off the cable going to the Propeller P0 for serin and P1 for serout. I have a laptop PC hooked up to the Propstick at all times, so you can update code in the RB and also update code in the Spin without changing cables all the time. One serial port will not work on two apps at the same time without dropping the connection each time. I found it a real headache switching back and forth cables. You may be able to plug two usb2serials into one computer, use one cable for programming the IC, the other for the serial i/o for com. If need be, buy a junker PC for 50 bucks for running the Spin/SXB/BS editor.

    Post Edited (originator99) : 11/2/2006 8:46:04 PM GMT
    416 x 353 - 29K
  • metron9metron9 Posts: 1,100
    edited 2006-11-02 19:28
    Just tested RealBasic, Tutorial #1. I like this thing , the Properties boxes are not overwhelming conglomerations of a million boxes to navigate through, just common sense logical stuff that makes sense.

    Darn, now I gotta shell out another hundred bucks to use it in my stuff.......
    Real help files that look like this, I type in Serial, search and everything I need to know is at my fingertips, I don't have to worry if I have the latest subscription to MSDN (heck I paid 100 bucks for a 1 year subscription once) Thanks Originator99

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
    612 x 539 - 29K
  • terahertzterahertz Posts: 55
    edited 2006-11-02 19:47
    I'm glad this thread is being kept alive, there's some extremely valuable information in here, I was hoping·people would add to it.

    As far as my project goes, I've hit a lot of roadblocks recently and I've put the software development on the backburner due to sheer frustration.

    ···· 1) I have exceeded the capabilities of the BS2, I've run out of variable space and I'm not even close to having everything in the program·yet. My·options are to get another·microcontroller or move into a Dragon-12.

    ···· 2) I have succeeded in making a few simple GUIs using VB and stampDAQ/Excell as well as some Excell serial input programs (Thanks Beau). When my laptop is reading the data and displaying the GUI ·it·runs at 100% CPU usage (Centrino 1.8G), Graphing multiple inputs in real-time is a resource hog·burger.gif·. Since I need the laptop to process video at the same time, this method isn't going to work. I think I may be back to using the DEBUG window as my GUI cry.gif .

    The hardware for my project is moving along nicely though, I'm about 6 weeks from testing.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-11-02 21:21
    "Graphing multiple inputs in real-time is a resource hog"

    Have you tried using the Clipboard to copy-n-paste? You can use the clipboard as a scratch pad to take snapshots of the data going to and from VB and Excel. VB can read and
    write directly to the clipboard and create TAB delimited data that Excel can read as well as parse any data that Excel creates. You can also keep track of your data and only do
    updates when the data changes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • metron9metron9 Posts: 1,100
    edited 2006-11-03 00:09
    From my experience Excell is a poor program for any sort of real time data input. (not dissing all of Beau's work I never knew about the VB hooks in Excell but if it hogs processor time with the tiny amount of data that could possibly come from a stamp then there has to be a better way)

    This comes from using real time stock market data feeds. It's just not low level enough to do the job for large amounts of data.

    Please specify the amount of data and time intervals you are working with and lets get this thing solved.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
Sign In or Register to comment.