WorldViz User Forum  

Go Back   WorldViz User Forum > Plug-in development

 
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-08-2003, 10:42 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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')
When you want to reset your sensor you would perform the following command:

Code:
mysensor.reset()
When you want to retrieve data from your sensor you would perform the following command:

Code:
data = mysensor.get()
If you would like to send a command to your sensor then performing the following command:

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!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC