#1
|
|||
|
|||
Creating a Vizard Sensor Plugin
If you want to connect to a hardware device within your Vizard script you need to use a Sensor Plugin. Vizard already comes with Sensor Plugins for popular hardware devices, but you can easily make one for your own hardware device. You must know C/C++ programming in order to create one. Here are the basic steps:
Step 1: Download sensor.zip to your computer and unzip it. Step 2: Open the project files. If you don't have Visual Studio then create a Win32 DLL project and add the files main.cxx and sensors.h to it. Fill in the functions outlined in main.cxx. When you compile your program make sure the extension for your dll is .dls. Put your new plugin in the [VIZARD_PATH]/plug-ins directory, where [VIZARD_PATH] is the location of your Vizard installation. Step 3: To use the plugin within you Vizard script it would look something like this, assuming the name of your plugin is mysensor.dls: Code:
import viz viz.go() mysensor = viz.add('mysensor.dls') Code:
mysensor.reset() Code:
data = mysensor.get() Code:
mysensor.command(1,'some string',1.2,3.4,5.6) That's it, you should now have your own working Sensor Plugin for Vizard. If you would like to share your plugin with other users then read the post Sharing Files on SourceForge. Have fun! |
Thread Tools | |
Display Modes | Rate This Thread |
|
|