Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a solenoid valve using a NI USB-6501 with Labview

I am trying to write a Labview program to turn on/off a 120 V solenoid valve (wired to NI USB- 6501 through a SS relay which gives 3-5V output). The problem I'm facing is that when I run the VI, the valve turns on at either Boolean values (1 or 0) but ideally I'd like it to turn on at 1 and off at 0.

 

I have attached the VI below. Can anyone help me figure out what I might be during wrong or if there's some other function I should be adding to make my VI work? I'm pretty new to using labview and would really appreciate any help!

 

Valve control circuit.jpg

0 Kudos
Message 1 of 6
(1,629 Views)

Please share the connection diagram and the SSR model to help you better.

 

Since it is behaving in the opposite manner, the simplest solution is just to invert the boolean data before writing to DAQmx API.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(1,578 Views)

valve circuit_may 10.jpg

Here's a schematic of the setup. The output lines from the relay are connected to the digital I/O ports on USB-6501. Thanks!!

0 Kudos
Message 3 of 6
(1,553 Views)

You have not mentioned the Pins on 6501 connected to the SSR.

 

Ideally, you must connect the (-) terminal of SSR to GND and (+) terminal of SSR to any of the digital port line Px.y. If you are using the DIO in open collector configuration by connecting SSR+ to 5V and SSR- to Px.y, it is expected that you have to write a False boolean to turn ON the SSR.

 

Be sure to configure the task to be Active Drive, the default mode is open-collector and limited to 8.5mA per line.

santo_13_1-1620690837440.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 4 of 6
(1,545 Views)

Thanks for the reply!!

 

I connected the SSR+ to 5V and SSR- to P1.1 but the task is configured as active drive in NI-max. How do I specifically write a false boolean? Sorry I'm a bit confused

0 Kudos
Message 5 of 6
(1,523 Views)

The easiest change, just to change the connection, connect SSR+ to P1.1 and SSR- to GND. You can retain the code that you've now.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 6
(1,519 Views)