#1
|
|||
|
|||
Vizard output signals/voltages?
We know Vizard can receive information from external hardware via plug-ins... But, can Vizard send data (e.g., voltage signal) to other hardware?
We have an experimental protocol in which subjects walk on a treadmill while viewing smooth/continuous motion simulations. The kind of motion and scenery changes every 30 seconds, and simultaneously we are collecting subject motion data via an optical tracking system. We would like to be able to accurately mark the changes in motion and scenery in time with signals (e.g., voltages) to another computer running LabView. This way, we can link changes in subject stability with changes in the scenes. Can Vizard send signals, say through the COM port, to another device? |
#2
|
|||
|
|||
Vizard directly supports a USB-based multifunction data acquisition and control device called LabJack. This can read voltages into digital values and convert digital values into voltages. This is probably the easiest solution since there is no direct support in Vizard to change the voltages on either serial (COM) or parallel ports.
LabJack multifunction data acquisition and control device: http://www.labjack.com/labjack_u12.html You might be able to find some libs available from the Python community that provide direct control of parallel but I don't immediately know of any. |
#3
|
|||
|
|||
Thanks...
Can Vizard call C or C++ code that will then trigger the desired signal through serial or parallel ports? |
#4
|
|||
|
|||
Yes, if you have your own C/C++ code and want Vizard to execute it, that's very straightforward and relatively easy if you have a C compiler. The method is to buld a compiled Python module (DLL) that you "import" just as if it were a .py module. There's very accessible docs on how to "extend" the Python language on the Python website:
http://docs.python.org/ext/ext.html If you get stuck on this feel free to ask further. |
#5
|
|||
|
|||
#6
|
|||
|
|||
Visual Studio .NET and Python version #s
In preparation for developing a plug-in to send data to an external device, I have acquired a copy of the Visual Studio .NET version 2002... will this version work okay? And what version of Python is integrated with Vizard?
FYI, I ran across a Python plug-in module (Win32 Serial Interface Module) at http://starship.python.net/crew/roger/ that might do the trick. There seem to be a lot of interesting and potentially useful things for Vizard users on this website. |
#7
|
|||
|
|||
Yeah, that version should work fine. Vizard uses Python 2.3. The Vizard SDK comes with the necessary python files in order to create a plugin.
|
#8
|
|||
|
|||
Great, thanks!
|
#9
|
|||
|
|||
Serial port access
I found a project on sourceforge.net called pySerial in which someone has already developed a module for reading and writing data to the serial port(s). They provide a Windows installer as well as the source code. When I try to run the Windows installer, it crashes because there is "no python installation found in the registry." I click 'OK' and then the following window appears:
Why doesn't the installer find the version of Python that Vizard uses? |
#10
|
|||
|
|||
Try running the attached script with Vizard. It should register Vizard as a python installation.
|
#11
|
|||
|
|||
That worked nicely... thanks!
|
#12
|
|||
|
|||
Okay, the module installed fine, but now when I try to import it within a script, I get the following error message:
ImportError: No module named serial The installer placed files in the following directory: C:\Program Files\Vizard25\bin\lib\site-packages\serial The attached zip file contains all the source code. Only a subset of these was dropped in the above directory. The remainder are not able to be found at all on my hard drive. Any suggestions? |
#14
|
|||
|
|||
Thanks! After installing win32all, I was able to run my script (including 'import serial') without any error msgs.... however... near the end of installation process there were two successive error msgs.
The first is attached to this posting. The second is attached to the subsequent posting. Is this something I should worry about? |
#15
|
|||
|
|||
second error msg
|
#16
|
|||
|
|||
I'm not sure what the error is about, but if your script is working then I'm assuming that the files were installed correctly.
|
#17
|
|||
|
|||
Okay, I'll leave you alone....... for now!
|
#18
|
|||
|
|||
I've installed the opensource module for communicating through the serial port. Connected to the serial port, I have a numeric keypad. For any number I press, when I issue a command to read the port (e.g., "port.read()") a series of the following kind of data are shown:
\x80 Data encoded like this are called a "two's complement little-endian binary string" By using the Python module "pickle," this data can be decoded into the following: -128L ...which itself is encoded and is called a "long." Have you ever dealt with this kind of encoded data? ...and decoding of said data? If not, can you refer me to a helpful resource ? |
#19
|
|||
|
|||
The value '\xhh' represents a character with a hex value of hh. In your case the character '\x80' would be equal to the hex number 0x80, which is 128. If you wanted to convert a number to this character format you would do the following:
Code:
val = chr(128) Code:
val = ord('\x80') |
#20
|
|||
|
|||
Serial Port Access
Hello,
I am trying to access the serial port. When I am doing import serial I am getting the error : No Module named serial. I was going through the suggestion given in the Forum. I found the following suggestion................. The pySerial library requires that you have the win32all python extension installed. You can download the installer here. (Scroll to the bottom of the page) When I am trying to download the installer, I am not getting it. Actually, the link given above is not working. Has the site changed? If anyone has some information....it would be very helpful to me. Thanks Uttama |
#21
|
|||
|
|||
Hello,
I was trying to search the plugin. http://sourceforge.net/project/showf...group_id=46487 Here we can find the latest as of June 19, 2008. This version being downloaded has solved my problem. It is detecting the serial port and error message is not coming. Thanks Uttama |
|
|