Graphical User Interface(GUI) with Visual Basic 2010
dear pals,
I recently installed VB 2010, and have just learnt how to do basic numeric calculation and displays.
I actually need to make a GUI that will display a graph of data/signal acquired from a PIC connected to my PC via FTTDI/USB.
I need to send data to the PIC, and equally receive data from the PIC
Please help/guide me.
Kind Regards,
Re: Graphical User Interface(GUI) with Visual Basic 2010
Hi bobble and welcome to the VBForums. :wave:
I'm afraid that your question is a bit wage (to say the least) for anyone to give you any advice or answer. First of all, I assume that you by PIC actually mean some specific peripheral hardware and not the PIC chip. I also assume that you just misspelled FTDI.
The title of your question gives the impression that you have some design issues that you want to get some help with but then you're talking about how to read or write to this, unnamed, hardware. To communicate with the hardware you need to know the protocol it uses to send and receive information once you have the data you want to display it somehow (these are two different issues).
There is no way anyone here can know how your hardware device communicate or what kind of data it sends so there is no way we can advise you on what would be the best approach to display this data. You just need to give us more information. We are here to help our fellow VB'ers but we do need to understand the issue you're having before we can give you any advice. :)
Re: Graphical User Interface(GUI) with Visual Basic 2010
Quite likely, you are communicating via some type of serial device, which may be bluetooth or just a serial cable. For either of those, you would be using the SerialPort object to perform the communication. It still wouldn't be directly with the PIC chip, though, but the actual communication may not matter all that much if it really is serial, as you'd just need to know the protocol and the port number.
As for the graphical element, doing that directly in GDI would be an exercise in frustration. Fortunately, there are LOTS of packages out there to allow for simple graphing (which is probably what you are looking for as you probably only have a line, or multiple line, graph).
Re: Graphical User Interface(GUI) with Visual Basic 2010
Thanks Andersson,
The task i have before me is actually to transmit bio signals over a distance using zigbee technology. i already bought,and configured the zigbee modules. Now i need to make some circuitry that involves basically PIC18F452 and the zigbee modules, and also to program the PIC18F452, which is on going @ the moment. I also need to have a kind of graphical preview/display of the signal on a computer at both transmit and receive ends. it is this display that i refer to as GUI. I am using VB 2010 . The PIC18F452 is to be connected to my PC with a FTDI cable.
Two issues now; how to communicate with the PIC18F452 via the USB/Serial port so as to send and receive data from it, and also how to make the GUI.
i think i'm a bit clear ....thanks for your interest
regards,
bobble
Re: Graphical User Interface(GUI) with Visual Basic 2010
Well, this is the VBForums so I'm not going to comment about the hardware circuitry itself. However, as I mentioned (and so did Shaggy above) to read the data you need to know the protocol that is used. Reading data from a serial port is a pretty straight forward procedure, it's the interpretation of the data you need to be aware of.
The GUI part is how you want to present the data, is it a graph that needs to be drawn or just numbers to be displayed in a list box?
But as I also mentioned above, these are really two different questions and we should concentrate at one at the time. It's either about how to read the data or how to display the data once you have it.
Re: Graphical User Interface(GUI) with Visual Basic 2010
Thanks once again.....
Please i don't really understand what you mean by ''what protocol''..may be you can suggest some existing protocols.
Also,the data entering the computer is digital.
For the GUI, the acquired data is to be plotted on a graph
Re: Graphical User Interface(GUI) with Visual Basic 2010
There is no standard for data being passed across serial ports. It is just a series of bytes that can mean pretty nearly anything. If you read those bytes from the serial port, will you know what they mean? That's what the protocol is, in this case. Certain bytes may be used for something akin to punctuation, other bytes would be the data, potentially in various fashions, such as big endian vs little endian (the order of bytes in things like integers). In addition, there may be headers, padding (though that's unlikely), CRC values, and other things added in. You'd have to know what a data packet looks like, or else you'd have to work it out by looking at a bunch of packets. You can probably imagine how hard the latter could be. Fortunately, you probably do know the protocol as far as what bytes to expect. It rather sounds like you might be involved with creating that protocol. That would be ideal.
It also sounds like you might find that the communication isn't all that hard, but there will be some fairly arcane pieces, so it will be like most puzzles: Only simple after you have solved it. I believe that if you search this forum on SerialPort or Serial Port, and possibly if you search for that along with posts by (but not threads started by, as I don't remember him starting a thread on the subject, though he may have) dbasnett you might find some useful stuff.
Re: Graphical User Interface(GUI) with Visual Basic 2010
Hi
Quote:
I recently installed VB 2010, and have just learnt how to do basic numeric calculation and displays.
it sounds like you just started using vb.net, not sure if you have used any other languages, but diving into what your talking about is likely to become a headache very quickly.
you should at least spend some time learning a few concepts and theories behind whats involved before you dive into coding.
take it a step at a time,
like they mentioned above concentrate on 1 problem first, but id take it a step back again and say concentrate on the basics first, if it was me id split this into several projects for learning it then go ahead with putting it all together.
maybe like this, not in any particular order
-graphical representation trying different methods
-communicating via serial port/usb just basic stuff, maybe practice on a mouse or some basic device
-learn about data packets(just the basics) and the different 'layers' in computer communications
-protocols (i just looked up zigbee modules) its using IEEE 802 standard, and you will need to know about the data you plan to send through, so you will need to check whatever program/hardware the data is coming from
Re: Graphical User Interface(GUI) with Visual Basic 2010
Thanks all..it seems i have a very huge job ahead..any other guidance/help would do...
Regards,
Re: Graphical User Interface(GUI) with Visual Basic 2010
Re: Graphical User Interface(GUI) with Visual Basic 2010
Hi, if you have a FTDI cable I am thinking it is a USB to TTL serial converter cable that is also possibly the same cable you would use to program the PIC.
If this is the case then the PC sees the USB cable as a virtual comm port. In Visual Basic you would use the serial port component in the toolbox and configure it to transmit/receive serial data between the PIC and PC.
Your first job is to write some code for the PIC and verify you can receive data transmitted from the PIC to the PC. Use a terminal program for your tests and make sure you are getting what you expect at the terminal. There is no need to make it complicated, transmitting a simple "Hello World" once a second should be enough to prove your communications.
Once you are happy with the above you can start work on creating a VB Windows application to replace the terminal app. Do you think you have reached this stage yet?? If you do let us know and we can help you get started with VB.
Using the PIC allows you to create your own serial protocol which can be as easy as start of transmission - data - end of transmission. I personally would not worry about that too much just now it can come later.
Re: Graphical User Interface(GUI) with Visual Basic 2010
hi all,
please am still stuck here.
i am now able to access my com port,send and receive data. Now i need to plot a graph of the received data using VB 2010.
Rgrds