This forum is for problems and discussions related to programming with VB inside Visual Studio for versions starting with the.Net version (2002). Before posting your question, check if your issue is related to the following categories.
If I wanted to attach a 9 pin serial port to the Arduino Uno, what would I. Applications in Visual Foxpro) but no hardware experience (probably.
In order to get better response, take a look. Category Appropriate forum Other versions of Visual Basic GUI related (ASP and VB for MVC ) Forms Design and.Net Controls SQL transact 3rd party products.NET Framework Class Libraries Windows WCF, System.Net namespace and remoting technology If you have any suggestion to this table, please jump into for discussion. You could share this announcement via this URL:. This forum is for problems and discussions related to programming with VB inside Visual Studio for versions starting with the.Net version (2002). Before posting your question, check if your issue is related to the following categories. In order to get better response, take a look.
Category Appropriate forum Other versions of Visual Basic GUI related (ASP and VB for MVC ) Forms Design and.Net Controls SQL transact 3rd party products.NET Framework Class Libraries Windows WCF, System.Net namespace and remoting technology If you have any suggestion to this table, please jump into for discussion. You could share this announcement via this URL:.
Visual Foxpro Tutorial
Sorry, I can't point you to an idiot's guide, as I haven't really seen any either. But I can maybe give you a little insight from my experience. Which at times has involved some idiocy.
There are libraries and packages you can buy that may be a lot more graceful, but if you don't mind a little grunt work here is a brief example to get you started. The only way I've done serial communications using VFP so far has been with the Microsoft MSComm control. I would just start with some simple little test project to get a bit comfortable. Create a form and drop an instance of the comm control on it. You can get access to it in the usual way, from the Tools-Options-Controls-Microsoft Communications Control.
This will add it to your form controls Active X controls dialog. In the form's 'Init', add this statement: VFP.AUTOYIELD =.F. In your comm control's 'Init', put something like this. CODE IF (THIS.commEvent 1) &&. Xmit.THISFORM.iTx.PICTURE = 'dead.ico' &&. Turns off LED after command button turned it on RETURN ENDIF &&.
Something residual in the buffer IF THIS.InBufferCount 0 AND THIS.commEvent # 2 IF THIS.commEvent 1000 &&. Some sort of comm error. Close, reopen, re-init This.PortOpen =.F. DOEVENTS x = INKEY(1, 'HM') THIS.Settings = '9600,N,8,1' THIS.RThreshold = 1 This.SThreshold = 1 THIS.InputLen = 100 THIS.inBufferSize = 1024 THIS.CommPort = THISFORM.nPort DOEVENTS x = INKEY(1, 'HM') ENDIF RETURN ENDIF &&. We have data, let's react to it IF (THIS.commEvent 2) DO WHILE THIS.InBufferCount 0 cInString = THIS.INPUT DOEVENTS x = INKEY(.1, 'HM') DO CASE. If we get a ACK, send ENQ CASE ASC(cInString ) = ACK THIS.OUTPUT = CHR(nENQ) DOEVENTS x = INKEY(.1, 'HM'). If we get a ENQ, send ACK CASE ASC(cInString ) = nENQ THIS.OUTPUT = CHR(ACK) DOEVENTS x = INKEY(.1, 'HM') OTHERWISE.
Otherwise, concat the buffer THISFORM.cInString = THISFORM.cInString + cInString ENDCASE ENDDO &&. Here, you can respond to whatever you receive, parsing the data or values and dealing with them. Is the string all there? Is there an end-of-string, CRC. RETURN Hope that helps a little.Dave Summers- Even more Fox stuff at: RE: Serial port comms.
Description
Used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port (also known as a UART or USART), and some have several.
On Uno, Nano, Mini, and Mega, pins 0 and 1 are used for communication with the computer. Connecting anything to these pins can interfere with that communication, including causing failed uploads to the board.
You can use the Arduino environment’s built-in serial monitor to communicate with an Arduino board. Click the serial monitor button in the toolbar and select the same baud rate used in the call to
begin() .
Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board). Don’t connect these pins directly to an RS232 serial port; they operate at +/- 12V and can damage your Arduino board.
To use these extra serial ports to communicate with your personal computer, you will need an additional USB-to-serial adaptor, as they are not connected to the Mega’s USB-to-serial adaptor. To use them to communicate with an external TTL serial device, connect the TX pin to your device’s RX pin, the RX to your device’s TX pin, and the ground of your Mega to your device’s ground.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |