LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling a 5v relay throught usb port

Solved!
Go to solution

Dear All

 

 

I buy this 

 

http://www.ebay.com/itm/5V-USB-Relay-1-Channel-Programmable-Computer-Control-For-Smart-Home-New-/262...

 

And I thougt that it installs a driver to control it by COM port, but not. Seems that needs the create or write a dll library (I had never done that)

 

In attach is the data with dlls and a excutable to open and close the relay and it works, but I would like to put it working with labview.

 

Can someone help me?

 

 

Best regards

cpalha

0 Kudos
Message 1 of 31
(5,650 Views)

Hi people

 

Seems there is no solution....I am looking for all internet and no labview examples....

In attach I add more information

 

Best 

 

cpalha

Download All
0 Kudos
Message 2 of 31
(5,609 Views)

Hi Cpalka, 

Does it answer to VISA request?

Regards,

Jovan

Jovan N. - Application Engineering
0 Kudos
Message 3 of 31
(5,554 Views)

Even though you didn't include the DLL, I'm guessing that they provided one for you? If that's the case, you can use the Call Library Function node in LabVIEW to call the functions as specified in the header (.h) file - you might even be able to use the header file and DLL with the 'import shared library':

 

2016-04-07_09-59-29.png

 

Did you say that it shows up as a COM port in device manager? If that's the case - you might also be able to find out what the serial commands are (ask the manufacturer for the documentation) and then you can use NI-VISA in LabVIEW to write the commands to the serial port.

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 31
(5,548 Views)

Hi Sam

 

Thanks for your help.

No this is not appear has a COM port, if yes as I thought I use the visa.

 

I will try import the dll file (I never done it before) to see what will appear ??????

 

Once again manya thanks

 

cpalha

0 Kudos
Message 5 of 31
(5,528 Views)
Have you been in contact with the manufacturer?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 31
(5,515 Views)

Hi Sam

 

I creat this project with the dll and h files.

But seems before create I need to add some information to the commands as the bumber o chanel (Isuppose it is 1) because i only have 1 relay.

Other thing is the Device name mine is AHFV6

See the other picture from control panel, it appears when I conect the usb cable

 

Best

cpalka

 

 

Download All
0 Kudos
Message 7 of 31
(5,504 Views)

The manufacture is from ebay.

A send some files, a exe to control, *.dll and *.h files

 

best

cpalka

0 Kudos
Message 8 of 31
(5,497 Views)

That price is quite attractive.  But in the future you may want to use some standard hardware like an Arduino and a relay shield.  There are currently two toolkits for LabVIEW where commands are sent and the Arduino reacts and sends a reply.  This is LIFA which is older but works fine, and LINX which is newer and has more hardware support.  Both have standard LabVIEW VIs where you can do things like read DI, set DO, read AI, set PWMs, perform I2C and SPI communication, and interface with various sensors and control various equipment.  

0 Kudos
Message 9 of 31
(5,478 Views)

Hi Hooovah

 

I am an engineer and I need to make some solutions that there no so easy to do.

I have a board ni9237 for reading 3 load cells and one encoder (a reduce de 5v to 15mv and then I get pulses with 15mv) to calculate speed of a slow motor and everything works.

I only need now a automatic start for the motor thats why I buy this and with visa and pressing only one button in labview I start the motor and the saving data, but it dont uses COM port.

 

I know the system you talk about but sometimes we need to do cakes without eggs 🙂

 

 

Thanks a lot

 

cpalka

0 Kudos
Message 10 of 31
(5,459 Views)