Hi all... I have a 24 bit digital I/O USB device that uses standard ASCII commands to turn on/off bits or read bits.
I was thinking of using the Generic serial plugin to talk to this device since it creates a virtual COM port.
HOWEVER... I can't seem to figure out HOW to send a string to this device through the sequence. When I define the channel for the serial device, the only options are the ramps/on/off, etc... not some sort of string input.
Do I need to define a 'channel' for each string input and then just trigger that channel ON? How do I send the strings to the Generic Serial device?
The device in question I'm trying to talk to is the Elexol USB I/O 24.
http://www.elexol.com/IO_Modules/USB_IO_24.php
If anyone wanted to make a plugin that would be great too, but I need a short term solution.
Thanks!
dononeil wrote:HOWEVER... I can't seem to figure out HOW to send a string to this device through the sequence. When I define the channel for the serial device, the only options are the ramps/on/off, etc... not some sort of string input.Do I need to define a 'channel' for each string input and then just trigger that channel ON? How do I send the strings to the Generic Serial device?
The device in question I'm trying to talk to is the Elexol USB I/O 24.
If that board uses a different command format than the pre-packaged Vixen plug-ins provide, you would probably need to write a custom plug-in to communicate with it.
don
djulien wrote:If that board uses a different command format than the pre-packaged Vixen plug-ins provide, you would probably need to write a custom plug-in to communicate with it.don
I checked all the plugins and didn't find anything for this board, or anything like it. I figured since it just used simple serial communications with text that I could use the genericserial plugin. But there is no documentation on how that plugin works, how to send out strings, etc...
Furthermore, there is no 'plugin development kit' anywhere that I can find, to easily make a plugin. Anyone have any other suggestions?
dononeil wrote:Anyone have any other suggestions?
Check out this tread. http://www.doityourselfchristmas.com/forums/showthread.php?t=6798&page=2
The "Howtodriver.pdf" is a great start.
ctmal wrote:Check out this tread. http://www.doityourselfchristmas.com/forums/showthread.php?t=6798&page=2The "Howtodriver.pdf" is a great start.
Thanks for the info... I'm not much of a C programmer, so not sure if I'm going to be able to figure it out or not.
Also, something else that might be of help....
If you want to see what is going to the serial port you can use portmon from sysinternals.
I think this is the right link...
http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
dononeil wrote:Thanks for the info... I'm not much of a C programmer, so not sure if I'm going to be able to figure it out or not.
dononeil, I'm interested in helping to write this driver. I've written a library for serial port communication to a servo drive before, so I'm somewhat familiar with the .NET environment. And I just the other day decided to write a dummy vixen plug-in, just to see how it works. I think it should be fairly straightforward.
If you can provide me with some details on what the serial data output needs to look like, I can start roughing something together, as soon as I get my computer set back up at home (just moved back home from college for the summer).
JonathonReinhart wrote:dononeil, I'm interested in helping to write this driver. I've written a library for serial port communication to a servo drive before, so I'm somewhat familiar with the .NET environment. And I just the other day decided to write a dummy vixen plug-in, just to see how it works. I think it should be fairly straightforward.If you can provide me with some details on what the serial data output needs to look like, I can start roughing something together, as soon as I get my computer set back up at home (just moved back home from college for the summer).
Very cool... The documentation for accessing the device can be downloaded here: http://www.elexol.com/Download/documents/USBIO24Rds1.pdf
It's 'brain dead simple'.... 3 ports on the device; A, B and C
to _output_ a binary value on the port you just send and ASCII "A" "B" or "C" follwed by a single binary value for the value you want to set on the port. All this just goes out the virtual COM port, or you can use the DLL directly. I've programmed them in Basic and Perl with great simplicity.
The simplest plugin would just turn this device into a 3 port/channel device, with 1 value from 0-255 being written to it. Then you could specify which bits to turn on/off depending on what level you define in the timeline.
There are all sorts of plugin devices that connect directly to this device, relay boards, Digital to Analog converters, etc...
Check them all out at http://www.elexol.com
If you need code examples I can give you some in perl or basic.
A more 'complex' plugin would be one that set each bit independantly making the assumption it was connected to a relay, so there would be 24 channels in total.
dononeil wrote:A more 'complex' plugin would be one that set each bit independantly making the assumption it was connected to a relay, so there would be 24 channels in total.
This is more along what I was thinking. I could always write it to have both "Port Mode" (3 ABC) and "Individual Mode" (1-24), but I picture it being more useful to Vixen as a 24 port discrete output module. Do you agree?
Does anyone have any input on a discrete output driver? I can think of two methods:
- Any non-zero value turns the ouput on
- A value greater than 127 (50%) turns the output on
Also, I assume the driver responsible for caching the current state of each channel, in order to only transmit updates, and not the data for every channel, every time.
JonathonReinhart wrote:This is more along what I was thinking. I could always write it to have both "Port Mode" (3 ABC) and "Individual Mode" (1-24), but I picture it being more useful to Vixen as a 24 port discrete output module. Do you agree?Does anyone have any input on a discrete output driver? I can think of two methods:
- Any non-zero value turns the ouput on
- A value greater than 127 (50%) turns the output onAlso, I assume the driver responsible for caching the current state of each channel, in order to only transmit updates, and not the data for every channel, every time.
Yes, a '24 port discrete output module' would be ideal.
I would think you would just trigger each bit to be 'on' or 'off' based on >127 (50%) or <=127.
So, an intensity of 0-127 turns it off, and 128-255 turns it on.
Writing the 3 ports (8 bits each) only requires 6 bytes of data, so updating everything at once is no big deal.
The one thing you have to look out for is CR & LF outputs... the devices ONLY expects 2 bytes for the command (the port A, B or C, and the value).
Here's an example from some perl test code, this just turns off and on 1 bit:
use Win32::SerialPort;
my $port = 'COM4';
my $PortObj = new Win32::SerialPort ($port) || die "Can't open $port: $^E
"; # $quiet is optional
$PortObj->error_msg(1); # use built-in error messages
$PortObj->user_msg(1);
$PortObj->databits(8);
$PortObj->baudrate(115200);
$PortObj->parity("none");
$PortObj->stopbits(1);
$PortObj->write_settings || die "Couldn't write settings
";
$zero=chr(0);
$off=chr(0);
$on=chr(1);
# Set the ports to output mode (!A)
$PortObj->write("!A$zero");
$PortObj->write("!B$zero");
$PortObj->write("!C$zero");
while (1) {
# Turn on a bit(s) on each port
$PortObj->write("A$on");
$PortObj->write("B$on");
$PortObj->write("B$on");
sleep (1);
# Turn off each port
$PortObj->write("A$off");
$PortObj->write("B$off");
$PortObj->write("B$off");
sleep (1);
};
Next question... how quickly can you have it done? lol... I need it in 2 weeks 🙂 I can test every day if you need me to! 🙂

