Data streaming arduino with VisualfoxPro

Good evening,

I'm trying to make my Arduino Uno board work together with some slightly dated software,

Visual Foxpro 9.0.

I've seen several tutorials explaining how to connect an Arduino board to Foxpro, but I can't understand the process to get both sides to communicate. Anyone know how to do it?

Thanks in advance

Why not post a link to one of the tutorials, and point out what you don't understand?

This is a project created to make LEDs light up on command by making VisualfoxPro and Arduino communicate.

my goal is a little different.
I should be able to transfer data from Arduino to Foxpro from a sensor. a data stream.

I also leave a blog guide that explains how to connect Arduino and Visual Foxpro.

the problem is that I can't understand how to transfer the Arduino sketch to Visualfox pro.

I moved your topic to an appropriate forum category @jacobr92 .

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

That's not how it works. Each side runs its own code, entirely unaware of what is on the other side (other than something is supposed to be there). They communicate solely through serial-over-USB.

  • sketch on Arduino
    • built-in serial with Serial
  • form on VFP (the sample code below from that thread you linked)
    • a form component that wraps an object that can send information to the serial port
      PUBLIC oForm
      oForm = CREATEOBJECT("Form")
      oForm.ADDOBJECT("comm", "olecontrol", "MSCommLib.MSComm")
      
      WITH oForm.comm
      .CommPort = 1 && Set to your COM port number
      .Settings = "9600,N,8,1" && Match baud rate and settings
      .PortOpen = .T. && Open the port
      ENDWITH
      
      * Send "Hello World" to Arduino
      oForm.comm.Output = "Hello World" + CHR(13) + CHR(10)
      
      After assigning a few settings properties, data is sent by assigning to the Output property.

In that case, the bits flow in the other direction. On the Arduino, you'd use Serial.print. In VFP, you apparently read the Input property, either by

  • constantly polling it
  • hooking an event that tells you when data arrives

I did not find any official documentation online, but there is a Word doc from the University of Iowa that (at least partially) explains this, and some old forum threads in various places. Relevant properties include

  • OnComm
  • RThreshold
  • InputLen
  • InBufferSize

Thank you.
How can I insert code into Visual Foxpro?

What is the procedure?

Do you think it is possible to create a Plot to see the data in real time?

That's sorta like asking how to add a spreadsheet to Excel. It's one of the core functions of the program; are you familiar with it at all?

As a database program, it may not offer a particularly good way to plot data. Have you considered trying to have the Arduino talk to Excel, perhaps using the same MsComm component? There are discussions about that out on the internet as well.

If you intend to store the data, especially in DBF files for whatever reason, then VFP is probably a better choice.

I use Visual Foxpro from some month. nothing to serious.
Can you help me?
I try with Excel data streamer to send the data in a spreasheet. But the problem is create an executable with excel. For me, Visual Foxpro for this things is better.

Now would be a good time to get serious, and learn how to do serial communications with Visual Foxpro. That is the way to communicate with Arduino.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.