LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usb to serial relay ftdi commands

Hi all,

 

I am having the problem that I have a USB relay with a USB to serial converter running the FTDI driver, but I cannot get it to switch the relays in Labview (running 8.5).  It has 8 relays and I'd like to be able to cycle through them all. I know the board does work, as we have a separate .exe file that will open communication and open/close the relays just fine (It is a simple gui, I thought about trying to use this through Labview, but I don't know the system commands to make it select the relay buttons in the gui). I'd like to be able to do this automatically, and run this as a subVI. My problem is I don't know the commands to make the relays switch, in fact I'm not sure how to check to see if Labview is communicating with the device at all.

 

I have installed the driver and used the MAX setup to rename the device "USBRelay". I can click on the 'open VISA Test'  and this will bring up a dialog box with many different options for changing attributes and writing to the device.  If this is open, I cannot communicate with the device through the other .exe program (does this mean it is communicating? or just that the port is currently being used?)  When I try to change an attribute, it will sometimes change the current value and sometimes return a long string of hexadecimal, which I'm assuming is an error.  So, with all of this, I think it is communicating (verification from anyone? or ideas of how to verify communication?).  But now I can't figure out how to actually make it switch the relay.  I tried following this post from earlier, but using a string command doesn't accomplish anything.

 

I'm really stuck and have been looking around on this forum and online for 2 days, but can't figure this out. Any help would be VERY much appreciated.

 

John

0 Kudos
Message 1 of 2
(2,765 Views)

Hi John,

 

Without knowing the specific commands that the USB device is expecting, I'm afraid you might be stuck. Who makes the device? Maybe they have an API that you could get this information from? Alternatively, you could do some research into USB spy or listener programs to try to capture the commands being sent on the bus by the provided GUI, though I've never had any luck with this (it's how the Kinect was hacked).

Cheers!

TJ G
0 Kudos
Message 2 of 2
(2,742 Views)