NEWS
emc2_2.2.6 Release
A fresh bugfix release (2.2.6) - (Changelog).
You can get it: as a source package from sourceforge , from CVS , or as a precompiled package which works on Ubuntu as described here.
 
Ubuntu 8.04&EMC2 Live CD
The EMC2 team now has a brand new custom Live-CD (EU mirror) based on Ubuntu 8.04 with emc 2.2.x included, that will let you try out EMC2 before installing, and it's also the easiest way to install Ubuntu and EMC2 together. (more)
 
emc2_2.2.5 Release
A fresh bugfix release (2.2.5) - (Changelog).
You can get it: as a source package from sourceforge , from CVS , or as a precompiled package which works on Ubuntu as described here.
 
Language
Site Search
Google
Web LinuxCNC
Polls
EMC Version you are using
 
What type of machine do you run with EMC? Vote once for each machine
 

Table of Contents

List of figures

1 VCP

1.1 VCP: A small example

NOTE: VCP is deprecated, and will most likely not be getting any new development or additional widgets. We strongly recommend using pyVCP. However, pyVCP won't be released until version 2.2 comes out, and VCP is in version 2.1. That means some people will wind up using VCP, so we can't simply drop it.1

Place the following in the file tiny.vcp:

vcp { 
main-window {
box {
button {
halpin = vcp.pushbutton
label { text = "Push Me" }
}
LED {
halpin = vcp.light
}
}
}
}

The above file describes a tiny Virtual Control Panel, with one push button, and one light. To see what it looks like, we need to start HAL:

$ halrun

Next we load halvcp, and give it the name of our .vcp file:

halcmd: loadusr halvcp tiny.vcp
halcmd:

There may be some text printed as halvcp parses the tiny.vcp file, but when it finishes, there should be a small window on your screen, with a button and an LED. It will look something like figure [.].

Figure: tiny.vcp on the screen

So, we have a button and an LED, but they aren't connected to anything, so nothing happens when you push the button. However, the LED and the button both have HAL pins associated with them:

halcmd: show pin
Component Pins:
Owner Type Dir Value Name
03 bit IN FALSE vcp.light
03 bit OUT FALSE vcp.pushbutton
halcmd:

To make something happen, we can connect a HAL signal between the button and the light:

halcmd: newsig jumper bit
halcmd: linksp jumper vcp.pushbutton
halcmd: linksp jumper vcp.light
halcmd: show sig
Signals:
Type Value Name
bit FALSE jumper
==> vcp.light
<== vcp.pushbutton
halcmd:

Now push the button, and the the LED should light up!

1.2 VCP: Another small example with EMC

Place the following in the file estop.vcp:

vcp { 
main-window {
toggle { halpin = vcp.estop }
}
}

In your .hal file, remove any existing signal linked to iocontrol.0.emc-enable-in and add the following lines:

loadusr -W halvcp estop.vcp
newsig estop bit
linkps vcp.estop => estop
linkps estop => iocontrol.0.emc-enable-in

Now, when running your machine, the ESTOP button in the GUI is disabled, and the ESTOP button in the VCP window is used instead.

1.3 VCP Syntax

1.3.1 Block

A block's format is:

tag { contents }

The contents can consist of attributes that describe the block, or other blocks that nest inside it.

A attributes format is

name = value

The attribute names that are acceptable for each block depend on the block tag, and will be listed later.

Footnotes

1   A .vcp to .xml translator that takes a vcp file and turns it into one that pyVCP can use is on my to-do list. That would enable VCP users to easily switch over to pyVCP. If such a translator is written, VCP may be removed from the version 2.2 release. back

© 2008 LinuxCNC.org
Joomla! is Free Software released under the GNU/GPL License.