Hello,
I am attempting to use an NI 9485 SSR module to control a set of Clippard electronic valves I am using for an experiment. Each valve will send a different type of fuel into a combustion chamber for my experiment.
My idea was to use an NI cDAQ-9189 with the SSR module connected to a PC, and write a python script that could send a true/false signal to the SSR in order to only turn on the one valve that I need with the others remaining closed.
However, I am unable to get a response from my SSR. The following codes are what I have written so far:
First, I used a script from https://github.com/ni/nidaqmx-python to test if my hardware was present.
import nidaqmx as ni
def query_devices():
local_system = ni.system.System.local()
driver_version = local_system.driver_version
print('DAQmx {0}.{1}.{2}'.format(driver_version.major_version, driver_version.minor_version,
driver_version.update_version))
for device in local_system.devices:
print('Device Name: {0}, Product Category: {1}, Product Type: {2}'.format(
device.name, device.product_category, device.product_type))
query_devices()
>> DAQmx 21.8.0>> Device Name: cDAQ9189-1CEF139, Product Category: ProductCategory.COMPACT_DAQ_CHASSIS, Product Type: cDAQ-9189>> Device Name: cDAQ9189-1CEF139Mod1, Product Category: ProductCategory.C_SERIES_MODULE, Product Type: NI 9485
Then, following the digital output example I was able to come up with the following code for actually sending a command to the SSR. Currently I am only working with one valve, so I only have port 0, line 0 occupied. I also have a voltmeter in parallel to my valve to check for voltage flow across the connection.
import nidaqmx
task = nidaqmx.Task()
task.do_channels.add_do_chan('cDAQ9189-1CEF139Mod1/port0/line0')
task.start()
value = True
task.write(value)
Which prints:
>> 1
Then I stop the task and close it.
task.stop
task.close()
The documentation states that the relay is normally open, so I assumed that I could just start the task and keep the relay open by setting it to True. However, I never see any voltage flow through the circuit, nor does the valve open/close.
I also attempted to test the panels using NI MAX, but got no response from the SSR either. Didn't matter if I set the port to high or low.
The final goal is to create a GUI application that would allow me to control all the valves in my system from my PC, without lugging around a huge switchboard and control panel. But as of now, I can't even control a single valve.
Can anyone provide me with some insight as to why my method is not working? I am pretty new to python still, so any help will be much appreciated.