A new prototype is “born”

This week I took two tasks upon myself… first being to use PHP to pass arguments to the C code developed by Dave and second to mockup a prototype using a two valve configuration.

PHP Passing

On passing values and arguments to the C code: This task was relatively straight forward, as I thought it would be. I simply build a string within the PHP script that contains the correct arguments and values to control the valves. This looks something like:

$runString = "serialDriver " . $glassSize . " " . $liquid1Port . " " . $liquid1Amount . " " . $liquid2Port . " " . $liquid2Amount . " " . $liquid3Port . " " . $liquid3Amount

Above:

  • runString is the variable name for the string I am building
  • glassSize is set with a call to the database class to get the either chosen glass size or default
  • liquid”n”Port is set by a call to the database class to get the array of liquid ID’s and their corresponding port number
  • liquid”n”Amount is set by a call to the database class to get the amount of each liquid in a drink by drink ID and store it relative to the liquid ID

Next I’ll use the execute command (exec is a built in PHP function) to run the compiled C code and pass the variables to it.
exec($runstring);

As you can see, the string I just made is then simply passed, via the exec command, as a system command and executes the serialDriver.

Two Valve Prototype

The building and configuring of the two valve prototype was not a hard task, it just took a little bit of actual construction. We first had to split the CO2 line so that we had two separate lines for powering the flow of the system. Next we wired up the harness to accommodate two of our 12VDC valves and created a system of “daisy-chaining” the ground line through the Relays (as to minimize the amount of wire clutter). Then we hooked up all the air and liquid lines and tested with system calls to pump from the two different bottles and finally we used the C driver to control the whole thing!

All in all it was a successful and productive week with a lot of progress made!

Note: I also helped Mike with the interstitial page and passing of the information from page to page. And last but not least, I ordered the rest of the hardware, which includes but is not limited to:

  • 14 more valves
  • CO2 manifold
  • Connectors and Quick disconnects for the manifold
  • Various tube fittings
  • 1-way flow valves
  • Rubber Stoppers (for bottle assemblies)
  • Tube clamps

Next up is making a 4 valved prototype and starting construction on the actual housing of this “beast”.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*